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 2016/01/25 21:30:41 UTC

[01/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp Server API

Repository: olingo-odata4
Updated Branches:
  refs/heads/OLINGO-832_StreamSerializerPoC 0cc219943 -> 44e1b0263


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java
index 1e8acec..e7f7037 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java
index 5b3fe25..4612f21 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java
index 793708c..860eaa6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java
index 762ff03..627fa1f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java
index a761154..6ee25ec 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java
index bdd8c16..18ee432 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java
index 4369d39..ecf94c7 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java
index 785931d..f0cc0f8 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java
index f58cb04..2d3cd0d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java
index 735c631..f0c907b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOptionKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java
index 227bc80..9e782e5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Alias.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Alias.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Alias.java
index 33f2dc2..9d44c65 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Alias.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Alias.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Binary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Binary.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Binary.java
index dcd039c..c13d15f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Binary.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Binary.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java
index a693728..2ce4eee 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java
index 7cb1834..c72a0a0 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java
index f324834..357b24f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,5 +22,5 @@ package org.apache.olingo.server.api.uri.queryoption.expression;
  * Super class of all classes used to build the expression tree
  */
 public interface Expression extends VisitableExpression {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java
index 956b06f..06daed4 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
index f0ddce8..224ddba 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java
index c4f5d96..3830e3b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java
index b4bdde2..d967c9b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -33,10 +33,10 @@ public interface Literal extends Expression {
   /**
    * Numeric literals without an dot and without an e return the smallest possible Edm Integer type.
    * Numeric literals without an dot, without an e and larger than 2^63 - 1 are considered as Edm.Decimal
-   * Numeric literals with an e, are considered to be Edm.Double 
+   * Numeric literals with an e, are considered to be Edm.Double
    * Numeric literals with an dot and without an e, are supposed to be Edm.Decimal
-   * 
-   * @return Type of the literal if detected. The type of the literal is guessed by the parser. 
+   *
+   * @return Type of the literal if detected. The type of the literal is guessed by the parser.
    */
   public EdmType getType();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java
index e39c0f8..4aa9fd3 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Method.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Method.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Method.java
index 10b213f..00bb69b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Method.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Method.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodKind.java
index 842cfad..6433325 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java
index 5fe7639..c259eba 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Unary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Unary.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Unary.java
index c84784b..7f37a0c 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Unary.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Unary.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java
index a5b070c..3e0907b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExpression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExpression.java
index b4a6c5f..1588dcf 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExpression.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExpression.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/package-info.java
index 4de05fc..10eefee 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/package-info.java
index 977226c..296ecc1 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java
index 856a266..f24554d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
index cf7cbf5..224d3c1 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java
index 983919c..ea01328 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,17 +19,17 @@
 package org.apache.olingo.server.api.uri.queryoption.search;
 
 public interface SearchExpression {
-  
+
   boolean isSearchTerm();
-  
+
   SearchTerm asSearchTerm();
-  
+
   boolean isSearchBinary();
-  
+
   SearchBinary asSearchBinary();
-  
+
   boolean isSearchUnary();
-  
+
   SearchUnary asSearchUnary();
-  
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java
index 9c3bdec..a3d69ad 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java
index c266308..bfc7884 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,6 +21,7 @@ package org.apache.olingo.server.api.uri.queryoption.search;
 public interface SearchUnary extends SearchExpression {
 
   SearchUnaryOperatorKind getOperator();
+
   SearchTerm getOperand();
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
index 9adb2db..07d1302 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/package-info.java
index 7d98835..127e379 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/test/java/org/apache/olingo/server/api/ODataRequestTest.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/test/java/org/apache/olingo/server/api/ODataRequestTest.java b/lib/server-api/src/test/java/org/apache/olingo/server/api/ODataRequestTest.java
index 3a3c66c..34b497f 100644
--- a/lib/server-api/src/test/java/org/apache/olingo/server/api/ODataRequestTest.java
+++ b/lib/server-api/src/test/java/org/apache/olingo/server/api/ODataRequestTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java b/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
index e349ef5..7ec1f47 100644
--- a/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
+++ b/lib/server-api/src/test/java/org/apache/olingo/server/api/TranslatedExceptionsTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/test/java/org/apache/olingo/server/api/prefer/PreferencesAppliedTest.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/test/java/org/apache/olingo/server/api/prefer/PreferencesAppliedTest.java b/lib/server-api/src/test/java/org/apache/olingo/server/api/prefer/PreferencesAppliedTest.java
index 49948dd..7aa28f4 100644
--- a/lib/server-api/src/test/java/org/apache/olingo/server/api/prefer/PreferencesAppliedTest.java
+++ b/lib/server-api/src/test/java/org/apache/olingo/server/api/prefer/PreferencesAppliedTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -36,27 +36,27 @@ public class PreferencesAppliedTest {
         + " odata.continue-on-error, odata.include-annotations=\"*\", odata.maxpagesize=42,"
         + " odata.track-changes, return=representation, respond-async, wait=12345",
         PreferencesApplied.with().allowEntityReferences().callback().continueOnError()
-            .preference("odata.include-annotations", "*").maxPageSize(42).trackChanges()
-            .returnRepresentation(Return.REPRESENTATION).respondAsync().waitPreference(12345)
-            .build().toValueString());
+        .preference("odata.include-annotations", "*").maxPageSize(42).trackChanges()
+        .returnRepresentation(Return.REPRESENTATION).respondAsync().waitPreference(12345)
+        .build().toValueString());
   }
 
   @Test
   public void caseSensitivity() {
     assertEquals("odata.include-annotations=\"*\", odata.maxpagesize=255",
         PreferencesApplied.with()
-            .preference("OData.Include-Annotations", "*").maxPageSize(0xFF)
-            .build().toValueString());
+        .preference("OData.Include-Annotations", "*").maxPageSize(0xFF)
+        .build().toValueString());
   }
 
   @Test
   public void multipleValues() {
     assertEquals("return=minimal, wait=1",
         PreferencesApplied.with()
-            .returnRepresentation(Return.MINIMAL).returnRepresentation(Return.REPRESENTATION)
-            .preference(null, null).preference(null, "nullValue")
-            .waitPreference(1).waitPreference(2).waitPreference(3)
-            .build().toValueString());
+        .returnRepresentation(Return.MINIMAL).returnRepresentation(Return.REPRESENTATION)
+        .preference(null, null).preference(null, "nullValue")
+        .waitPreference(1).waitPreference(2).waitPreference(3)
+        .build().toValueString());
   }
 
   @Test


[13/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] ExpressionParser parses path expressions

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
index 2a994d3..118c649 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
@@ -46,29 +46,22 @@ import org.apache.olingo.server.api.uri.UriResourceRef;
 import org.apache.olingo.server.api.uri.UriResourceValue;
 import org.apache.olingo.server.api.uri.queryoption.AliasQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
-import org.apache.olingo.server.api.uri.queryoption.FilterOption;
 import org.apache.olingo.server.api.uri.queryoption.QueryOption;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
 import org.apache.olingo.server.core.uri.UriInfoImpl;
 import org.apache.olingo.server.core.uri.UriResourceStartingTypeFilterImpl;
-import org.apache.olingo.server.core.uri.UriResourceTypedImpl;
-import org.apache.olingo.server.core.uri.UriResourceWithKeysImpl;
 import org.apache.olingo.server.core.uri.antlr.UriLexer;
 import org.apache.olingo.server.core.uri.antlr.UriParserParser;
 import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemsEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.FilterExpressionEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.OrderByEOFContext;
 import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
 import org.apache.olingo.server.core.uri.parser.search.SearchParser;
 import org.apache.olingo.server.core.uri.queryoption.AliasQueryOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.FormatOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.IdOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.SkipTokenOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.TopOptionImpl;
@@ -84,9 +77,7 @@ public class Parser {
   private final Edm edm;
   private final OData odata;
 
-  private enum ParserEntryRules {
-    ExpandItems, FilterExpression, Orderby
-  }
+  private enum ParserEntryRules { ExpandItems }
 
   public Parser(final Edm edm, final OData odata) {
     this.edm = edm;
@@ -131,7 +122,7 @@ public class Parser {
       if (numberOfSegments > 1) {
         final String typeCastSegment = pathSegmentsDecoded.get(1);
         ensureLastSegment(typeCastSegment, 2, numberOfSegments);
-        context.contextUriInfo = new ResourcePathParser(edm, odata).parseDollarEntityTypeCast(typeCastSegment);
+        context.contextUriInfo = new ResourcePathParser(edm).parseDollarEntityTypeCast(typeCastSegment);
         context.contextTypes.push(context.contextUriInfo.getEntityTypeCast());
       } else {
         context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.entityId);
@@ -141,7 +132,7 @@ public class Parser {
 
     } else if (firstSegment.startsWith("$crossjoin")) {
       ensureLastSegment(firstSegment, 1, numberOfSegments);
-      context.contextUriInfo = new ResourcePathParser(edm, odata).parseCrossjoinSegment(firstSegment);
+      context.contextUriInfo = new ResourcePathParser(edm).parseCrossjoinSegment(firstSegment);
       final EdmEntityContainer container = edm.getEntityContainer();
       for (final String name : context.contextUriInfo.getEntitySetNames()) {
         context.contextTypes.push(container.getEntitySet(name).getEntityType());
@@ -150,7 +141,7 @@ public class Parser {
 
     } else {
       context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.resource);
-      final ResourcePathParser resourcePathParser = new ResourcePathParser(edm, odata);
+      final ResourcePathParser resourcePathParser = new ResourcePathParser(edm);
       int count = 0;
       UriResource lastSegment = null;
       for (final String pathSegment : pathSegmentsDecoded) {
@@ -183,7 +174,7 @@ public class Parser {
 
       if (lastSegment instanceof UriResourcePartTyped) {
         final UriResourcePartTyped typed = (UriResourcePartTyped) lastSegment;
-        final EdmType type = getTypeInformation(typed);
+        final EdmType type = ParserHelper.getTypeInformation(typed);
         if (type != null) { // could be null for, e.g., actions without return type
           context.contextTypes.push(type);
         }
@@ -199,23 +190,13 @@ public class Parser {
       if (optionName.startsWith("$")) {
         SystemQueryOption systemOption = null;
         if (optionName.equals(SystemQueryOptionKind.FILTER.toString())) {
-          try {
-            FilterExpressionEOFContext ctxFilterExpression =
-                (FilterExpressionEOFContext) parseRule(optionValue, ParserEntryRules.FilterExpression);
-            systemOption = (FilterOptionImpl) uriParseTreeVisitor.visitFilterExpressionEOF(ctxFilterExpression);
-          } catch (final ParseCancellationException e) {
-            throw e.getCause() instanceof UriParserException ?
-                (UriParserException) e.getCause() :
-                new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX);
-          }
-//          UriTokenizer filterTokenizer = new UriTokenizer(optionValue);
-//          systemOption = new FilterOptionImpl().setExpression(
-//              new ExpressionParser().parse(filterTokenizer));
-//          if (!filterTokenizer.next(TokenKind.EOF)) {
-//            throw new UriParserSyntaxException("Illegal value of $filter option!",
-//                UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
-//                optionName, optionValue);
-//          }
+          UriTokenizer filterTokenizer = new UriTokenizer(optionValue);
+          systemOption = new FilterParser(edm, odata).parse(filterTokenizer,
+              context.contextTypes.peek() instanceof EdmStructuredType ?
+                  (EdmStructuredType) context.contextTypes.peek() :
+                  null,
+                  context.contextUriInfo.getEntitySetNames());
+          checkOptionEOF(filterTokenizer, optionName, optionValue);
 
         } else if (optionName.equals(SystemQueryOptionKind.FORMAT.toString())) {
           FormatOptionImpl formatOption = new FormatOptionImpl();
@@ -253,15 +234,13 @@ public class Parser {
               UriParserSyntaxException.MessageKeys.SYSTEM_QUERY_OPTION_LEVELS_NOT_ALLOWED_HERE);
 
         } else if (optionName.equals(SystemQueryOptionKind.ORDERBY.toString())) {
-          try {
-            OrderByEOFContext ctxOrderByExpression =
-                (OrderByEOFContext) parseRule(optionValue, ParserEntryRules.Orderby);
-            systemOption = (OrderByOptionImpl) uriParseTreeVisitor.visitOrderByEOF(ctxOrderByExpression);
-          } catch (final ParseCancellationException e) {
-            throw e.getCause() instanceof UriParserException ?
-                (UriParserException) e.getCause() :
-                new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX);
-          }
+          UriTokenizer orderByTokenizer = new UriTokenizer(optionValue);
+          systemOption = new OrderByParser(edm, odata).parse(orderByTokenizer,
+              context.contextTypes.peek() instanceof EdmStructuredType ?
+                  (EdmStructuredType) context.contextTypes.peek() :
+                  null,
+                  context.contextUriInfo.getEntitySetNames());
+          checkOptionEOF(orderByTokenizer, optionName, optionValue);
 
         } else if (optionName.equals(SystemQueryOptionKind.SEARCH.toString())) {
           systemOption = new SearchParser().parse(optionValue);
@@ -273,11 +252,7 @@ public class Parser {
                   (EdmStructuredType) context.contextTypes.peek() :
                   null,
               context.isCollection);
-          if (!selectTokenizer.next(TokenKind.EOF)) {
-            throw new UriParserSyntaxException("Illegal value of $select option!",
-                UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
-                optionName, optionValue);
-          }
+          checkOptionEOF(selectTokenizer, optionName, optionValue);
 
         } else if (optionName.equals(SystemQueryOptionKind.SKIP.toString())) {
           SkipOptionImpl skipOption = new SkipOptionImpl();
@@ -343,15 +318,12 @@ public class Parser {
                   UriParserSyntaxException.MessageKeys.SYNTAX);
             }
           } else {
-            try {
-              final FilterExpressionEOFContext filterExpCtx =
-                  (FilterExpressionEOFContext) parseRule(optionValue, ParserEntryRules.FilterExpression);
-              expression = ((FilterOption) uriParseTreeVisitor.visitFilterExpressionEOF(filterExpCtx))
-                  .getExpression();
-            } catch (final ParseCancellationException e) {
-              throw e.getCause() instanceof UriParserException ?
-                  (UriParserException) e.getCause() :
-                  new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX);
+            UriTokenizer aliasValueTokenizer = new UriTokenizer(optionValue);
+            expression = new ExpressionParser(edm, odata).parse(aliasValueTokenizer, null,
+                context.contextUriInfo.getEntitySetNames());
+            if (!aliasValueTokenizer.next(TokenKind.EOF)) {
+              throw new UriParserSyntaxException("Illegal value for alias '" + optionName + "'.",
+                  UriParserSyntaxException.MessageKeys.SYNTAX);
             }
           }
           context.contextUriInfo.addAlias((AliasQueryOption) new AliasQueryOptionImpl()
@@ -384,28 +356,13 @@ public class Parser {
     return index > 0 && index < value.length() - 1 && index == value.lastIndexOf('/');
   }
 
-  protected static EdmType getTypeInformation(final UriResourcePartTyped resourcePart) {
-    EdmType type = null;
-    if (resourcePart instanceof UriResourceWithKeysImpl) {
-      final UriResourceWithKeysImpl lastPartWithKeys = (UriResourceWithKeysImpl) resourcePart;
-      if (lastPartWithKeys.getTypeFilterOnEntry() != null) {
-        type = lastPartWithKeys.getTypeFilterOnEntry();
-      } else if (lastPartWithKeys.getTypeFilterOnCollection() != null) {
-        type = lastPartWithKeys.getTypeFilterOnCollection();
-      } else {
-        type = lastPartWithKeys.getType();
-      }
-
-    } else if (resourcePart instanceof UriResourceTypedImpl) {
-      final UriResourceTypedImpl lastPartTyped = (UriResourceTypedImpl) resourcePart;
-      type = lastPartTyped.getTypeFilter() == null ?
-          lastPartTyped.getType() :
-          lastPartTyped.getTypeFilter();
-    } else {
-      type = resourcePart.getType();
+  private void checkOptionEOF(UriTokenizer tokenizer, final String optionName, final String optionValue)
+      throws UriParserException {
+    if (!tokenizer.next(TokenKind.EOF)) {
+      throw new UriParserSyntaxException("Illegal value of '" + optionName + "' option!",
+          UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
+          optionName, optionValue);
     }
-
-    return type;
   }
 
   private ParserRuleContext parseRule(final String input, final ParserEntryRules entryPoint)
@@ -435,14 +392,6 @@ public class Parser {
 
       // parse
       switch (entryPoint) {
-      case FilterExpression:
-        lexer.mode(Lexer.DEFAULT_MODE);
-        ret = parser.filterExpressionEOF();
-        break;
-      case Orderby:
-        lexer.mode(Lexer.DEFAULT_MODE);
-        ret = parser.orderByEOF();
-        break;
       case ExpandItems:
         lexer.mode(Lexer.DEFAULT_MODE);
         ret = parser.expandItemsEOF();
@@ -471,14 +420,6 @@ public class Parser {
 
         // parse
         switch (entryPoint) {
-        case FilterExpression:
-          lexer.mode(Lexer.DEFAULT_MODE);
-          ret = parser.filterExpressionEOF();
-          break;
-        case Orderby:
-          lexer.mode(Lexer.DEFAULT_MODE);
-          ret = parser.orderByEOF();
-          break;
         case ExpandItems:
           lexer.mode(Lexer.DEFAULT_MODE);
           ret = parser.expandItemsEOF();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
index e811575..65ee461 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
@@ -18,10 +18,35 @@
  */
 package org.apache.olingo.server.core.uri.parser;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.uri.UriParameter;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
+import org.apache.olingo.server.core.ODataImpl;
+import org.apache.olingo.server.core.uri.UriParameterImpl;
+import org.apache.olingo.server.core.uri.UriResourceTypedImpl;
+import org.apache.olingo.server.core.uri.UriResourceWithKeysImpl;
 import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
 
 public class ParserHelper {
 
+  private static final OData odata = new ODataImpl();
+
   public static void requireNext(UriTokenizer tokenizer, final TokenKind required) throws UriParserException {
     if (!tokenizer.next(required)) {
       throw new UriParserSyntaxException("Expected token '" + required.toString() + "' not found.",
@@ -33,16 +58,16 @@ public class ParserHelper {
     requireNext(tokenizer, TokenKind.EOF);
   }
 
-  public static TokenKind next(UriTokenizer tokenizer, final TokenKind... kind) {
-    for (int i = 0; i < kind.length; i++) {
-      if (tokenizer.next(kind[i])) {
-        return kind[i];
+  public static TokenKind next(UriTokenizer tokenizer, final TokenKind... kinds) {
+    for (final TokenKind kind : kinds) {
+      if (tokenizer.next(kind)) {
+        return kind;
       }
     }
     return null;
   }
 
-  public static TokenKind nextPrimitive(UriTokenizer tokenizer) {
+  public static TokenKind nextPrimitiveValue(UriTokenizer tokenizer) {
     return next(tokenizer,
         TokenKind.NULL,
         TokenKind.BooleanValue,
@@ -62,4 +87,304 @@ public class ParserHelper {
         TokenKind.BinaryValue,
         TokenKind.EnumValue);
   }
+
+  protected static List<UriParameter> parseFunctionParameters(UriTokenizer tokenizer, final boolean withComplex)
+      throws UriParserException {
+    List<UriParameter> parameters = new ArrayList<UriParameter>();
+    ParserHelper.requireNext(tokenizer, TokenKind.OPEN);
+    if (tokenizer.next(TokenKind.CLOSE)) {
+      return parameters;
+    }
+    do {
+      ParserHelper.requireNext(tokenizer, TokenKind.ODataIdentifier);
+      final String name = tokenizer.getText();
+      if (parameters.contains(name)) {
+        throw new UriParserSemanticException("Duplicated function parameter " + name,
+            UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, name);
+      }
+      ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+      if (tokenizer.next(TokenKind.COMMA) || tokenizer.next(TokenKind.CLOSE) || tokenizer.next(TokenKind.EOF)) {
+        throw new UriParserSyntaxException("Parameter value expected.", UriParserSyntaxException.MessageKeys.SYNTAX);
+      }
+      if (tokenizer.next(TokenKind.ParameterAliasName)) {
+        parameters.add(new UriParameterImpl().setName(name).setAlias(tokenizer.getText()));
+      } else if (tokenizer.next(TokenKind.jsonArrayOrObject)) {
+        if (withComplex) {
+          parameters.add(new UriParameterImpl().setName(name).setText(tokenizer.getText()));
+        } else {
+          throw new UriParserSemanticException("A JSON array or object is not allowed as parameter value.",
+              UriParserSemanticException.MessageKeys.COMPLEX_PARAMETER_IN_RESOURCE_PATH, tokenizer.getText());
+        }
+      } else if (nextPrimitiveValue(tokenizer) == null) {
+        throw new UriParserSemanticException("Wrong parameter value.",
+            UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, "");
+      } else {
+        final String literalValue = tokenizer.getText();
+        parameters.add(new UriParameterImpl().setName(name)
+            .setText("null".equals(literalValue) ? null : literalValue));
+      }
+    } while (tokenizer.next(TokenKind.COMMA));
+    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+    return parameters;
+  }
+
+  protected static List<UriParameter> parseNavigationKeyPredicate(UriTokenizer tokenizer,
+      final EdmNavigationProperty navigationProperty) throws UriParserException, UriValidationException {
+    if (tokenizer.next(TokenKind.OPEN)) {
+      if (navigationProperty.isCollection()) {
+        return parseKeyPredicate(tokenizer, navigationProperty.getType(), navigationProperty.getPartner());
+      } else {
+        throw new UriParserSemanticException("A key is not allowed on non-collection navigation properties.",
+            UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED);
+      }
+    }
+    return null;
+  }
+
+  protected static List<UriParameter> parseKeyPredicate(UriTokenizer tokenizer, final EdmEntityType edmEntityType,
+      final EdmNavigationProperty partner) throws UriParserException, UriValidationException {
+    final List<EdmKeyPropertyRef> keyPropertyRefs = edmEntityType.getKeyPropertyRefs();
+    if (tokenizer.next(TokenKind.CLOSE)) {
+      throw new UriParserSemanticException(
+          "Expected " + keyPropertyRefs.size() + " key predicates but none.",
+          UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
+          Integer.toString(keyPropertyRefs.size()), "0");
+    }
+    List<UriParameter> keys = new ArrayList<UriParameter>();
+    Map<String, String> referencedNames = new HashMap<String, String>();
+
+    if (partner != null) {
+      // Prepare list of potentially missing keys to be filled from referential constraints.
+      for (final String name : edmEntityType.getKeyPredicateNames()) {
+        final String referencedName = partner.getReferencingPropertyName(name);
+        if (referencedName != null) {
+          referencedNames.put(name, referencedName);
+        }
+      }
+    }
+
+    if (tokenizer.next(TokenKind.ODataIdentifier)) {
+      keys.addAll(compoundKey(tokenizer, edmEntityType));
+    } else if (keyPropertyRefs.size() - referencedNames.size() == 1) {
+      for (final EdmKeyPropertyRef candidate : keyPropertyRefs) {
+        if (referencedNames.get(candidate.getName()) == null) {
+          keys.add(simpleKey(tokenizer, candidate));
+          break;
+        }
+      }
+    } else {
+      throw new UriParserSemanticException(
+          "Expected " + (keyPropertyRefs.size() -referencedNames.size()) + " key predicates but found one.",
+          UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
+          Integer.toString(keyPropertyRefs.size() - referencedNames.size()), "1");
+    }
+
+    if (keys.size() < keyPropertyRefs.size() && partner != null) {
+      // Fill missing keys from referential constraints.
+      for (final String name : edmEntityType.getKeyPredicateNames()) {
+        boolean found = false;
+        for (final UriParameter key : keys) {
+          if (name.equals(key.getName())) {
+            found = true;
+            break;
+          }
+        }
+        if (!found && referencedNames.get(name) != null) {
+          keys.add(0, new UriParameterImpl().setName(name).setReferencedProperty(referencedNames.get(name)));
+        }
+      }
+    }
+
+    // Check that all key predicates are filled from the URI.
+    if (keys.size() < keyPropertyRefs.size()) {
+      throw new UriParserSemanticException(
+          "Expected " + keyPropertyRefs.size() + " key predicates but found " + keys.size() + ".",
+          UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
+          Integer.toString(keyPropertyRefs.size()), Integer.toString(keys.size()));
+    } else {
+      return keys;
+    }
+  }
+
+  private static UriParameter simpleKey(UriTokenizer tokenizer, final EdmKeyPropertyRef edmKeyPropertyRef)
+      throws UriParserException, UriValidationException {
+    final EdmProperty edmProperty = edmKeyPropertyRef == null ? null : edmKeyPropertyRef.getProperty();
+    if (nextPrimitiveTypeValue(tokenizer,
+        edmProperty == null ? null : (EdmPrimitiveType) edmProperty.getType(),
+        edmProperty == null ? false : edmProperty.isNullable())) {
+      final String literalValue = tokenizer.getText();
+      ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+      return createUriParameter(edmProperty, edmKeyPropertyRef.getName(), literalValue);
+    } else {
+      throw new UriParserSemanticException("The key value is not valid.",
+          UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, edmKeyPropertyRef.getName());
+    }
+  }
+
+  private static List<UriParameter> compoundKey(UriTokenizer tokenizer, final EdmEntityType edmEntityType)
+      throws UriParserException, UriValidationException {
+
+    List<UriParameter> parameters = new ArrayList<UriParameter>();
+    List<String> parameterNames = new ArrayList<String>();
+
+    // To validate that each key predicate is exactly specified once, we use a list to pick from.
+    List<String> remainingKeyNames = new ArrayList<String>(edmEntityType.getKeyPredicateNames());
+
+    // At least one key predicate is mandatory.  Try to fetch all.
+    boolean hasComma = false;
+    do {
+      final String keyPredicateName = tokenizer.getText();
+      if (parameterNames.contains(keyPredicateName)) {
+        throw new UriValidationException("Duplicated key property " + keyPredicateName,
+            UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY, keyPredicateName);
+      }
+      if (remainingKeyNames.isEmpty()) {
+        throw new UriParserSemanticException("Too many key properties.",
+            UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
+            Integer.toString(parameters.size()), Integer.toString(parameters.size() + 1));
+      }
+      if (!remainingKeyNames.remove(keyPredicateName)) {
+        throw new UriValidationException("Unknown key property " + keyPredicateName,
+            UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, keyPredicateName);
+      }
+      parameters.add(keyValuePair(tokenizer, keyPredicateName, edmEntityType));
+      parameterNames.add(keyPredicateName);
+      hasComma = tokenizer.next(TokenKind.COMMA);
+      if (hasComma) {
+        ParserHelper.requireNext(tokenizer, TokenKind.ODataIdentifier);
+      }
+    } while (hasComma);
+    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+
+    return parameters;
+  }
+
+  protected static UriParameter keyValuePair(UriTokenizer tokenizer,
+      final String keyPredicateName, final EdmEntityType edmEntityType)
+      throws UriParserException, UriValidationException {
+    final EdmKeyPropertyRef keyPropertyRef = edmEntityType.getKeyPropertyRef(keyPredicateName);
+    final EdmProperty edmProperty = keyPropertyRef == null ? null : keyPropertyRef.getProperty();
+    if (edmProperty == null) {
+      throw new UriValidationException(keyPredicateName + " is not a valid key property name.",
+          UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, keyPredicateName);
+    }
+    ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+    if (tokenizer.next(TokenKind.COMMA) || tokenizer.next(TokenKind.CLOSE) || tokenizer.next(TokenKind.EOF)) {
+      throw new UriParserSyntaxException("Key value expected.", UriParserSyntaxException.MessageKeys.SYNTAX);
+    }
+    if (nextPrimitiveTypeValue(tokenizer, (EdmPrimitiveType) edmProperty.getType(), edmProperty.isNullable())) {
+      return createUriParameter(edmProperty, keyPredicateName, tokenizer.getText());
+    } else {
+      throw new UriParserSemanticException(keyPredicateName + " has not a valid  key value.",
+          UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, keyPredicateName);
+    }
+  }
+
+  private static UriParameter createUriParameter(final EdmProperty edmProperty, final String parameterName,
+      final String literalValue) throws UriParserException, UriValidationException {
+    if (literalValue.startsWith("@")) {
+      return new UriParameterImpl()
+          .setName(parameterName)
+          .setAlias(literalValue);
+    }
+
+    final EdmPrimitiveType primitiveType = (EdmPrimitiveType) edmProperty.getType();
+    try {
+      if (!(primitiveType.validate(primitiveType.fromUriLiteral(literalValue), edmProperty.isNullable(),
+          edmProperty.getMaxLength(), edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode()))) {
+        throw new UriValidationException("Invalid key property",
+            UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, parameterName);
+      }
+    } catch (final EdmPrimitiveTypeException e) {
+      throw new UriValidationException("Invalid key property",
+          UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, parameterName);
+    }
+
+    return new UriParameterImpl()
+        .setName(parameterName)
+        .setText("null".equals(literalValue) ? null : literalValue);
+  }
+
+  private static boolean nextPrimitiveTypeValue(UriTokenizer tokenizer,
+      final EdmPrimitiveType primitiveType, final boolean nullable) {
+    final EdmPrimitiveType type = primitiveType instanceof EdmTypeDefinition ?
+        ((EdmTypeDefinition) primitiveType).getUnderlyingType() :
+        primitiveType;
+    if (tokenizer.next(TokenKind.ParameterAliasName)) {
+      return true;
+    } else if (nullable && tokenizer.next(TokenKind.NULL)) {
+      return true;
+
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean).equals(type)) {
+      return tokenizer.next(TokenKind.BooleanValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.String).equals(type)) {
+      return tokenizer.next(TokenKind.StringValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.SByte).equals(type)
+        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Byte).equals(type)
+        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int16).equals(type)
+        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int32).equals(type)
+        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int64).equals(type)) {
+      return tokenizer.next(TokenKind.IntegerValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Guid).equals(type)) {
+      return tokenizer.next(TokenKind.GuidValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Date).equals(type)) {
+      return tokenizer.next(TokenKind.DateValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.DateTimeOffset).equals(type)) {
+      return tokenizer.next(TokenKind.DateTimeOffsetValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.TimeOfDay).equals(type)) {
+      return tokenizer.next(TokenKind.TimeOfDayValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal).equals(type)) {
+      // The order is important.
+      // A decimal value should not be parsed as integer and let the tokenizer stop at the decimal point.
+      return tokenizer.next(TokenKind.DecimalValue)
+          || tokenizer.next(TokenKind.IntegerValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double).equals(type)) {
+      // The order is important.
+      // A floating-point value should not be parsed as decimal and let the tokenizer stop at 'E'.
+      // A decimal value should not be parsed as integer and let the tokenizer stop at the decimal point.
+      return tokenizer.next(TokenKind.DoubleValue)
+          || tokenizer.next(TokenKind.DecimalValue)
+          || tokenizer.next(TokenKind.IntegerValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Duration).equals(type)) {
+      return tokenizer.next(TokenKind.DurationValue);
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Binary).equals(type)) {
+      return tokenizer.next(TokenKind.BinaryValue);
+    } else if (type.getKind() == EdmTypeKind.ENUM) {
+      return tokenizer.next(TokenKind.EnumValue);
+    } else {
+      return false;
+    }
+  }
+
+  protected static List<String> getParameterNames(final List<UriParameter> parameters) {
+    List<String> names = new ArrayList<String>();
+    for (final UriParameter parameter : parameters) {
+      names.add(parameter.getName());
+    }
+    return names;
+  }
+
+  protected static EdmType getTypeInformation(final UriResourcePartTyped resourcePart) {
+    EdmType type = null;
+    if (resourcePart instanceof UriResourceWithKeysImpl) {
+      final UriResourceWithKeysImpl lastPartWithKeys = (UriResourceWithKeysImpl) resourcePart;
+      if (lastPartWithKeys.getTypeFilterOnEntry() != null) {
+        type = lastPartWithKeys.getTypeFilterOnEntry();
+      } else if (lastPartWithKeys.getTypeFilterOnCollection() != null) {
+        type = lastPartWithKeys.getTypeFilterOnCollection();
+      } else {
+        type = lastPartWithKeys.getType();
+      }
+
+    } else if (resourcePart instanceof UriResourceTypedImpl) {
+      final UriResourceTypedImpl lastPartTyped = (UriResourceTypedImpl) resourcePart;
+      type = lastPartTyped.getTypeFilter() == null ?
+          lastPartTyped.getType() :
+          lastPartTyped.getTypeFilter();
+    } else {
+      type = resourcePart.getType();
+    }
+
+    return type;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
index 5d2fbde..1cd4d7a 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
@@ -18,10 +18,7 @@
  */
 package org.apache.olingo.server.core.uri.parser;
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmAction;
@@ -31,25 +28,18 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
 import org.apache.olingo.commons.api.edm.EdmFunction;
 import org.apache.olingo.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
 import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.EdmSingleton;
 import org.apache.olingo.commons.api.edm.EdmStructuredType;
 import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.UriInfoKind;
 import org.apache.olingo.server.api.uri.UriParameter;
 import org.apache.olingo.server.api.uri.UriResource;
 import org.apache.olingo.server.api.uri.UriResourcePartTyped;
 import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.UriParameterImpl;
 import org.apache.olingo.server.core.uri.UriResourceActionImpl;
 import org.apache.olingo.server.core.uri.UriResourceComplexPropertyImpl;
 import org.apache.olingo.server.core.uri.UriResourceCountImpl;
@@ -69,13 +59,11 @@ public class ResourcePathParser {
 
   private final Edm edm;
   private final EdmEntityContainer edmEntityContainer;
-  private final OData odata;
   private UriTokenizer tokenizer;
 
-  public ResourcePathParser(final Edm edm, final OData odata) {
+  public ResourcePathParser(final Edm edm) {
     this.edm = edm;
     edmEntityContainer = edm.getEntityContainer();
-    this.odata = odata;
   }
 
   public UriResource parsePathSegment(final String pathSegment, UriResource previous)
@@ -188,10 +176,11 @@ public class ResourcePathParser {
 
     final EdmEntitySet edmEntitySet = edmEntityContainer.getEntitySet(oDataIdentifier);
     if (edmEntitySet != null) {
-      final UriResourceEntitySetImpl entitySetResource = new UriResourceEntitySetImpl().setEntitSet(edmEntitySet);
+      final UriResourceEntitySetImpl entitySetResource = new UriResourceEntitySetImpl(edmEntitySet);
 
       if (tokenizer.next(TokenKind.OPEN)) {
-        final List<UriParameter> keyPredicates = keyPredicate(entitySetResource.getEntityType(), null);
+        final List<UriParameter> keyPredicates =
+            ParserHelper.parseKeyPredicate(tokenizer, entitySetResource.getEntityType(), null);
         entitySetResource.setKeyPredicates(keyPredicates);
       }
 
@@ -202,13 +191,13 @@ public class ResourcePathParser {
     final EdmSingleton edmSingleton = edmEntityContainer.getSingleton(oDataIdentifier);
     if (edmSingleton != null) {
       ParserHelper.requireTokenEnd(tokenizer);
-      return new UriResourceSingletonImpl().setSingleton(edmSingleton);
+      return new UriResourceSingletonImpl(edmSingleton);
     }
 
     final EdmActionImport edmActionImport = edmEntityContainer.getActionImport(oDataIdentifier);
     if (edmActionImport != null) {
       ParserHelper.requireTokenEnd(tokenizer);
-      return new UriResourceActionImpl().setActionImport(edmActionImport);
+      return new UriResourceActionImpl(edmActionImport);
     }
 
     final EdmFunctionImport edmFunctionImport = edmEntityContainer.getFunctionImport(oDataIdentifier);
@@ -252,8 +241,8 @@ public class ResourcePathParser {
       return property.isPrimitive()
           || property.getType().getKind() == EdmTypeKind.ENUM
           || property.getType().getKind() == EdmTypeKind.DEFINITION ?
-          new UriResourcePrimitivePropertyImpl().setProperty(property) :
-          new UriResourceComplexPropertyImpl().setProperty(property);
+          new UriResourcePrimitivePropertyImpl(property) :
+          new UriResourceComplexPropertyImpl(property);
     }
     final EdmNavigationProperty navigationProperty = structType.getNavigationProperty(name);
     if (navigationProperty == null) {
@@ -262,18 +251,9 @@ public class ResourcePathParser {
           UriParserSemanticException.MessageKeys.PROPERTY_NOT_IN_TYPE,
           structType.getFullQualifiedName().getFullQualifiedNameAsString(), name);
     }
-    List<UriParameter> keyPredicate = null;
-    if (tokenizer.next(TokenKind.OPEN)) {
-      if (navigationProperty.isCollection()) {
-        keyPredicate = keyPredicate(navigationProperty.getType(), navigationProperty.getPartner());
-      } else {
-        throw new UriParserSemanticException("A key is not allowed on non-collection navigation properties.",
-            UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED);
-      }
-    }
+    List<UriParameter> keyPredicate = ParserHelper.parseNavigationKeyPredicate(tokenizer, navigationProperty);
     ParserHelper.requireTokenEnd(tokenizer);
-    return new UriResourceNavigationPropertyImpl()
-        .setNavigationProperty(navigationProperty)
+    return new UriResourceNavigationPropertyImpl(navigationProperty)
         .setKeyPredicates(keyPredicate);
   }
 
@@ -289,7 +269,7 @@ public class ResourcePathParser {
           previousTyped.isCollection());
       if (boundAction != null) {
         ParserHelper.requireTokenEnd(tokenizer);
-        return new UriResourceActionImpl().setAction(boundAction);
+        return new UriResourceActionImpl(boundAction);
       }
       EdmStructuredType type = edm.getEntityType(name);
       if (type == null) {
@@ -314,169 +294,6 @@ public class ResourcePathParser {
     }
   }
 
-  private List<UriParameter> keyPredicate(final EdmEntityType edmEntityType, final EdmNavigationProperty partner)
-      throws UriParserException, UriValidationException {
-    final List<EdmKeyPropertyRef> keyPropertyRefs = edmEntityType.getKeyPropertyRefs();
-    if (tokenizer.next(TokenKind.CLOSE)) {
-      throw new UriParserSemanticException(
-          "Expected " + keyPropertyRefs.size() + " key predicates but none.",
-          UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-          Integer.toString(keyPropertyRefs.size()), "0");
-    }
-    List<UriParameter> keys = new ArrayList<UriParameter>();
-    Map<String, String> referencedNames = new HashMap<String, String>();
-
-    if (partner != null) {
-      // Prepare list of potentially missing keys to be filled from referential constraints.
-      for (final String name : edmEntityType.getKeyPredicateNames()) {
-        final String referencedName = partner.getReferencingPropertyName(name);
-        if (referencedName != null) {
-          referencedNames.put(name, referencedName);
-        }
-      }
-    }
-
-    if (tokenizer.next(TokenKind.ODataIdentifier)) {
-      keys.addAll(compoundKey(edmEntityType));
-    } else if (keyPropertyRefs.size() - referencedNames.size() == 1) {
-      for (final EdmKeyPropertyRef candidate : keyPropertyRefs) {
-        if (referencedNames.get(candidate.getName()) == null) {
-          keys.add(simpleKey(candidate));
-          break;
-        }
-      }
-    } else {
-      throw new UriParserSemanticException(
-          "Expected " + (keyPropertyRefs.size() -referencedNames.size()) + " key predicates but found one.",
-          UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-          Integer.toString(keyPropertyRefs.size() - referencedNames.size()), "1");
-    }
-
-    if (keys.size() < keyPropertyRefs.size() && partner != null) {
-      // Fill missing keys from referential constraints.
-      for (final String name : edmEntityType.getKeyPredicateNames()) {
-        boolean found = false;
-        for (final UriParameter key : keys) {
-          if (name.equals(key.getName())) {
-            found = true;
-            break;
-          }
-        }
-        if (!found && referencedNames.get(name) != null) {
-          keys.add(0, new UriParameterImpl().setName(name).setReferencedProperty(referencedNames.get(name)));
-        }
-      }
-    }
-
-    // Check that all key predicates are filled from the URI.
-    if (keys.size() < keyPropertyRefs.size()) {
-      throw new UriParserSemanticException(
-          "Expected " + keyPropertyRefs.size() + " key predicates but found " + keys.size() + ".",
-          UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-          Integer.toString(keyPropertyRefs.size()), Integer.toString(keys.size()));
-    } else {
-      return keys;
-    }
-  }
-
-  private UriParameter simpleKey(final EdmKeyPropertyRef edmKeyPropertyRef)
-      throws UriParserException, UriValidationException {
-    final EdmProperty edmProperty = edmKeyPropertyRef == null ? null : edmKeyPropertyRef.getProperty();
-    if (nextPrimitiveTypeValue(
-        edmProperty == null ? null : (EdmPrimitiveType) edmProperty.getType(),
-        edmProperty == null ? false : edmProperty.isNullable())) {
-      final String literalValue = tokenizer.getText();
-      ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
-      return createUriParameter(edmProperty, edmKeyPropertyRef.getName(), literalValue);
-    } else {
-      throw new UriParserSemanticException("The key value is not valid.",
-          UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, edmKeyPropertyRef.getName());
-    }
-  }
-
-  private List<UriParameter> compoundKey(final EdmEntityType edmEntityType)
-      throws UriParserException, UriValidationException {
-
-    List<UriParameter> parameters = new ArrayList<UriParameter>();
-    List<String> parameterNames = new ArrayList<String>();
-
-    // To validate that each key predicate is exactly specified once, we use a list to pick from.
-    List<String> remainingKeyNames = new ArrayList<String>(edmEntityType.getKeyPredicateNames());
-
-    // At least one key predicate is mandatory.  Try to fetch all.
-    boolean hasComma = false;
-    do {
-      final String keyPredicateName = tokenizer.getText();
-      if (parameterNames.contains(keyPredicateName)) {
-        throw new UriValidationException("Duplicated key property " + keyPredicateName,
-            UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY, keyPredicateName);
-      }
-      if (remainingKeyNames.isEmpty()) {
-        throw new UriParserSemanticException("Too many key properties.",
-            UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-            Integer.toString(parameters.size()), Integer.toString(parameters.size() + 1));
-      }
-      if (!remainingKeyNames.remove(keyPredicateName)) {
-        throw new UriValidationException("Unknown key property " + keyPredicateName,
-            UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, keyPredicateName);
-      }
-      parameters.add(keyValuePair(keyPredicateName, edmEntityType));
-      parameterNames.add(keyPredicateName);
-      hasComma = tokenizer.next(TokenKind.COMMA);
-      if (hasComma) {
-        ParserHelper.requireNext(tokenizer, TokenKind.ODataIdentifier);
-      }
-    } while (hasComma);
-    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
-
-    return parameters;
-  }
-
-  private UriParameter keyValuePair(final String keyPredicateName, final EdmEntityType edmEntityType)
-      throws UriParserException, UriValidationException {
-    final EdmKeyPropertyRef keyPropertyRef = edmEntityType.getKeyPropertyRef(keyPredicateName);
-    final EdmProperty edmProperty = keyPropertyRef == null ? null : keyPropertyRef.getProperty();
-    if (edmProperty == null) {
-      throw new UriValidationException(keyPredicateName + " is not a valid key property name.",
-          UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, keyPredicateName);
-    }
-    ParserHelper.requireNext(tokenizer, TokenKind.EQ);
-    if (tokenizer.next(TokenKind.COMMA) || tokenizer.next(TokenKind.CLOSE) || tokenizer.next(TokenKind.EOF)) {
-      throw new UriParserSyntaxException("Key value expected.", UriParserSyntaxException.MessageKeys.SYNTAX);
-    }
-    if (nextPrimitiveTypeValue((EdmPrimitiveType) edmProperty.getType(), edmProperty.isNullable())) {
-      return createUriParameter(edmProperty, keyPredicateName, tokenizer.getText());
-    } else {
-      throw new UriParserSemanticException(keyPredicateName + " has not a valid  key value.",
-          UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, keyPredicateName);
-    }
-  }
-
-  private UriParameter createUriParameter(final EdmProperty edmProperty, final String parameterName,
-      final String literalValue) throws UriParserException, UriValidationException {
-    if (literalValue.startsWith("@")) {
-      return new UriParameterImpl()
-          .setName(parameterName)
-          .setAlias(literalValue);
-    }
-
-    final EdmPrimitiveType primitiveType = (EdmPrimitiveType) edmProperty.getType();
-    try {
-      if (!(primitiveType.validate(primitiveType.fromUriLiteral(literalValue), edmProperty.isNullable(),
-          edmProperty.getMaxLength(), edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode()))) {
-        throw new UriValidationException("Invalid key property",
-            UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, parameterName);
-      }
-    } catch (final EdmPrimitiveTypeException e) {
-      throw new UriValidationException("Invalid key property",
-          UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, parameterName);
-    }
-
-    return new UriParameterImpl()
-        .setName(parameterName)
-        .setText("null".equals(literalValue) ? null : literalValue);
-  }
-
   private UriResource typeCast(final FullQualifiedName name, final EdmStructuredType type,
       final UriResourcePartTyped previousTyped) throws UriParserException, UriValidationException {
     if (type.compatibleTo(previousTyped.getType())) {
@@ -501,7 +318,7 @@ public class ResourcePathParser {
         }
         if (tokenizer.next(TokenKind.OPEN)) {
           ((UriResourceWithKeysImpl) previousTyped).setKeyPredicates(
-              keyPredicate((EdmEntityType) type, null));
+              ParserHelper.parseKeyPredicate(tokenizer, (EdmEntityType) type, null));
         }
       } else {
         previousTypeFilter = ((UriResourceTypedImpl) previousTyped).getTypeFilter();
@@ -534,11 +351,8 @@ public class ResourcePathParser {
   private UriResource functionCall(final EdmFunctionImport edmFunctionImport,
       final FullQualifiedName boundFunctionName, final FullQualifiedName bindingParameterTypeName,
       final boolean isBindingParameterCollection) throws UriParserException, UriValidationException {
-    final List<UriParameter> parameters = functionParameters();
-    List<String> names = new ArrayList<String>();
-    for (final UriParameter parameter : parameters) {
-      names.add(parameter.getName());
-    }
+    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, false);
+    final List<String> names = ParserHelper.getParameterNames(parameters);
     EdmFunction function = null;
     if (edmFunctionImport != null) {
       function = edmFunctionImport.getUnboundFunction(names);
@@ -557,16 +371,13 @@ public class ResourcePathParser {
             UriParserSemanticException.MessageKeys.UNKNOWN_PART, boundFunctionName.getFullQualifiedNameAsString());
       }
     }
-    UriResourceFunctionImpl resource = new UriResourceFunctionImpl()
-        .setFunctionImport(edmFunctionImport, null)
-        .setFunction(function)
-        .setParameters(parameters);
+    UriResourceFunctionImpl resource = new UriResourceFunctionImpl(edmFunctionImport, function, parameters);
     if (tokenizer.next(TokenKind.OPEN)) {
       if (function.getReturnType() != null
           && function.getReturnType().getType().getKind() == EdmTypeKind.ENTITY
           && function.getReturnType().isCollection()) {
         resource.setKeyPredicates(
-            keyPredicate((EdmEntityType) function.getReturnType().getType(), null));
+            ParserHelper.parseKeyPredicate(tokenizer, (EdmEntityType) function.getReturnType().getType(), null));
       } else {
         throw new UriParserSemanticException("A key is not allowed.",
             UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED);
@@ -575,106 +386,4 @@ public class ResourcePathParser {
     ParserHelper.requireTokenEnd(tokenizer);
     return resource;
   }
-
-  private List<UriParameter> functionParameters() throws UriParserException {
-    List<UriParameter> parameters = new ArrayList<UriParameter>();
-    ParserHelper.requireNext(tokenizer, TokenKind.OPEN);
-    if (tokenizer.next(TokenKind.CLOSE)) {
-      return parameters;
-    }
-    do {
-      ParserHelper.requireNext(tokenizer, TokenKind.ODataIdentifier);
-      final String name = tokenizer.getText();
-      if (parameters.contains(name)) {
-        throw new UriParserSemanticException("Duplicated function parameter " + name,
-            UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, name);
-      }
-      ParserHelper.requireNext(tokenizer, TokenKind.EQ);
-      if (tokenizer.next(TokenKind.COMMA) || tokenizer.next(TokenKind.CLOSE) || tokenizer.next(TokenKind.EOF)) {
-        throw new UriParserSyntaxException("Parameter value expected.", UriParserSyntaxException.MessageKeys.SYNTAX);
-      }
-      if (tokenizer.next(TokenKind.ParameterAliasName)) {
-        parameters.add(new UriParameterImpl().setName(name).setAlias(tokenizer.getText()));
-      } else if (nextPrimitiveValue()) {
-        final String literalValue = tokenizer.getText();
-        parameters.add(new UriParameterImpl().setName(name)
-            .setText("null".equals(literalValue) ? null : literalValue));
-      } else {
-        throw new UriParserSemanticException("Wrong parameter value.",
-            UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, "");
-      }
-    } while (tokenizer.next(TokenKind.COMMA));
-    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
-    return parameters;
-  }
-
-  private boolean nextPrimitiveTypeValue(final EdmPrimitiveType primitiveType, final boolean nullable) {
-    final EdmPrimitiveType type = primitiveType instanceof EdmTypeDefinition ?
-        ((EdmTypeDefinition) primitiveType).getUnderlyingType() :
-        primitiveType;
-    if (tokenizer.next(TokenKind.ParameterAliasName)) {
-      return true;
-    } else if (nullable && tokenizer.next(TokenKind.NULL)) {
-      return true;
-
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean).equals(type)) {
-      return tokenizer.next(TokenKind.BooleanValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.String).equals(type)) {
-      return tokenizer.next(TokenKind.StringValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.SByte).equals(type)
-        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Byte).equals(type)
-        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int16).equals(type)
-        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int32).equals(type)
-        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int64).equals(type)) {
-      return tokenizer.next(TokenKind.IntegerValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Guid).equals(type)) {
-      return tokenizer.next(TokenKind.GuidValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Date).equals(type)) {
-      return tokenizer.next(TokenKind.DateValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.DateTimeOffset).equals(type)) {
-      return tokenizer.next(TokenKind.DateTimeOffsetValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.TimeOfDay).equals(type)) {
-      return tokenizer.next(TokenKind.TimeOfDayValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal).equals(type)) {
-      // The order is important.
-      // A decimal value should not be parsed as integer and let the tokenizer stop at the decimal point.
-      return tokenizer.next(TokenKind.DecimalValue)
-          || tokenizer.next(TokenKind.IntegerValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double).equals(type)) {
-      // The order is important.
-      // A floating-point value should not be parsed as decimal and let the tokenizer stop at 'E'.
-      // A decimal value should not be parsed as integer and let the tokenizer stop at the decimal point.
-      return tokenizer.next(TokenKind.DoubleValue)
-          || tokenizer.next(TokenKind.DecimalValue)
-          || tokenizer.next(TokenKind.IntegerValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Duration).equals(type)) {
-      return tokenizer.next(TokenKind.DurationValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Binary).equals(type)) {
-      return tokenizer.next(TokenKind.BinaryValue);
-    } else if (type.getKind() == EdmTypeKind.ENUM) {
-      return tokenizer.next(TokenKind.EnumValue);
-    } else {
-      return false;
-    }
-  }
-
-  private boolean nextPrimitiveValue() {
-    return tokenizer.next(TokenKind.NULL)
-        || tokenizer.next(TokenKind.BooleanValue)
-        || tokenizer.next(TokenKind.StringValue)
-
-        // The order of the next seven expressions is important in order to avoid
-        // finding partly parsed tokens (counter-intuitive as it may be, even a GUID may start with digits ...).
-        || tokenizer.next(TokenKind.DoubleValue)
-        || tokenizer.next(TokenKind.DecimalValue)
-        || tokenizer.next(TokenKind.GuidValue)
-        || tokenizer.next(TokenKind.DateTimeOffsetValue)
-        || tokenizer.next(TokenKind.DateValue)
-        || tokenizer.next(TokenKind.TimeOfDayValue)
-        || tokenizer.next(TokenKind.IntegerValue)
-
-        || tokenizer.next(TokenKind.DurationValue)
-        || tokenizer.next(TokenKind.BinaryValue)
-        || tokenizer.next(TokenKind.EnumValue);
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SelectParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SelectParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SelectParser.java
index b257e68..00f3673 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SelectParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SelectParser.java
@@ -156,10 +156,10 @@ public class SelectParser {
         throw new UriParserSemanticException("Function not found.",
             UriParserSemanticException.MessageKeys.UNKNOWN_PART, qualifiedName.getFullQualifiedNameAsString());
       } else {
-        return new UriResourceFunctionImpl().setFunction(boundFunction);
+        return new UriResourceFunctionImpl(null, boundFunction, null);
       }
     } else {
-      return new UriResourceActionImpl().setAction(boundAction);
+      return new UriResourceActionImpl(boundAction);
     }
   }
 
@@ -187,16 +187,16 @@ public class SelectParser {
             UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE,
             referencedType.getName(), name);
       } else {
-        resource.addResourcePart(new UriResourceNavigationPropertyImpl().setNavigationProperty(navigationProperty));
+        resource.addResourcePart(new UriResourceNavigationPropertyImpl(navigationProperty));
       }
 
     } else if (property.isPrimitive()
         || property.getType().getKind() == EdmTypeKind.ENUM
         || property.getType().getKind() == EdmTypeKind.DEFINITION) {
-      resource.addResourcePart(new UriResourcePrimitivePropertyImpl().setProperty(property));
+      resource.addResourcePart(new UriResourcePrimitivePropertyImpl(property));
 
     } else {
-      UriResourceComplexPropertyImpl complexPart = new UriResourceComplexPropertyImpl().setProperty(property);
+      UriResourceComplexPropertyImpl complexPart = new UriResourceComplexPropertyImpl(property);
       resource.addResourcePart(complexPart);
       if (tokenizer.next(TokenKind.SLASH)) {
         if (tokenizer.next(TokenKind.QualifiedName)) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
index c0db85b..36a0887 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
@@ -32,10 +32,9 @@ import org.apache.olingo.server.core.uri.queryoption.SelectItemImpl;
  */
 public class UriContext {
 
-  public static class LambdaVariables {
+  public static class LambdaVariable {
     public String name;
     public EdmType type;
-    public boolean isCollection;
   }
 
   /**
@@ -43,7 +42,7 @@ public class UriContext {
    * As lambda functions can be nested there may be more than one allowed lambda variables at a time while parsing a
    * $filter or $orderby expressions.
    */
-  public Deque<LambdaVariables> allowedLambdaVariables;
+  public Deque<LambdaVariable> allowedLambdaVariables;
   /**
    * Used to stack type information for nested $expand, $filter query options and other cases.
    */
@@ -110,7 +109,7 @@ public class UriContext {
     contextReadingFunctionParameters = false;
     contextSelectItem = null;
     contextTypes = new ArrayDeque<EdmType>();
-    allowedLambdaVariables = new ArrayDeque<UriContext.LambdaVariables>();
+    allowedLambdaVariables = new ArrayDeque<UriContext.LambdaVariable>();
 
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
index 9d29ab2..1bab218 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
@@ -252,8 +252,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
     return new FullQualifiedName(namespace, odi);
   }
 
-  private UriContext.LambdaVariables getLambdaVar(final String odi) {
-    for (UriContext.LambdaVariables item : context.allowedLambdaVariables) {
+  private UriContext.LambdaVariable getLambdaVar(final String odi) {
+    for (UriContext.LambdaVariable item : context.allowedLambdaVariables) {
       if (item.name.equals(odi)) {
         return item;
       }
@@ -292,7 +292,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
               || parts.get(0) instanceof UriResourceRoot)) {
         ensureNamespaceIsNull(ctx.vNS);
         context.contextUriInfo.addResourcePart(
-            new UriResourceEntitySetImpl().setEntitSet(edmEntitySet));
+            new UriResourceEntitySetImpl(edmEntitySet));
         return null;
       }
 
@@ -303,7 +303,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
               || parts.get(0) instanceof UriResourceRoot)) {
         ensureNamespaceIsNull(ctx.vNS);
         context.contextUriInfo.addResourcePart(
-            new UriResourceSingletonImpl().setSingleton(edmSingleton));
+            new UriResourceSingletonImpl(edmSingleton));
         return null;
       }
 
@@ -314,7 +314,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
               || parts.get(0) instanceof UriResourceRoot)) {
         ensureNamespaceIsNull(ctx.vNS);
         context.contextUriInfo.addResourcePart(
-            new UriResourceActionImpl().setActionImport(edmActionImport));
+            new UriResourceActionImpl(edmActionImport));
         return null;
       }
 
@@ -344,9 +344,6 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         // mark parameters as consumed
         ctx.vlNVO.remove(0);
 
-        UriResourceFunctionImpl uriResource = new UriResourceFunctionImpl()
-            .setFunctionImport(edmFunctionImport, parameters);
-
         // collect parameter names
         List<String> names = new ArrayList<String>();
         for (UriParameter item : parameters) {
@@ -366,7 +363,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         }
 
         ensureNamespaceIsNull(ctx.vNS);
-        uriResource.setFunction(edmFunctionImport.getUnboundFunction(names));
+        UriResourceFunctionImpl uriResource = new UriResourceFunctionImpl(edmFunctionImport,
+            edmFunctionImport.getUnboundFunction(names),
+            parameters);
         context.contextUriInfo.addResourcePart(uriResource);
         return null;
       }
@@ -390,7 +389,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       sourceType = context.contextTypes.peek();
       sourceIsCollection = context.isCollection;
     } else if (lastResourcePart instanceof UriResourcePartTyped) {
-      sourceType = Parser.getTypeInformation((UriResourcePartTyped) lastResourcePart);
+      sourceType = ParserHelper.getTypeInformation((UriResourcePartTyped) lastResourcePart);
       sourceIsCollection = ((UriResourcePartTyped) lastResourcePart).isCollection();
     } else {
       throw wrap(new UriParserSemanticException(
@@ -401,12 +400,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
     if (ctx.vNS == null) { // without namespace
 
       // first check for lambda variable because a newly add property should not shadow a long used lambda variable
-      UriContext.LambdaVariables lVar = getLambdaVar(odi);
+      UriContext.LambdaVariable lVar = getLambdaVar(odi);
       if (lVar != null) {
-        UriResourceLambdaVarImpl lambdaResource = new UriResourceLambdaVarImpl();
-        lambdaResource.setVariableText(lVar.name);
-        lambdaResource.setType(lVar.type);
-        lambdaResource.setCollection(lVar.isCollection);
+        UriResourceLambdaVarImpl lambdaResource = new UriResourceLambdaVarImpl(lVar.name, lVar.type);
         context.contextUriInfo.addResourcePart(lambdaResource);
         return null;
       }
@@ -442,14 +438,13 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
             || property.getType().getKind() == EdmTypeKind.ENUM
             || property.getType().getKind() == EdmTypeKind.DEFINITION) {
           // create simple property
-          UriResourcePrimitivePropertyImpl simpleResource = new UriResourcePrimitivePropertyImpl()
-              .setProperty((EdmProperty) property);
+          UriResourcePrimitivePropertyImpl simpleResource =
+              new UriResourcePrimitivePropertyImpl((EdmProperty) property);
           context.contextUriInfo.addResourcePart(simpleResource);
           return null;
         } else {
           // create complex property
-          UriResourceComplexPropertyImpl complexResource = new UriResourceComplexPropertyImpl()
-              .setProperty((EdmProperty) property);
+          UriResourceComplexPropertyImpl complexResource = new UriResourceComplexPropertyImpl((EdmProperty) property);
           context.contextUriInfo.addResourcePart(complexResource);
           return null;
         }
@@ -461,8 +456,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
               UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
         }
 
-        UriResourceNavigationPropertyImpl navigationResource = new UriResourceNavigationPropertyImpl()
-            .setNavigationProperty((EdmNavigationProperty) property);
+        UriResourceNavigationPropertyImpl navigationResource =
+            new UriResourceNavigationPropertyImpl((EdmNavigationProperty) property);
         context.contextUriInfo.addResourcePart(navigationResource);
         return null;
       } else {
@@ -488,9 +483,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
           if (lastResourcePart == null) {
             // this may be the case if a member expression within a filter starts with a typeCast
-            UriResourceStartingTypeFilterImpl uriResource = new UriResourceStartingTypeFilterImpl()
-                .setType(filterEntityType)
-                .setCollection(sourceIsCollection);
+            UriResourceStartingTypeFilterImpl uriResource = new UriResourceStartingTypeFilterImpl(
+                filterEntityType,
+                sourceIsCollection);
             if (sourceIsCollection) {
               uriResource.setCollectionTypeFilter(filterEntityType);
             } else {
@@ -562,9 +557,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
           // is simple complex type cast
           if (lastResourcePart == null) {
             // this may be the case if a member expression within a filter starts with a typeCast
-            UriResourceStartingTypeFilterImpl uriResource = new UriResourceStartingTypeFilterImpl()
-                .setType(filterComplexType)
-                .setCollection(sourceIsCollection);
+            UriResourceStartingTypeFilterImpl uriResource =
+                new UriResourceStartingTypeFilterImpl(filterComplexType, sourceIsCollection);
 
             if (sourceIsCollection) {
               uriResource.setCollectionTypeFilter(filterComplexType);
@@ -626,8 +620,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       // check for action
       EdmAction action = edm.getBoundAction(fullFilterName, fullBindingTypeName, sourceIsCollection);
       if (action != null) {
-        UriResourceActionImpl pathInfoAction = new UriResourceActionImpl();
-        pathInfoAction.setAction(action);
+        UriResourceActionImpl pathInfoAction = new UriResourceActionImpl(action);
         context.contextUriInfo.addResourcePart(pathInfoAction);
         return null;
       }
@@ -652,9 +645,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       EdmFunction function = edm.getBoundFunction(fullFilterName, fullBindingTypeName, sourceIsCollection, names);
 
       if (function != null) {
-        UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl()
-            .setFunction(function)
-            .setParameters(parameters);
+        UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl(null, function, parameters);
         context.contextUriInfo.addResourcePart(pathInfoFunction);
 
         // mark parameters as consumed
@@ -666,9 +657,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       function = edm.getUnboundFunction(fullFilterName, names);
 
       if (function != null) {
-        UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl()
-            .setFunction(function)
-            .setParameters(parameters);
+        UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl(null, function, parameters);
         context.contextUriInfo.addResourcePart(pathInfoFunction);
 
         // mark parameters as consumed
@@ -706,8 +695,6 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
   @Override
   public Object visitAllExpr(final AllExprContext ctx) {
-    UriResourceLambdaAllImpl all = new UriResourceLambdaAllImpl();
-
     UriResource obj = context.contextUriInfo.getLastResourcePart();
     if (!(obj instanceof UriResourcePartTyped)) {
       throw wrap(new UriParserSemanticException("all only allowed on typed path segments",
@@ -720,16 +707,14 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       }
     }
 
-    UriContext.LambdaVariables var = new UriContext.LambdaVariables();
+    UriContext.LambdaVariable var = new UriContext.LambdaVariable();
     var.name = ctx.vLV.getText();
-    var.type = Parser.getTypeInformation((UriResourcePartTyped) obj);
-    var.isCollection = false;
+    var.type = ParserHelper.getTypeInformation((UriResourcePartTyped) obj);
 
-    all.setLamdaVariable(ctx.vLV.getText());
     context.allowedLambdaVariables.push(var);
-    all.setExpression((Expression) ctx.vLE.accept(this));
+    Expression expression = (Expression) ctx.vLE.accept(this);
     context.allowedLambdaVariables.pop();
-    return all;
+    return new UriResourceLambdaAllImpl(var.name, expression);
   }
 
   @Override
@@ -895,7 +880,6 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
   @Override
   public Object visitAnyExpr(final AnyExprContext ctx) {
-    UriResourceLambdaAnyImpl any = new UriResourceLambdaAnyImpl();
     if (ctx.vLV != null) {
       UriResourceImpl lastResourcePart = (UriResourceImpl) context.contextUriInfo.getLastResourcePart();
       if (!(lastResourcePart instanceof UriResourcePartTyped)) {
@@ -909,17 +893,16 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         }
       }
 
-      UriContext.LambdaVariables var = new UriContext.LambdaVariables();
+      UriContext.LambdaVariable var = new UriContext.LambdaVariable();
       var.name = ctx.vLV.getText();
-      var.type = Parser.getTypeInformation((UriResourcePartTyped) lastResourcePart);
-      var.isCollection = false;
+      var.type = ParserHelper.getTypeInformation((UriResourcePartTyped) lastResourcePart);
 
-      any.setLamdaVariable(ctx.vLV.getText());
       context.allowedLambdaVariables.push(var);
-      any.setExpression((Expression) ctx.vLE.accept(this));
+      Expression expression = (Expression) ctx.vLE.accept(this);
       context.allowedLambdaVariables.pop();
+      return new UriResourceLambdaAnyImpl(var.name, expression);
     }
-    return any;
+    return null;
   }
 
   @Override
@@ -1238,18 +1221,18 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
     if (context.contextExpandItemPath == null) {
       // use the type of the last resource path segement
       UriResourceTypedImpl lastSegment = (UriResourceTypedImpl) context.contextUriInfo.getLastResourcePart();
-      targetType = Parser.getTypeInformation(lastSegment);
+      targetType = ParserHelper.getTypeInformation(lastSegment);
       isColl = lastSegment.isCollection();
     } else {
       if (context.contextExpandItemPath.getResourcePath() == null) {
         // use the type of the last resource path segement
         UriResourceTypedImpl lastSegment = (UriResourceTypedImpl) context.contextUriInfo.getLastResourcePart();
-        targetType = Parser.getTypeInformation(lastSegment);
+        targetType = ParserHelper.getTypeInformation(lastSegment);
         isColl = lastSegment.isCollection();
       } else {
         // use the type of the last ''expand'' path segement
         UriInfoImpl info = (UriInfoImpl) context.contextExpandItemPath.getResourcePath();
-        targetType = Parser.getTypeInformation((UriResourcePartTyped) info.getLastResourcePart());
+        targetType = ParserHelper.getTypeInformation((UriResourcePartTyped) info.getLastResourcePart());
         isColl = ((UriResourcePartTyped) info.getLastResourcePart()).isCollection();
       }
     }
@@ -1400,10 +1383,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
     }
 
     if (ctx.vIt != null || ctx.vIts != null) {
-      UriResourceItImpl pathInfoIT = new UriResourceItImpl();
-      pathInfoIT.setType(context.contextTypes.peek());
-      pathInfoIT.setCollection(context.isCollection);
-      uriInfoImplpath.addResourcePart(pathInfoIT);
+      uriInfoImplpath.addResourcePart(new UriResourceItImpl(context.contextTypes.peek(), context.isCollection));
     }
 
     if (ctx.vPs != null) {
@@ -1915,9 +1895,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
     UriResourcePartTyped lastType = (UriResourcePartTyped) lastResource;
 
-    UriResourceRootImpl pathInfoRoot = new UriResourceRootImpl();
-    pathInfoRoot.setCollection(lastType.isCollection());
-    pathInfoRoot.setType(Parser.getTypeInformation(lastType));
+    UriResourceRootImpl pathInfoRoot = new UriResourceRootImpl(
+        ParserHelper.getTypeInformation(lastType),
+        lastType.isCollection());
 
     UriInfoImpl uriInfoImplpath = new UriInfoImpl().setKind(UriInfoKind.resource);
     uriInfoImplpath.addResourcePart(pathInfoRoot);
@@ -2010,7 +1990,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         UriInfoImpl uriInfo = (UriInfoImpl) context.contextSelectItem.getResourcePath();
         UriResource last = uriInfo.getLastResourcePart();
 
-        prevType = Parser.getTypeInformation((UriResourcePartTyped) last);
+        prevType = ParserHelper.getTypeInformation((UriResourcePartTyped) last);
         if (prevType == null) {
           throw wrap(new UriParserSemanticException("prev segment not typed",
               UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "select"));
@@ -2038,8 +2018,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
             || property.getType().getKind() == EdmTypeKind.ENUM
             || property.getType().getKind() == EdmTypeKind.DEFINITION) {
 
-          UriResourcePrimitivePropertyImpl simple = new UriResourcePrimitivePropertyImpl();
-          simple.setProperty(property);
+          UriResourcePrimitivePropertyImpl simple = new UriResourcePrimitivePropertyImpl(property);
 
           UriInfoImpl uriInfo = (UriInfoImpl) context.contextSelectItem.getResourcePath();
           if (uriInfo == null) {
@@ -2059,8 +2038,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         } else {
           UriInfoImpl uriInfo = (UriInfoImpl) context.contextSelectItem.getResourcePath();
 
-          UriResourceComplexPropertyImpl complex = new UriResourceComplexPropertyImpl();
-          complex.setProperty(property);
+          UriResourceComplexPropertyImpl complex = new UriResourceComplexPropertyImpl(property);
 
           if (uriInfo == null) {
             uriInfo = new UriInfoImpl().setKind(UriInfoKind.resource);
@@ -2096,7 +2074,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
           EdmComplexType ct = edm.getComplexType(fullName);
           if (ct != null) {
             if ((ct.compatibleTo(prevType))) {
-              UriResourceStartingTypeFilterImpl resourcePart = new UriResourceStartingTypeFilterImpl();
+              UriResourceStartingTypeFilterImpl resourcePart = new UriResourceStartingTypeFilterImpl(null, false);
               resourcePart.setCollectionTypeFilter(ct);
 
               UriInfoImpl uriInfo = new UriInfoImpl().setKind(UriInfoKind.resource);
@@ -2115,7 +2093,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
           EdmEntityType et = edm.getEntityType(fullName);
           if (et != null) {
             if ((et.compatibleTo(prevType))) {
-              UriResourceStartingTypeFilterImpl resourcePart = new UriResourceStartingTypeFilterImpl();
+              UriResourceStartingTypeFilterImpl resourcePart = new UriResourceStartingTypeFilterImpl(null, false);
               resourcePart.setCollectionTypeFilter(et);
 
               UriInfoImpl uriInfo = new UriInfoImpl().setKind(UriInfoKind.resource);
@@ -2142,13 +2120,13 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
           throw wrap(new UriParserSemanticException("prev segment typed",
               UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "select"));
         }
-        EdmType prevType = Parser.getTypeInformation((UriResourcePartTyped) last);
+        EdmType prevType = ParserHelper.getTypeInformation((UriResourcePartTyped) last);
 
         if (prevType instanceof EdmComplexType) {
           EdmComplexType ct = edm.getComplexType(fullName);
           if (ct != null) {
             if ((ct.compatibleTo(prevType))) {
-              UriResourceStartingTypeFilterImpl resourcePart = new UriResourceStartingTypeFilterImpl();
+              UriResourceStartingTypeFilterImpl resourcePart = new UriResourceStartingTypeFilterImpl(null, false);
               resourcePart.setCollectionTypeFilter(ct);
 
               uriInfo.addResourcePart(resourcePart);
@@ -2186,7 +2164,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
           throw wrap(new UriParserSemanticException("prev segment typed",
               UriParserSemanticException.MessageKeys.PREVIOUS_PART_TYPED));
         }
-        prevType = Parser.getTypeInformation((UriResourcePartTyped) last);
+        prevType = ParserHelper.getTypeInformation((UriResourcePartTyped) last);
       }
 
       final FullQualifiedName finalTypeName = prevType.getFullQualifiedName();
@@ -2195,8 +2173,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       EdmAction action = edm.getBoundAction(fullName, finalTypeName, null);
 
       if (action != null) {
-        UriResourceActionImpl uriAction = new UriResourceActionImpl();
-        uriAction.setAction(action);
+        UriResourceActionImpl uriAction = new UriResourceActionImpl(action);
 
         UriInfoImpl resourcePath = (UriInfoImpl) context.contextSelectItem.getResourcePath();
         resourcePath.addResourcePart(uriAction);
@@ -2206,8 +2183,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       EdmFunction function = edm.getBoundFunction(fullName, finalTypeName, null, null);
 
       if (function != null) {
-        UriResourceFunctionImpl uriFunction = new UriResourceFunctionImpl();
-        uriFunction.setFunction(function);
+        UriResourceFunctionImpl uriFunction = new UriResourceFunctionImpl(null, function, null);
 
         UriInfoImpl resourcePath = (UriInfoImpl) context.contextSelectItem.getResourcePath();
         resourcePath.addResourcePart(uriFunction);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
index 4b43cd9..37f1b76 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
@@ -40,10 +40,14 @@ public class UriTokenizer {
     ROOT,
     IT,
 
+    ANY,
+    ALL,
+
     OPEN,
     CLOSE,
     COMMA,
     SEMI,
+    COLON,
     DOT,
     SLASH,
     EQ,
@@ -119,7 +123,10 @@ public class UriTokenizer {
     TotalsecondsMethod,
     ToupperMethod,
     TrimMethod,
-    YearMethod
+    YearMethod,
+
+    AscSuffix,
+    DescSuffix
   }
 
   private final String parseString;
@@ -174,6 +181,13 @@ public class UriTokenizer {
       found = nextConstant("$it");
       break;
 
+    case ANY:
+      found = nextConstant("any");
+      break;
+    case ALL:
+      found = nextConstant("all");
+      break;
+
     case OPEN:
       found = nextCharacter('(');
       break;
@@ -186,6 +200,9 @@ public class UriTokenizer {
     case SEMI:
       found = nextCharacter(';');
       break;
+    case COLON:
+      found = nextCharacter(':');
+      break;
     case DOT:
       found = nextCharacter('.');
       break;
@@ -409,6 +426,14 @@ public class UriTokenizer {
     case YearMethod:
       found = nextMethod("year");
       break;
+
+    // Suffixes
+    case AscSuffix:
+      found = nextSuffix("asc");
+      break;
+    case DescSuffix:
+      found = nextSuffix("desc");
+      break;
     }
 
     if (found) {
@@ -543,6 +568,15 @@ public class UriTokenizer {
   }
 
   /**
+   * Moves past (required) whitespace and the given suffix name if found;
+   * otherwise leaves the index unchanged.
+   * @return whether the suffix has been found at the current index
+   */
+  private boolean nextSuffix(final String suffixName) {
+    return nextWhitespace() && nextConstant(suffixName);
+  }
+
+  /**
    * Moves past an OData identifier if found; otherwise leaves the index unchanged.
    * @return whether an OData identifier has been found at the current index
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
index a71e382..6ef37e4 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
@@ -94,4 +94,9 @@ public class MemberImpl implements Member {
     }
     return false;
   }
+
+  @Override
+  public String toString() {
+    return path.getUriResourceParts().toString() + (startTypeFilter == null ? "" : startTypeFilter);
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
index 4c76e96..68e6637 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.Arrays;
 
+import org.apache.olingo.commons.api.edm.EdmAction;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
 import org.apache.olingo.commons.api.ex.ODataRuntimeException;
 import org.apache.olingo.server.api.uri.UriInfo;
@@ -33,9 +34,6 @@ import org.apache.olingo.server.api.uri.UriResourceAction;
 import org.apache.olingo.server.api.uri.UriResourceEntitySet;
 import org.apache.olingo.server.api.uri.queryoption.AliasQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.QueryOption;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.UriResourceActionImpl;
-import org.apache.olingo.server.core.uri.UriResourceEntitySetImpl;
 import org.apache.olingo.server.core.uri.queryoption.AliasQueryOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
@@ -86,9 +84,9 @@ public class UriInfoImplTest {
   public void resourceParts() {
     UriInfoImpl uriInfo = new UriInfoImpl();
 
-    final UriResourceAction action = new UriResourceActionImpl();
-    final UriResourceEntitySet entitySet0 = new UriResourceEntitySetImpl();
-    final UriResourceEntitySet entitySet1 = new UriResourceEntitySetImpl();
+    final UriResourceAction action = new UriResourceActionImpl((EdmAction) null);
+    final UriResourceEntitySet entitySet0 = new UriResourceEntitySetImpl(null);
+    final UriResourceEntitySet entitySet1 = new UriResourceEntitySetImpl(null);
 
     uriInfo.addResourcePart(action);
     uriInfo.addResourcePart(entitySet0);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
index 183ff22..4ab7fce 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
@@ -28,6 +28,7 @@ import java.util.Locale;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
 import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
 import org.junit.Test;
 
 public class ExpressionParserTest {
@@ -127,7 +128,7 @@ public class ExpressionParserTest {
   @Test
   public void unary() throws Exception {
     Expression expression = parseExpression("-5");
-    assertEquals("{MINUS 5}", expression.toString());
+    assertEquals("-5", expression.toString());
 
     assertEquals("{MINUS -1}", parseExpression("--1").toString());
     assertEquals("{MINUS duration'PT1M'}", parseExpression("-duration'PT1M'").toString());
@@ -135,13 +136,13 @@ public class ExpressionParserTest {
     expression = parseExpression("not false");
     assertEquals("{NOT false}", expression.toString());
 
-    wrongExpression("-11:12:13");
+    wrongExpression("not 11:12:13");
   }
 
   @Test
   public void grouping() throws Exception {
     Expression expression = parseExpression("-5 add 5");
-    assertEquals("{{MINUS 5} ADD 5}", expression.toString());
+    assertEquals("{-5 ADD 5}", expression.toString());
 
     expression = parseExpression("-(5 add 5)");
     assertEquals("{MINUS {5 ADD 5}}", expression.toString());
@@ -149,7 +150,7 @@ public class ExpressionParserTest {
 
   @Test
   public void precedence() throws Exception {
-    assertEquals("{{MINUS 1} ADD {2 DIV 3}}", parseExpression("-1 add 2 div 3").toString());
+    assertEquals("{-1 ADD {2 DIV 3}}", parseExpression("-1 add 2 div 3").toString());
     assertEquals("{true OR {{NOT false} AND true}}", parseExpression("true or not false and true").toString());
   }
 
@@ -264,7 +265,8 @@ public class ExpressionParserTest {
     wrongExpression("substring(1,2)");
   }
 
-  private Expression parseMethod(TokenKind kind, String... parameters) throws UriParserException {
+  private Expression parseMethod(TokenKind kind, String... parameters)
+      throws UriParserException, UriValidationException {
     String expressionString = kind.name().substring(0, kind.name().indexOf("Method"))
         .toLowerCase(Locale.ROOT).replace("geo", "geo.") + '(';
     boolean first = true;
@@ -283,9 +285,10 @@ public class ExpressionParserTest {
     return expression;
   }
 
-  private Expression parseExpression(final String expressionString) throws UriParserException {
+  private Expression parseExpression(final String expressionString)
+      throws UriParserException, UriValidationException {
     UriTokenizer tokenizer = new UriTokenizer(expressionString);
-    Expression expression = new ExpressionParser(null, odata).parse(tokenizer);
+    Expression expression = new ExpressionParser(null, odata).parse(tokenizer, null, null);
     assertNotNull(expression);
     assertTrue(tokenizer.next(TokenKind.EOF));
     return expression;
@@ -293,10 +296,12 @@ public class ExpressionParserTest {
 
   private void wrongExpression(final String expressionString) {
     try {
-      new ExpressionParser(null, odata).parse(new UriTokenizer(expressionString));
+      new ExpressionParser(null, odata).parse(new UriTokenizer(expressionString), null, null);
       fail("Expected exception not thrown.");
     } catch (final UriParserException e) {
       assertNotNull(e);
+    } catch (final UriValidationException e) {
+      assertNotNull(e);
     }
   }
 }


[49/51] [abbrv] olingo-odata4 git commit: OLINGO-853: correcting the encoding behavior as I reverted the change in EdmString from OLINGO-854, this will also localize the change to this perticular method

Posted by mi...@apache.org.
OLINGO-853: correcting the encoding behavior as I reverted the change in EdmString from OLINGO-854, this will also localize the change to this perticular method


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: b9512eda4b42ac75cf5880428cdc45746473b1cd
Parents: 322085d
Author: Ramesh Reddy <ra...@jboss.org>
Authored: Fri Jan 22 11:45:06 2016 -0600
Committer: Ramesh Reddy <ra...@jboss.org>
Committed: Fri Jan 22 11:45:06 2016 -0600

----------------------------------------------------------------------
 .../org/apache/olingo/server/core/responses/EntityResponse.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b9512eda/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
index 064ad6f..a0bbd14 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
@@ -29,6 +29,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
+import org.apache.olingo.commons.core.Encoder;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmString;
 import org.apache.olingo.server.api.ODataApplicationException;
@@ -199,7 +200,7 @@ public class EntityResponse extends ServiceResponse {
       String value =  EdmPrimitiveTypeFactory.getInstance(kind).valueToString(
           propertyValue, true, 4000, 0, 0, true);
       if (kind == EdmPrimitiveTypeKind.String) {
-          value = EdmString.getInstance().toUriLiteral(value);
+          value = EdmString.getInstance().toUriLiteral(Encoder.encode(value));
       }
       location.append(value);
     }


[07/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp ServerCore

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java
index d99d943..a5afba1 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -110,24 +110,24 @@ public class BatchResponseSerializer {
 
   private void appendHeader(final String name, final String value, final BodyBuilder builder) {
     builder.append(name)
-        .append(COLON)
-        .append(SP)
-        .append(value)
-        .append(CRLF);
+    .append(COLON)
+    .append(SP)
+    .append(value)
+    .append(CRLF);
   }
 
   private void appendStatusLine(final ODataResponse response, final BodyBuilder builder) {
     builder.append("HTTP/1.1")
-        .append(SP)
-        .append(response.getStatusCode())
-        .append(SP)
-        .append(getStatusCodeInfo(response))
-        .append(CRLF);
+    .append(SP)
+    .append(response.getStatusCode())
+    .append(SP)
+    .append(getStatusCodeInfo(response))
+    .append(CRLF);
   }
 
-  private String getStatusCodeInfo(ODataResponse response) {
+  private String getStatusCodeInfo(final ODataResponse response) {
     HttpStatusCode status = HttpStatusCode.fromStatusCode(response.getStatusCode());
-    if(status == null) {
+    if (status == null) {
       throw new ODataRuntimeException("Invalid status code in response '" + response.getStatusCode() + "'");
     }
     return status.getInfo();
@@ -189,17 +189,17 @@ public class BatchResponseSerializer {
       return tmp;
     }
 
-    public BodyBuilder append(String string) {
-      byte [] b = string.getBytes(CHARSET_ISO_8859_1);
+    public BodyBuilder append(final String string) {
+      byte[] b = string.getBytes(CHARSET_ISO_8859_1);
       put(b);
       return this;
     }
 
-    private void put(byte[] b) {
-      if(isClosed) {
+    private void put(final byte[] b) {
+      if (isClosed) {
         throw new RuntimeException("BodyBuilder is closed.");
       }
-      if(buffer.remaining() < b.length) {
+      if (buffer.remaining() < b.length) {
         buffer.flip();
         int newSize = (buffer.limit() * 2) + b.length;
         ByteBuffer tmp = ByteBuffer.allocate(newSize);
@@ -209,15 +209,16 @@ public class BatchResponseSerializer {
       buffer.put(b);
     }
 
-    public BodyBuilder append(int statusCode) {
+    public BodyBuilder append(final int statusCode) {
       return append(String.valueOf(statusCode));
     }
 
-    public BodyBuilder append(Body body) {
+    public BodyBuilder append(final Body body) {
       put(body.getContent());
       return this;
     }
 
+    @Override
     public String toString() {
       return new String(buffer.array(), 0, buffer.position(), CHARSET_ISO_8859_1);
     }
@@ -229,8 +230,8 @@ public class BatchResponseSerializer {
   private class Body {
     private final byte[] content;
 
-    public Body(ODataResponse response) {
-      this.content = getBody(response);
+    public Body(final ODataResponse response) {
+      content = getBody(response);
     }
 
     public int getLength() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java
index 3066839..f21f064 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -67,7 +67,7 @@ public class FixedFormatSerializerImpl implements FixedFormatSerializer {
   }
 
   @Override
-  public InputStream asyncResponse(ODataResponse odataResponse) throws SerializerException {
+  public InputStream asyncResponse(final ODataResponse odataResponse) throws SerializerException {
     AsyncResponseSerializer serializer = new AsyncResponseSerializer();
     return serializer.serialize(odataResponse);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java
index 53dca19..0d35f2c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java
index c3c39d0..9a84c27 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
index b5a2c6a..a912862 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -78,8 +78,8 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
   private final boolean isODataMetadataNone;
 
   public ODataJsonSerializer(final ContentType contentType) {
-    this.isIEEE754Compatible = isODataIEEE754Compatible(contentType);
-    this.isODataMetadataNone = ContentTypeHelper.isODataMetadataNone(contentType);
+    isIEEE754Compatible = isODataIEEE754Compatible(contentType);
+    isODataMetadataNone = ContentTypeHelper.isODataMetadataNone(contentType);
   }
 
   @Override
@@ -187,9 +187,9 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
       JsonGenerator json = new JsonFactory().createGenerator(outputStream);
       writeEntity(metadata, entityType, entity, contextURL,
           options == null ? null : options.getExpand(),
-          options == null ? null : options.getSelect(),
-          options == null ? false : options.getWriteOnlyReferences(),
-          json);
+              options == null ? null : options.getSelect(),
+                  options == null ? false : options.getWriteOnlyReferences(),
+                      json);
 
       json.close();
       outputStream.close();
@@ -232,7 +232,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
   protected void writeEntity(final ServiceMetadata metadata, final EdmEntityType entityType,
       final Entity entity, final ContextURL contextURL, final ExpandOption expand,
       final SelectOption select, final boolean onlyReference, final JsonGenerator json)
-      throws IOException, SerializerException {
+          throws IOException, SerializerException {
     json.writeStartObject();
     if (!isODataMetadataNone) {
       if (contextURL != null) { // top-level entity
@@ -291,7 +291,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
     }
     throw new SerializerException("Wrong base type",
         SerializerException.MessageKeys.WRONG_BASE_TYPE, derivedTypeName, baseType
-            .getFullQualifiedName().getFullQualifiedNameAsString());
+        .getFullQualifiedName().getFullQualifiedNameAsString());
   }
 
   protected EdmComplexType resolveComplexType(final ServiceMetadata metadata, final EdmComplexType baseType,
@@ -315,21 +315,21 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
     }
     throw new SerializerException("Wrong base type",
         SerializerException.MessageKeys.WRONG_BASE_TYPE, derivedTypeName, baseType
-            .getFullQualifiedName().getFullQualifiedNameAsString());
+        .getFullQualifiedName().getFullQualifiedNameAsString());
   }
 
   protected void writeProperties(final EdmStructuredType type, final List<Property> properties,
       final SelectOption select, final JsonGenerator json)
-      throws IOException, SerializerException {
+          throws IOException, SerializerException {
     final boolean all = ExpandSelectHelper.isAll(select);
     final Set<String> selected = all ? new HashSet<String>() :
-        ExpandSelectHelper.getSelectedPropertyNames(select.getSelectItems());
+      ExpandSelectHelper.getSelectedPropertyNames(select.getSelectItems());
     for (final String propertyName : type.getPropertyNames()) {
       if (all || selected.contains(propertyName)) {
         final EdmProperty edmProperty = type.getStructuralProperty(propertyName);
         final Property property = findProperty(propertyName, properties);
         final Set<List<String>> selectedPaths = all || edmProperty.isPrimitive() ? null :
-            ExpandSelectHelper.getSelectedPaths(select.getSelectItems(), propertyName);
+          ExpandSelectHelper.getSelectedPaths(select.getSelectItems(), propertyName);
         writeProperty(edmProperty, property, selectedPaths, json);
       }
     }
@@ -341,20 +341,20 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
     if (ExpandSelectHelper.hasExpand(expand)) {
       final boolean expandAll = ExpandSelectHelper.isExpandAll(expand);
       final Set<String> expanded = expandAll ? new HashSet<String>() :
-          ExpandSelectHelper.getExpandedPropertyNames(expand.getExpandItems());
+        ExpandSelectHelper.getExpandedPropertyNames(expand.getExpandItems());
       for (final String propertyName : type.getNavigationPropertyNames()) {
         if (expandAll || expanded.contains(propertyName)) {
           final EdmNavigationProperty property = type.getNavigationProperty(propertyName);
           final Link navigationLink = linked.getNavigationLink(property.getName());
           final ExpandItem innerOptions = expandAll ? null :
-              ExpandSelectHelper.getExpandItem(expand.getExpandItems(), propertyName);
+            ExpandSelectHelper.getExpandItem(expand.getExpandItems(), propertyName);
           if (innerOptions != null && innerOptions.getLevelsOption() != null) {
             throw new SerializerException("Expand option $levels is not supported.",
                 SerializerException.MessageKeys.NOT_IMPLEMENTED);
           }
           writeExpandedNavigationProperty(metadata, property, navigationLink,
               innerOptions == null ? null : innerOptions.getExpandOption(),
-              innerOptions == null ? null : innerOptions.getSelectOption(), json);
+                  innerOptions == null ? null : innerOptions.getSelectOption(), json);
         }
       }
     }
@@ -384,17 +384,17 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
 
   protected void writeProperty(final EdmProperty edmProperty, final Property property,
       final Set<List<String>> selectedPaths, final JsonGenerator json)
-      throws IOException, SerializerException {
+          throws IOException, SerializerException {
     json.writeFieldName(edmProperty.getName());
     if (property == null || property.isNull()) {
       if (edmProperty.isNullable() == Boolean.FALSE) {
         throw new SerializerException("Non-nullable property not present!",
             SerializerException.MessageKeys.MISSING_PROPERTY, edmProperty.getName());
       } else {
-        if(edmProperty.isCollection()){
+        if (edmProperty.isCollection()) {
           json.writeStartArray();
           json.writeEndArray();
-        }else {
+        } else {
           json.writeNull();
         }
       }
@@ -405,7 +405,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
 
   private void writePropertyValue(final EdmProperty edmProperty,
       final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json)
-      throws IOException, SerializerException {
+          throws IOException, SerializerException {
     final EdmType type = edmProperty.getType();
     try {
       if (edmProperty.isPrimitive()
@@ -439,7 +439,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
   private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property,
       final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
       final Boolean isUnicode, final JsonGenerator json)
-      throws IOException, SerializerException {
+          throws IOException, SerializerException {
     json.writeStartArray();
     for (Object value : property.asCollection()) {
       switch (property.getValueType()) {
@@ -466,7 +466,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
 
   private void writeComplexCollection(final EdmComplexType type, final Property property,
       final Set<List<String>> selectedPaths, final JsonGenerator json)
-      throws IOException, SerializerException {
+          throws IOException, SerializerException {
     json.writeStartArray();
     for (Object value : property.asCollection()) {
       switch (property.getValueType()) {
@@ -484,7 +484,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
   private void writePrimitive(final EdmPrimitiveType type, final Property property,
       final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
       final Boolean isUnicode, final JsonGenerator json)
-      throws EdmPrimitiveTypeException, IOException, SerializerException {
+          throws EdmPrimitiveTypeException, IOException, SerializerException {
     if (property.isPrimitive()) {
       writePrimitiveValue(type, property.asPrimitive(),
           isNullable, maxLength, precision, scale, isUnicode, json);
@@ -526,14 +526,14 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
 
   protected void writeComplexValue(final EdmComplexType type, final List<Property> properties,
       final Set<List<String>> selectedPaths, final JsonGenerator json)
-      throws IOException, SerializerException {
+          throws IOException, SerializerException {
     json.writeStartObject();
     for (final String propertyName : type.getPropertyNames()) {
       final Property property = findProperty(propertyName, properties);
       if (selectedPaths == null || ExpandSelectHelper.isSelected(selectedPaths, propertyName)) {
         writeProperty((EdmProperty) type.getProperty(propertyName), property,
             selectedPaths == null ? null : ExpandSelectHelper.getReducedSelectedPaths(selectedPaths, propertyName),
-            json);
+                json);
       }
     }
     json.writeEndObject();
@@ -567,10 +567,10 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
         json.writeFieldName(Constants.VALUE);
         writePrimitive(type, property,
             options == null ? null : options.isNullable(),
-            options == null ? null : options.getMaxLength(),
-            options == null ? null : options.getPrecision(),
-            options == null ? null : options.getScale(),
-            options == null ? null : options.isUnicode(), json);
+                options == null ? null : options.getMaxLength(),
+                    options == null ? null : options.getPrecision(),
+                        options == null ? null : options.getScale(),
+                            options == null ? null : options.isUnicode(), json);
       }
       json.writeEndObject();
 
@@ -610,16 +610,16 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
       }
       final List<Property> values =
           property.isNull() ? Collections.<Property> emptyList() : property.asComplex().getValue();
-      writeProperties(type, values, options == null ? null : options.getSelect(), json);
-      if (!property.isNull() && property.isComplex()) {
-        writeNavigationProperties(metadata, type, property.asComplex(),
-            options == null ? null : options.getExpand(), json);
-      }
-      json.writeEndObject();
+          writeProperties(type, values, options == null ? null : options.getSelect(), json);
+          if (!property.isNull() && property.isComplex()) {
+            writeNavigationProperties(metadata, type, property.asComplex(),
+                options == null ? null : options.getExpand(), json);
+          }
+          json.writeEndObject();
 
-      json.close();
-      outputStream.close();
-      return SerializerResultImpl.with().content(buffer.getInputStream()).build();
+          json.close();
+          outputStream.close();
+          return SerializerResultImpl.with().content(buffer.getInputStream()).build();
     } catch (final IOException e) {
       cachedException =
           new SerializerException(IO_EXCEPTION_TEXT, e, SerializerException.MessageKeys.IO_EXCEPTION);
@@ -645,10 +645,10 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
       json.writeFieldName(Constants.VALUE);
       writePrimitiveCollection(type, property,
           options == null ? null : options.isNullable(),
-          options == null ? null : options.getMaxLength(),
-          options == null ? null : options.getPrecision(),
-          options == null ? null : options.getScale(),
-          options == null ? null : options.isUnicode(), json);
+              options == null ? null : options.getMaxLength(),
+                  options == null ? null : options.getPrecision(),
+                      options == null ? null : options.getScale(),
+                          options == null ? null : options.isUnicode(), json);
       json.writeEndObject();
 
       json.close();
@@ -725,7 +725,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
   @Override
   public SerializerResult referenceCollection(final ServiceMetadata metadata, final EdmEntitySet edmEntitySet,
       final EntityCollection entityCollection, final ReferenceCollectionSerializerOptions options)
-      throws SerializerException {
+          throws SerializerException {
     OutputStream outputStream = null;
     SerializerException cachedException = null;
 
@@ -767,13 +767,13 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
 
   }
 
-  private void writeContextURL(final ContextURL contextURL, JsonGenerator json) throws IOException {
+  private void writeContextURL(final ContextURL contextURL, final JsonGenerator json) throws IOException {
     if (!isODataMetadataNone && contextURL != null) {
       json.writeStringField(Constants.JSON_CONTEXT, ContextURLBuilder.create(contextURL).toASCIIString());
     }
   }
 
-  private void writeMetadataETag(final ServiceMetadata metadata, JsonGenerator json) throws IOException {
+  private void writeMetadataETag(final ServiceMetadata metadata, final JsonGenerator json) throws IOException {
     if (!isODataMetadataNone
         && metadata != null
         && metadata.getServiceMetadataETagSupport() != null
@@ -783,7 +783,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
     }
   }
 
-  private void writeCount(final EntityCollection entityCollection, JsonGenerator json) throws IOException {
+  private void writeCount(final EntityCollection entityCollection, final JsonGenerator json) throws IOException {
     if (entityCollection.getCount() != null) {
       if (isIEEE754Compatible) {
         json.writeStringField(Constants.JSON_COUNT, entityCollection.getCount().toString());
@@ -793,7 +793,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer {
     }
   }
 
-  private void writeNextLink(final EntityCollection entitySet, JsonGenerator json) throws IOException {
+  private void writeNextLink(final EntityCollection entitySet, final JsonGenerator json) throws IOException {
     if (entitySet.getNext() != null) {
       json.writeStringField(Constants.JSON_NEXT_LINK, entitySet.getNext().toASCIIString());
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java
index 9625a4c..682e478 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -58,8 +58,8 @@ public class ServiceDocumentJsonSerializer {
     if (!isODataMetadataNone) {
       final String metadataUri =
           (serviceRoot == null ? "" :
-              serviceRoot.endsWith("/") ? serviceRoot : (serviceRoot + "/"))
-              + Constants.METADATA;
+            serviceRoot.endsWith("/") ? serviceRoot : (serviceRoot + "/"))
+            + Constants.METADATA;
       gen.writeObjectField(Constants.JSON_CONTEXT, metadataUri);
 
       if (metadata != null
@@ -100,9 +100,9 @@ public class ServiceDocumentJsonSerializer {
     }
   }
 
-  private void writeElement(JsonGenerator gen, final String kind, final String reference, final String name,
+  private void writeElement(final JsonGenerator gen, final String kind, final String reference, final String name,
       final String title)
-      throws IOException {
+          throws IOException {
     gen.writeStartObject();
     gen.writeObjectField(Constants.JSON_NAME, name);
     if (title != null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java
index 20d9ca5..ac91b84 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java
index 8710158..68d85f7 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,13 +21,13 @@ package org.apache.olingo.server.core.serializer.utils;
 import org.apache.olingo.commons.api.format.ContentType;
 
 public class ContentTypeHelper {
-  
-  private ContentTypeHelper (){
-    //Private constructor for utility classes
+
+  private ContentTypeHelper() {
+    // Private constructor for utility classes
   }
-  
+
   public static boolean isODataMetadataNone(final ContentType contentType) {
-    return contentType.isCompatible(ContentType.APPLICATION_JSON) 
-       && ContentType.VALUE_ODATA_METADATA_NONE.equals(contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA));
+    return contentType.isCompatible(ContentType.APPLICATION_JSON)
+        && ContentType.VALUE_ODATA_METADATA_NONE.equals(contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA));
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java
index 8c7a8d5..39649ab 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -31,17 +31,17 @@ import org.apache.olingo.commons.core.Encoder;
  */
 public final class ContextURLBuilder {
 
-  private ContextURLBuilder() { /* private ctor for helper class */ }
+  private ContextURLBuilder() { /* private ctor for helper class */}
 
   public static URI create(final ContextURL contextURL) {
     StringBuilder result = new StringBuilder();
     if (contextURL.getServiceRoot() != null) {
       result.append(contextURL.getServiceRoot());
-    } else if(contextURL.getODataPath() != null) {
+    } else if (contextURL.getODataPath() != null) {
       String oDataPath = contextURL.getODataPath();
       char[] chars = oDataPath.toCharArray();
-      for (int i = 1; i < chars.length-1; i++) {
-        if(chars[i] == '/' && chars[i-1] != '/') {
+      for (int i = 1; i < chars.length - 1; i++) {
+        if (chars[i] == '/' && chars[i - 1] != '/') {
           result.append("../");
         }
       }
@@ -52,8 +52,8 @@ public final class ContextURLBuilder {
       result.append('#');
       if (contextURL.isCollection()) {
         result.append("Collection(")
-        .append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType()))
-        .append(")");
+            .append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType()))
+            .append(")");
       } else {
         result.append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType()));
       }
@@ -79,9 +79,9 @@ public final class ContextURLBuilder {
       }
       if (contextURL.isCollection()) {
         result.append('#')
-              .append("Collection(")
-              .append(ContextURL.Suffix.REFERENCE.getRepresentation())
-              .append(")");
+            .append("Collection(")
+            .append(ContextURL.Suffix.REFERENCE.getRepresentation())
+            .append(")");
       } else {
         result.append('#').append(ContextURL.Suffix.REFERENCE.getRepresentation());
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
index 22a2301..129f242 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -38,7 +38,7 @@ import org.apache.olingo.server.api.uri.queryoption.SelectOption;
 
 public final class ContextURLHelper {
 
-  private ContextURLHelper() { /* private ctor for helper class */ }
+  private ContextURLHelper() { /* private ctor for helper class */}
 
   /**
    * Builds a list of selected Properties for the ContextURL,
@@ -123,12 +123,12 @@ public final class ContextURLHelper {
           }
         } else {
           final List<UriResource> resourceParts = expandItem.getResourcePath().getUriResourceParts();
-          if(resourceParts.size() > 1) {
+          if (resourceParts.size() > 1) {
             if (result.length() > 0) {
               result.append(',');
-            }            
+            }
             final List<String> path = getPropertyPath(resourceParts);
-            String propertyPath = buildPropertyPath(path);            
+            String propertyPath = buildPropertyPath(path);
             result.append(Encoder.encode(propertyName));
             result.append("/").append(propertyPath);
           }
@@ -152,8 +152,9 @@ public final class ContextURLHelper {
     for (final String segment : path) {
       result.append(result.length() == 0 ? "" : '/').append(Encoder.encode(segment)); //$NON-NLS-1$
     }
-    return result.length() == 0?null:result.toString();
-  }  
+    return result.length() == 0 ? null : result.toString();
+  }
+
   private static List<List<String>> getComplexSelectedPaths(final EdmProperty edmProperty,
       final Set<List<String>> selectedPaths) {
     List<List<String>> result = new ArrayList<List<String>>();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java
index 30810f0..13e158f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java
index 4a3a6ef..a0fd021 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java
@@ -226,7 +226,7 @@ public class MetadataDocumentXmlSerializer {
     writer.writeEndElement();
   }
 
-  private void appendTerms(XMLStreamWriter writer, List<EdmTerm> terms) throws XMLStreamException {
+  private void appendTerms(final XMLStreamWriter writer, final List<EdmTerm> terms) throws XMLStreamException {
     for (EdmTerm term : terms) {
       writer.writeStartElement(XML_TERM_ATT);
 
@@ -238,15 +238,15 @@ public class MetadataDocumentXmlSerializer {
         writer.writeAttribute(XML_BASE_TERM, getAliasedFullQualifiedName(term.getBaseTerm().getFullQualifiedName(),
             false));
       }
-      
-      if(term.getAppliesTo() != null && !term.getAppliesTo().isEmpty()){
+
+      if (term.getAppliesTo() != null && !term.getAppliesTo().isEmpty()) {
         String appliesToString = "";
         boolean first = true;
-        for(TargetType target : term.getAppliesTo()){
-          if(first){
+        for (TargetType target : term.getAppliesTo()) {
+          if (first) {
             first = false;
             appliesToString = target.toString();
-          }else{
+          } else {
             appliesToString = appliesToString + " " + target.toString();
           }
         }
@@ -273,20 +273,20 @@ public class MetadataDocumentXmlSerializer {
       if (term.getScale() != null) {
         writer.writeAttribute(XML_SCALE, "" + term.getScale());
       }
-      
+
       appendAnnotations(writer, term);
       writer.writeEndElement();
     }
   }
 
-  private void appendAnnotationGroups(XMLStreamWriter writer, List<EdmAnnotations> annotationGroups)
+  private void appendAnnotationGroups(final XMLStreamWriter writer, final List<EdmAnnotations> annotationGroups)
       throws XMLStreamException {
     for (EdmAnnotations annotationGroup : annotationGroups) {
       appendAnnotationGroup(writer, annotationGroup);
     }
   }
 
-  private void appendAnnotationGroup(XMLStreamWriter writer, EdmAnnotations annotationGroup)
+  private void appendAnnotationGroup(final XMLStreamWriter writer, final EdmAnnotations annotationGroup)
       throws XMLStreamException {
     writer.writeStartElement(XML_ANNOTATIONS);
     writer.writeAttribute(XML_TARGET, annotationGroup.getTargetPath());
@@ -297,7 +297,8 @@ public class MetadataDocumentXmlSerializer {
     writer.writeEndElement();
   }
 
-  private void appendAnnotations(XMLStreamWriter writer, EdmAnnotatable annotatable) throws XMLStreamException {
+  private void appendAnnotations(final XMLStreamWriter writer, final EdmAnnotatable annotatable)
+      throws XMLStreamException {
     List<EdmAnnotation> annotations = annotatable.getAnnotations();
     if (annotations != null && !annotations.isEmpty()) {
       for (EdmAnnotation annotation : annotations) {
@@ -316,7 +317,8 @@ public class MetadataDocumentXmlSerializer {
     }
   }
 
-  private void appendExpression(XMLStreamWriter writer, EdmExpression expression) throws XMLStreamException {
+  private void appendExpression(final XMLStreamWriter writer,
+      final EdmExpression expression) throws XMLStreamException {
     if (expression == null) {
       return;
     }
@@ -329,7 +331,8 @@ public class MetadataDocumentXmlSerializer {
     }
   }
 
-  private void appendDynamicExpression(XMLStreamWriter writer, EdmDynamicExpression dynExp) throws XMLStreamException {
+  private void appendDynamicExpression(final XMLStreamWriter writer, final EdmDynamicExpression dynExp)
+      throws XMLStreamException {
     writer.writeStartElement(dynExp.getExpressionName());
     switch (dynExp.getExpressionType()) {
     // Logical
@@ -469,19 +472,20 @@ public class MetadataDocumentXmlSerializer {
     writer.writeEndElement();
   }
 
-  private void appendNotExpression(XMLStreamWriter writer, EdmNot exp) throws XMLStreamException {
+  private void appendNotExpression(final XMLStreamWriter writer, final EdmNot exp) throws XMLStreamException {
     appendExpression(writer, exp.getLeftExpression());
     appendAnnotations(writer, exp);
   }
 
-  private void appendLogicalOrComparisonExpression(XMLStreamWriter writer, EdmLogicalOrComparisonExpression exp)
+  private void appendLogicalOrComparisonExpression(final XMLStreamWriter writer,
+      final EdmLogicalOrComparisonExpression exp)
       throws XMLStreamException {
     appendExpression(writer, exp.getLeftExpression());
     appendExpression(writer, exp.getRightExpression());
     appendAnnotations(writer, exp);
   }
 
-  private void appendConstantExpression(XMLStreamWriter writer, EdmConstantExpression constExp)
+  private void appendConstantExpression(final XMLStreamWriter writer, final EdmConstantExpression constExp)
       throws XMLStreamException {
     writer.writeStartElement(constExp.getExpressionName());
     writer.writeCharacters(constExp.getValueAsString());
@@ -928,12 +932,12 @@ public class MetadataDocumentXmlSerializer {
       for (String memberName : enumType.getMemberNames()) {
         writer.writeEmptyElement(XML_MEMBER);
         writer.writeAttribute(XML_NAME, memberName);
-        
+
         EdmMember member = enumType.getMember(memberName);
         if (member.getValue() != null) {
           writer.writeAttribute(XML_VALUE, member.getValue());
         }
-        
+
         appendAnnotations(writer, member);
       }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
index 2af8ede..52d12e4 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
@@ -187,7 +187,8 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
     }
   }
 
-  private void writeErrorDetails(String code, String message, String target, XMLStreamWriter writer)
+  private void writeErrorDetails(final String code, final String message, final String target,
+      final XMLStreamWriter writer)
       throws XMLStreamException {
     if (code != null) {
       writer.writeStartElement(Constants.ERROR_CODE);
@@ -323,7 +324,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
     return contextURL;
   }
 
-  private void writeMetadataETag(final ServiceMetadata metadata, XMLStreamWriter writer)
+  private void writeMetadataETag(final ServiceMetadata metadata, final XMLStreamWriter writer)
       throws XMLStreamException {
     if (metadata != null
         && metadata.getServiceMetadataETagSupport() != null
@@ -344,7 +345,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
   protected void writeEntity(final ServiceMetadata metadata, final EdmEntityType entityType,
       final Entity entity, final ContextURL contextURL, final ExpandOption expand,
       final SelectOption select, final XMLStreamWriter writer, final boolean top)
-          throws XMLStreamException, SerializerException {
+      throws XMLStreamException, SerializerException {
 
     writer.writeStartElement(ATOM, Constants.ATOM_ELEM_ENTRY, NS_ATOM);
     if (top) {
@@ -622,17 +623,18 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
     writer.writeEndElement();
   }
 
-  private String collectionType(EdmType type) {
+  private String collectionType(final EdmType type) {
     return "#Collection(" + type.getFullQualifiedName().getFullQualifiedNameAsString() + ")";
   }
 
-  private String complexType(ServiceMetadata metadata, EdmComplexType baseType, String definedType)
+  private String complexType(final ServiceMetadata metadata, final EdmComplexType baseType, final String definedType)
       throws SerializerException {
     EdmComplexType type = resolveComplexType(metadata, baseType, definedType);
     return type.getFullQualifiedName().getFullQualifiedNameAsString();
   }
 
-  private String derivedComplexType(EdmComplexType baseType, String definedType) throws SerializerException {
+  private String derivedComplexType(final EdmComplexType baseType,
+      final String definedType) throws SerializerException {
     String derived = baseType.getFullQualifiedName().getFullQualifiedNameAsString();
     if (derived.equals(definedType)) {
       return null;
@@ -987,7 +989,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
     return entityReference(entity, options);
   }
 
-  protected SerializerResult entityReference(final Entity entity, ReferenceSerializerOptions options)
+  protected SerializerResult entityReference(final Entity entity, final ReferenceSerializerOptions options)
       throws SerializerException {
     OutputStream outputStream = null;
     SerializerException cachedException = null;
@@ -1016,7 +1018,8 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
     }
   }
 
-  private void writeReference(Entity entity, ContextURL contextURL, XMLStreamWriter writer, boolean top)
+  private void writeReference(final Entity entity, final ContextURL contextURL, final XMLStreamWriter writer,
+      final boolean top)
       throws XMLStreamException {
     writer.writeStartElement(METADATA, "ref", NS_METADATA);
     if (top) {
@@ -1032,13 +1035,13 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
 
   @Override
   public SerializerResult referenceCollection(final ServiceMetadata metadata, final EdmEntitySet edmEntitySet,
-      final EntityCollection entityCollection, ReferenceCollectionSerializerOptions options)
+      final EntityCollection entityCollection, final ReferenceCollectionSerializerOptions options)
       throws SerializerException {
     return entityReferenceCollection(entityCollection, options);
   }
 
   protected SerializerResult entityReferenceCollection(final EntityCollection entitySet,
-      ReferenceCollectionSerializerOptions options) throws SerializerException {
+      final ReferenceCollectionSerializerOptions options) throws SerializerException {
     OutputStream outputStream = null;
     SerializerException cachedException = null;
     try {
@@ -1083,14 +1086,14 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
     }
   }
 
-  private void writeCount(final EntityCollection entitySet, XMLStreamWriter writer)
+  private void writeCount(final EntityCollection entitySet, final XMLStreamWriter writer)
       throws XMLStreamException {
     writer.writeStartElement(METADATA, Constants.ATOM_ELEM_COUNT, NS_METADATA);
     writer.writeCharacters(String.valueOf(entitySet.getCount()));
     writer.writeEndElement();
   }
 
-  private void writeNextLink(final EntityCollection entitySet, XMLStreamWriter writer)
+  private void writeNextLink(final EntityCollection entitySet, final XMLStreamWriter writer)
       throws XMLStreamException {
     writer.writeStartElement(ATOM, Constants.ATOM_ELEM_LINK, NS_ATOM);
     writer.writeAttribute(Constants.ATTR_REL, Constants.NEXT_LINK_REL);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java
index 19d132b..8351945 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -55,7 +55,7 @@ public class ServiceDocumentXmlSerializer {
   public void writeServiceDocument(final XMLStreamWriter writer) throws XMLStreamException {
     final String metadataUri =
         (serviceRoot == null ? "" : serviceRoot.endsWith("/") ? serviceRoot : (serviceRoot + "/"))
-            + Constants.METADATA;
+        + Constants.METADATA;
 
     writer.writeStartDocument(ODataSerializer.DEFAULT_CHARSET, "1.0");
     writer.writeStartElement(APP, "service", NS_APP);
@@ -86,7 +86,7 @@ public class ServiceDocumentXmlSerializer {
     writer.writeEndElement(); // end service
   }
 
-  private void writeServiceDocuments(XMLStreamWriter writer) throws XMLStreamException {
+  private void writeServiceDocuments(final XMLStreamWriter writer) throws XMLStreamException {
     for (EdmxReference reference : metadata.getReferences()) {
       final String referenceString = reference.getUri().toASCIIString();
       writeElement(writer, false, "service-document", referenceString, referenceString);
@@ -118,7 +118,7 @@ public class ServiceDocumentXmlSerializer {
     }
   }
 
-  private void writeElement(XMLStreamWriter writer, final boolean isApp, final String kind, final String name,
+  private void writeElement(final XMLStreamWriter writer, final boolean isApp, final String kind, final String name,
       final String title) throws XMLStreamException {
     if (isApp) {
       writer.writeStartElement(APP, kind, NS_APP);
@@ -126,7 +126,7 @@ public class ServiceDocumentXmlSerializer {
       writer.writeStartElement(METADATA, kind, NS_METADATA);
     }
     writer.writeAttribute(Constants.ATTR_HREF, name);
-    writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_NAME , name);
+    writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_NAME, name);
     writer.writeStartElement(ATOM, Constants.ATOM_ELEM_TITLE, NS_ATOM);
     if (title != null) {
       writer.writeCharacters(title);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
index c463765..f1bd75e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -97,7 +97,7 @@ public class UriHelperImpl implements UriHelper {
   }
 
   @Override
-  public UriResourceEntitySet parseEntityId(Edm edm, String entityId, String rawServiceRoot) 
+  public UriResourceEntitySet parseEntityId(final Edm edm, final String entityId, final String rawServiceRoot)
       throws DeserializerException {
 
     String oDataPath = entityId;
@@ -111,7 +111,7 @@ public class UriHelperImpl implements UriHelper {
           .getUriResourceParts();
       if (uriResourceParts.size() == 1 && uriResourceParts.get(0).getKind() == UriResourceKind.entitySet) {
         final UriResourceEntitySet entityUriResource = (UriResourceEntitySet) uriResourceParts.get(0);
-        
+
         return entityUriResource;
       }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
index bc396f7..e6fe057 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java
index b650cc5..7ab2abe 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
index 4126110..d7f02ae 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,8 +26,8 @@ import org.apache.olingo.server.api.uri.UriResourceKind;
 
 /**
  * Implementation of the {@link UriResourceAction} interface. This class does not extend
- * {@link org.apache.olingo.server.core.uri.UriResourceTypedImpl UriResourceTypedImpl}
- * since that would allow type filters and subsequent path segments.
+ * {@link org.apache.olingo.server.core.uri.UriResourceTypedImpl UriResourceTypedImpl} since that would allow type
+ * filters and subsequent path segments.
  */
 public class UriResourceActionImpl extends UriResourceImpl implements UriResourceAction {
 
@@ -74,7 +74,7 @@ public class UriResourceActionImpl extends UriResourceImpl implements UriResourc
     }
     return null;
   }
-  
+
   @Override
   public String getSegmentValue(final boolean includeFilters) {
     return actionImport == null ? (action == null ? "" : action.getName()) : actionImport.getName();
@@ -84,7 +84,7 @@ public class UriResourceActionImpl extends UriResourceImpl implements UriResourc
   public String getSegmentValue() {
     return getSegmentValue(false);
   }
-  
+
   @Override
   public String toString(final boolean includeFilters) {
     return getSegmentValue(includeFilters);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
index 63db69c..8e78b16 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -63,10 +63,10 @@ public class UriResourceComplexPropertyImpl extends UriResourceTypedImpl impleme
   }
 
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return property.getName();
   }
-  
+
   @Override
   public String toString() {
     return getSegmentValue();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
index e1859a6..59cd677 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,9 +26,9 @@ public class UriResourceCountImpl extends UriResourceImpl implements UriResource
   public UriResourceCountImpl() {
     super(UriResourceKind.count);
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$count";
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
index 4675964..888a34b 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -55,12 +55,11 @@ public class UriResourceEntitySetImpl extends UriResourceWithKeysImpl implements
   public boolean isCollection() {
     return keyPredicates == null;
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return edmEntitySet.getName();
   }
-  
 
   @Override
   public String toString() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
index a47a6ab..42361e0 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -46,7 +46,7 @@ public class UriResourceFunctionImpl extends UriResourceWithKeysImpl implements
   public List<UriParameter> getParameters() {
     return parameters == null ?
         Collections.<UriParameter> emptyList() :
-        Collections.unmodifiableList(parameters);
+          Collections.unmodifiableList(parameters);
   }
 
   public UriResourceFunctionImpl setParameters(final List<UriParameter> parameters) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
index 9fbcbd0..46c1c00 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
index fc31910..461c59b 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -56,9 +56,9 @@ public class UriResourceItImpl extends UriResourceWithKeysImpl implements UriRes
     this.isCollection = isCollection;
     return this;
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$it";
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
index b57d12c..89674f9 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -68,9 +68,9 @@ public class UriResourceLambdaAllImpl extends UriResourceTypedImpl implements Ur
     this.expression = expression;
     return this;
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "all";
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
index 49be2fe..6cad648 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -68,9 +68,9 @@ public class UriResourceLambdaAnyImpl extends UriResourceTypedImpl implements Ur
     this.expression = expression;
     return this;
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "any";
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
index f7fa6fc..90b29ca 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -64,10 +64,10 @@ public class UriResourceLambdaVarImpl extends UriResourceTypedImpl implements Ur
   }
 
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return variableText;
   }
-  
+
   @Override
   public String toString() {
     return getSegmentValue();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
index 1a4fa44..0a6319c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -54,9 +54,9 @@ public class UriResourceNavigationPropertyImpl extends UriResourceWithKeysImpl i
     }
     return navigationProperty.isCollection();
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return navigationProperty.getName();
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
index d470ef4..a666c18 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -50,10 +50,10 @@ public class UriResourcePrimitivePropertyImpl extends UriResourceTypedImpl imple
   public boolean isCollection() {
     return property.isCollection();
   }
-  
+
   @Override
-  public String getSegmentValue(){
-    return  property.getName();
+  public String getSegmentValue() {
+    return property.getName();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
index 0c45f9a..850b940 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -27,8 +27,9 @@ public class UriResourceRefImpl extends UriResourceImpl implements UriResourceRe
     super(UriResourceKind.ref);
 
   }
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$ref";
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
index 5d8737f..906f07b 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -53,9 +53,9 @@ public class UriResourceRootImpl extends UriResourceWithKeysImpl implements UriR
     this.isCollection = isCollection;
     return this;
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$root";
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
index 72289f6..30e29c7 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -62,9 +62,9 @@ public class UriResourceSingletonImpl extends UriResourceTypedImpl implements Ur
   public boolean isCollection() {
     return false;
   }
-  
+
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return singleton.getName();
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
index 24d3713..a42cf8f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -59,10 +59,10 @@ public class UriResourceStartingTypeFilterImpl extends UriResourceWithKeysImpl {
   }
 
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return type.getNamespace() + "." + type.getName();
   }
-  
+
   @Override
   public String toString() {
     return getSegmentValue();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
index d6710ad..cdfa013 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -40,6 +40,7 @@ public abstract class UriResourceTypedImpl extends UriResourceImpl implements Ur
     return this;
   }
 
+  @Override
   public String getSegmentValue(final boolean includeFilters) {
     if (includeFilters) {
       if (typeFilter != null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
index 73f86c4..2cc89cb 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,7 +29,7 @@ public class UriResourceValueImpl extends UriResourceImpl implements UriResource
   }
 
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$value";
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
index 54d62a1..83ec32d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -48,7 +48,7 @@ public abstract class UriResourceWithKeysImpl extends UriResourceImpl implements
   public List<UriParameter> getKeyPredicates() {
     return keyPredicates == null ?
         Collections.<UriParameter> emptyList() :
-        new ArrayList<UriParameter>(keyPredicates);
+          new ArrayList<UriParameter>(keyPredicates);
   }
 
   public UriResourceWithKeysImpl setKeyPredicates(final List<UriParameter> list) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
index 86efdca..bdfdf4c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
index d12b853..fc806ee 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -285,9 +285,9 @@ public class Parser {
             final Expression expression = ((FilterOption) uriParseTreeVisitor.visitFilterExpressionEOF(filterExpCtx))
                 .getExpression();
             context.contextUriInfo.addAlias((AliasQueryOption) new AliasQueryOptionImpl()
-                .setAliasValue(expression)
-                .setName(option.name)
-                .setText(NULL.equals(option.value) ? null : option.value));
+            .setAliasValue(expression)
+            .setName(option.name)
+            .setText(NULL.equals(option.value) ? null : option.value));
           } else {
             throw new UriParserSyntaxException("Alias already specified! Name: " + option.name,
                 UriParserSyntaxException.MessageKeys.DUPLICATED_ALIAS, option.name);
@@ -295,8 +295,8 @@ public class Parser {
         } else {
           context.contextUriInfo.addCustomQueryOption((CustomQueryOption)
               new CustomQueryOptionImpl()
-                  .setName(option.name)
-                  .setText(option.value));
+          .setName(option.name)
+          .setText(option.value));
         }
       }
 
@@ -304,7 +304,7 @@ public class Parser {
     } catch (ParseCancellationException e) {
       throw e.getCause() instanceof UriParserException ?
           (UriParserException) e.getCause() :
-          new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX);
+            new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX);
     }
   }
 
@@ -335,7 +335,7 @@ public class Parser {
 
       // create parser
       if (logLevel > 0) {
-        //TODO: Discuss if we should keep this code
+        // TODO: Discuss if we should keep this code
         lexer = new UriLexer(new ANTLRInputStream(input));
         showTokens(input, lexer.getAllTokens());
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
index 42e0a0f..231317f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY


[23/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] $expand parser in Java + clean-up

Posted by mi...@apache.org.
[OLINGO-834] $expand parser in Java + clean-up

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 8925274c0b5bd6936c3f6c1d3ab55608ced2cf13
Parents: 8919d3e
Author: Klaus Straubinger <kl...@sap.com>
Authored: Thu Jan 7 13:55:34 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Thu Jan 7 14:02:09 2016 +0100

----------------------------------------------------------------------
 .../tecsvc/client/FilterSystemQueryITCase.java  |    7 +-
 .../tecsvc/client/OrderBySystemQueryITCase.java |    7 +-
 .../server/api/uri/queryoption/ExpandItem.java  |    1 -
 .../server/core/uri/parser/ExpandParser.java    |  282 +++
 .../core/uri/parser/ExpressionParser.java       |  332 +--
 .../server/core/uri/parser/FilterParser.java    |   11 +-
 .../olingo/server/core/uri/parser/Parser.java   |  234 +-
 .../server/core/uri/parser/ParserHelper.java    |   34 +-
 .../core/uri/parser/ResourcePathParser.java     |   62 +-
 .../server/core/uri/parser/SearchParser.java    |  108 +
 .../server/core/uri/parser/UriContext.java      |  115 -
 .../core/uri/parser/UriParseTreeVisitor.java    | 2313 ------------------
 .../server/core/uri/parser/UriTokenizer.java    |  211 +-
 .../uri/queryoption/expression/AliasImpl.java   |    4 +
 .../queryoption/expression/EnumerationImpl.java |    6 +
 .../queryoption/expression/LambdaRefImpl.java   |    5 +
 .../queryoption/expression/TypeLiteralImpl.java |    5 +
 .../server-core-exceptions-i18n.properties      |    8 +-
 .../core/uri/parser/ExpressionParserTest.java   |   14 +-
 .../core/uri/parser/UriTokenizerTest.java       |   82 +-
 .../search/SearchParserAndTokenizerTest.java    |   44 +-
 .../core/uri/antlr/TestFullResourcePath.java    | 1311 +++++-----
 .../olingo/server/core/uri/antlr/TestLexer.java |  450 ++--
 .../core/uri/antlr/TestUriParserImpl.java       |  220 +-
 .../server/core/uri/parser/ParserTest.java      |   56 +-
 .../core/uri/testutil/ExpandValidator.java      |   19 +-
 .../core/uri/testutil/FilterValidator.java      |   56 +-
 .../core/uri/testutil/TestUriValidator.java     |   38 +-
 .../core/uri/testutil/TokenValidator.java       |  127 -
 29 files changed, 1941 insertions(+), 4221 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
index ca6eb21..6865a65 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
@@ -35,11 +35,8 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.junit.Assert;
-import org.junit.Ignore;
 import org.junit.Test;
 
-// TODO
-@Ignore
 public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   private static final String ES_COMP_ALL_PRIM = "ESCompAllPrim";
@@ -212,7 +209,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
         sendRequest(ES_TWO_KEY_NAV, "PropertyComp/PropertyComp/PropertyBoolean eq not null");
     assertEquals(0, result.getBody().getEntities().size());
 
-    result = sendRequest(ES_TWO_KEY_NAV, "PropertyComp/PropertyComp/PropertyBoolean eq 0 add -(5 add null)");
+    result = sendRequest(ES_TWO_KEY_NAV, "PropertyComp/PropertyComp/PropertyInt16 eq 0 add -(5 add null)");
     assertEquals(0, result.getBody().getEntities().size());
   }
 
@@ -357,7 +354,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   @Test
   public void notOperator() {
-    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "not(PropertyInt16 eq 1)");
+    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "not (PropertyInt16 eq 1)");
     assertEquals(2, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
index 0e31b33..8e16a70 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
@@ -30,11 +30,8 @@ import org.apache.olingo.client.api.domain.ClientEntitySet;
 import org.apache.olingo.client.api.domain.ClientValuable;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.junit.Assert;
-import org.junit.Ignore;
 import org.junit.Test;
 
-// TODO
-@Ignore
 public class OrderBySystemQueryITCase extends AbstractParamTecSvcITCase {
 
   private static final String ES_TWO_PRIM = "ESTwoPrim";
@@ -74,7 +71,7 @@ public class OrderBySystemQueryITCase extends AbstractParamTecSvcITCase {
 
   @Test
   public void multipleOrderBy() {
-    final ODataRetrieveResponse<ClientEntitySet> response = sendRequest(ES_ALL_PRIM, "PropertyByte, PropertyInt16");
+    final ODataRetrieveResponse<ClientEntitySet> response = sendRequest(ES_ALL_PRIM, "PropertyByte,PropertyInt16");
     assertEquals(3, response.getBody().getEntities().size());
 
     ClientEntity clientEntity = response.getBody().getEntities().get(0);
@@ -90,7 +87,7 @@ public class OrderBySystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void multipleOrderByDescending() {
     final ODataRetrieveResponse<ClientEntitySet> response =
-        sendRequest(ES_ALL_PRIM, "PropertyByte, PropertyInt16 desc");
+        sendRequest(ES_ALL_PRIM, "PropertyByte,PropertyInt16 desc");
     assertEquals(3, response.getBody().getEntities().size());
 
     ClientEntity clientEntity = response.getBody().getEntities().get(0);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
index a16c137..fccf844 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
@@ -38,7 +38,6 @@ public interface ExpandItem {
   FilterOption getFilterOption();
 
   /**
-   * <b>CURRENTLY NOT SUPPORTED. WILL ALWAYS RETURN NULL</b>
    * @return Information of the option $search when used within $expand
    */
   SearchOption getSearchOption();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java
new file mode 100644
index 0000000..d8209d8
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java
@@ -0,0 +1,282 @@
+/*
+ * 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.core.uri.parser;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.api.ex.ODataRuntimeException;
+import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriResourceNavigation;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
+import org.apache.olingo.server.api.uri.queryoption.ExpandItem;
+import org.apache.olingo.server.api.uri.queryoption.ExpandOption;
+import org.apache.olingo.server.api.uri.queryoption.LevelsExpandOption;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.UriResourceComplexPropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourceCountImpl;
+import org.apache.olingo.server.core.uri.UriResourceNavigationPropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourceRefImpl;
+import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
+import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.ExpandItemImpl;
+import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.LevelsOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.TopOptionImpl;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
+
+public class ExpandParser {
+
+  private final Edm edm;
+  private final OData odata;
+
+  public ExpandParser(final Edm edm, final OData odata) {
+    this.edm = edm;
+    this.odata = odata;
+  }
+
+  public ExpandOption parse(UriTokenizer tokenizer, final EdmStructuredType referencedType)
+      throws UriParserException, UriValidationException {
+    ExpandOptionImpl expandOption = new ExpandOptionImpl();
+    do {
+      final ExpandItem item = parseItem(tokenizer, referencedType);
+      expandOption.addExpandItem(item);
+    } while (tokenizer.next(TokenKind.COMMA));
+
+    return expandOption;
+  }
+
+  private ExpandItem parseItem(UriTokenizer tokenizer, final EdmStructuredType referencedType)
+      throws UriParserException, UriValidationException {
+    ExpandItemImpl item = new ExpandItemImpl();
+    if (tokenizer.next(TokenKind.STAR)) {
+      item.setIsStar(true);
+      if (tokenizer.next(TokenKind.SLASH)) {
+        ParserHelper.requireNext(tokenizer, TokenKind.REF);
+        item.setIsRef(true);
+      } else if (tokenizer.next(TokenKind.OPEN)) {
+        ParserHelper.requireNext(tokenizer, TokenKind.LEVELS);
+        ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+        item.setSystemQueryOption((SystemQueryOption) parseLevels(tokenizer));
+        ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+      }
+
+    } else {
+      final EdmStructuredType typeCast = parseTypeCast(tokenizer, referencedType);
+      if (typeCast != null) {
+        item.setTypeFilter(typeCast);
+        ParserHelper.requireNext(tokenizer, TokenKind.SLASH);
+      }
+
+      UriInfoImpl resource = parseExpandPath(tokenizer, referencedType);
+
+      UriResourcePartTyped lastPart = (UriResourcePartTyped) resource.getLastResourcePart();
+
+      boolean hasSlash = false;
+      if (tokenizer.next(TokenKind.SLASH)) {
+        hasSlash = true;
+        if (lastPart instanceof UriResourceNavigation) {
+          UriResourceNavigationPropertyImpl navigationResource = (UriResourceNavigationPropertyImpl) lastPart;
+          final EdmNavigationProperty navigationProperty = navigationResource.getProperty();
+          final EdmStructuredType typeCastSuffix = parseTypeCast(tokenizer, navigationProperty.getType());
+          if (typeCastSuffix != null) {
+            if (navigationProperty.isCollection()) {
+              navigationResource.setCollectionTypeFilter(typeCastSuffix);
+            } else {
+              navigationResource.setEntryTypeFilter(typeCastSuffix);
+            }
+            hasSlash = false;
+          }
+        }
+      }
+
+      final EdmStructuredType newReferencedType = (EdmStructuredType) lastPart.getType();
+      final boolean newReferencedIsCollection = lastPart.isCollection();
+      if (hasSlash || tokenizer.next(TokenKind.SLASH)) {
+        if (tokenizer.next(TokenKind.REF)) {
+          resource.addResourcePart(new UriResourceRefImpl());
+          parseOptions(tokenizer, newReferencedType, newReferencedIsCollection, item, true, false);
+        } else {
+          ParserHelper.requireNext(tokenizer, TokenKind.COUNT);
+          resource.addResourcePart(new UriResourceCountImpl());
+          parseOptions(tokenizer, newReferencedType, newReferencedIsCollection, item, false, true);
+        }
+      } else {
+        parseOptions(tokenizer, newReferencedType, newReferencedIsCollection, item, false, false);
+      }
+
+      item.setResourcePath(resource);
+    }
+
+    return item;
+  }
+
+  private EdmStructuredType parseTypeCast(UriTokenizer tokenizer, final EdmStructuredType referencedType)
+      throws UriParserException {
+    if (tokenizer.next(TokenKind.QualifiedName)) {
+      final FullQualifiedName qualifiedName = new FullQualifiedName(tokenizer.getText());
+      final EdmStructuredType type = referencedType instanceof EdmEntityType ?
+          edm.getEntityType(qualifiedName) :
+          edm.getComplexType(qualifiedName);
+      if (type == null) {
+        throw new UriParserSemanticException("Type '" + qualifiedName + "' not found.",
+            UriParserSemanticException.MessageKeys.UNKNOWN_PART, qualifiedName.getFullQualifiedNameAsString());
+      } else {
+        if (!type.compatibleTo(referencedType)) {
+          throw new UriParserSemanticException("The type cast '" + qualifiedName + "' is not compatible.",
+              UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER, type.getName());
+        }
+      }
+      return type;
+    }
+    return null;
+  }
+
+  private UriInfoImpl parseExpandPath(UriTokenizer tokenizer, final EdmStructuredType referencedType)
+      throws UriParserException {
+    UriInfoImpl resource = new UriInfoImpl().setKind(UriInfoKind.resource);
+
+    EdmStructuredType type = referencedType;
+    String name = null;
+    while (tokenizer.next(TokenKind.ODataIdentifier)) {
+      name = tokenizer.getText();
+      final EdmProperty property = referencedType.getStructuralProperty(name);
+      if (property != null && property.getType().getKind() == EdmTypeKind.COMPLEX) {
+        type = (EdmStructuredType) property.getType();
+        UriResourceComplexPropertyImpl complexResource = new UriResourceComplexPropertyImpl(property);
+        ParserHelper.requireNext(tokenizer, TokenKind.SLASH);
+        final EdmStructuredType typeCast = parseTypeCast(tokenizer, type);
+        if (typeCast != null) {
+          complexResource.setTypeFilter(typeCast);
+          ParserHelper.requireNext(tokenizer, TokenKind.SLASH);
+          type = typeCast;
+        }
+        resource.addResourcePart(complexResource);
+      }
+    }
+
+    final EdmNavigationProperty navigationProperty = type.getNavigationProperty(name);
+    if (navigationProperty == null) {
+      // TODO: could also have been star after complex property (and maybe type cast)
+      throw new UriParserSemanticException(
+          "Navigation Property '" + name + "' not found in type '" + type.getFullQualifiedName() + "'.",
+          UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE, type.getName(), name);
+    } else {
+      resource.addResourcePart(new UriResourceNavigationPropertyImpl(navigationProperty));
+    }
+
+    return resource;
+  }
+
+  private void parseOptions(UriTokenizer tokenizer,
+      final EdmStructuredType referencedType, final boolean referencedIsCollection,
+      ExpandItemImpl item,
+      final boolean forRef, final boolean forCount) throws UriParserException, UriValidationException {
+    if (tokenizer.next(TokenKind.OPEN)) {
+      do {
+        SystemQueryOption systemQueryOption;
+        if (!forCount && tokenizer.next(TokenKind.COUNT)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          ParserHelper.requireNext(tokenizer, TokenKind.BooleanValue);
+          CountOptionImpl countOption = new CountOptionImpl();
+          countOption.setText(tokenizer.getText());
+          countOption.setValue(Boolean.parseBoolean(tokenizer.getText()));
+          systemQueryOption = countOption;
+
+        } else if (!forRef && !forCount && tokenizer.next(TokenKind.EXPAND)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          systemQueryOption = new ExpandParser(edm, odata).parse(tokenizer, referencedType);
+
+        } else if (tokenizer.next(TokenKind.FILTER)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          systemQueryOption = new FilterParser(edm, odata).parse(tokenizer, referencedType, null);
+
+        } else if (!forRef && !forCount && tokenizer.next(TokenKind.LEVELS)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          systemQueryOption = (SystemQueryOption) parseLevels(tokenizer);
+
+        } else if (!forCount && tokenizer.next(TokenKind.ORDERBY)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          systemQueryOption = new OrderByParser(edm, odata).parse(tokenizer, referencedType, null);
+
+        } else if (tokenizer.next(TokenKind.SEARCH)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          systemQueryOption = new SearchParser().parse(tokenizer);
+
+        } else if (!forRef && !forCount && tokenizer.next(TokenKind.SELECT)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          systemQueryOption = new SelectParser(edm).parse(tokenizer, referencedType, referencedIsCollection);
+
+        } else if (!forCount && tokenizer.next(TokenKind.SKIP)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          ParserHelper.requireNext(tokenizer, TokenKind.IntegerValue);
+          final int value = ParserHelper.parseNonNegativeInteger(SystemQueryOptionKind.SKIP.toString(),
+              tokenizer.getText(), true);
+          SkipOptionImpl skipOption = new SkipOptionImpl();
+          skipOption.setText(tokenizer.getText());
+          skipOption.setValue(value);
+          systemQueryOption = skipOption;
+
+        } else if (!forCount && tokenizer.next(TokenKind.TOP)) {
+          ParserHelper.requireNext(tokenizer, TokenKind.EQ);
+          ParserHelper.requireNext(tokenizer, TokenKind.IntegerValue);
+          final int value = ParserHelper.parseNonNegativeInteger(SystemQueryOptionKind.TOP.toString(),
+              tokenizer.getText(), true);
+          TopOptionImpl topOption = new TopOptionImpl();
+          topOption.setText(tokenizer.getText());
+          topOption.setValue(value);
+          systemQueryOption = topOption;
+
+        } else {
+          throw new UriParserSyntaxException("Allowed query option expected.",
+              UriParserSyntaxException.MessageKeys.SYNTAX);
+        }
+        try {
+          item.setSystemQueryOption(systemQueryOption);
+        } catch (final ODataRuntimeException e) {
+          throw new UriParserSyntaxException("Double system query option '" + systemQueryOption.getName() + "'.", e,
+              UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION, systemQueryOption.getName());
+        }
+      } while (tokenizer.next(TokenKind.SEMI));
+      ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+    }
+  }
+
+  private LevelsExpandOption parseLevels(UriTokenizer tokenizer) throws UriParserException {
+    final LevelsOptionImpl option = new LevelsOptionImpl();
+    if (tokenizer.next(TokenKind.MAX)) {
+      option.setText(tokenizer.getText());
+      option.setMax();
+    } else {
+      ParserHelper.requireNext(tokenizer, TokenKind.IntegerValue);
+      option.setText(tokenizer.getText());
+      option.setValue(
+          ParserHelper.parseNonNegativeInteger(SystemQueryOptionKind.LEVELS.toString(), tokenizer.getText(), false));
+    }
+    return option;
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
index 049880f..6fa415f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
@@ -47,9 +47,6 @@ import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.commons.core.edm.primitivetype.EdmByte;
-import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
-import org.apache.olingo.commons.core.edm.primitivetype.EdmSByte;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.UriParameter;
 import org.apache.olingo.server.api.uri.UriResourceFunction;
@@ -161,7 +158,7 @@ public class ExpressionParser {
 
   private static final Map<TokenKind, EdmPrimitiveTypeKind> tokenToPrimitiveType;
   static {
-    /* Enum and null are not present in the map. These have to be handled differently */
+    /* Enum and null are not present in the map. These have to be handled differently. */
     Map<TokenKind, EdmPrimitiveTypeKind> temp = new HashMap<TokenKind, EdmPrimitiveTypeKind>();
     temp.put(TokenKind.BooleanValue, EdmPrimitiveTypeKind.Boolean);
     temp.put(TokenKind.StringValue, EdmPrimitiveTypeKind.String);
@@ -242,9 +239,9 @@ public class ExpressionParser {
   }
 
   private Expression parseExprRel() throws UriParserException, UriValidationException {
-    if(tokenizer.next(TokenKind.IsofMethod)) {
-      // The isof method is a terminal. So no further operators are allowed
-      return parseIsOfMethod(TokenKind.IsofMethod);
+    if (tokenizer.next(TokenKind.IsofMethod)) {
+      // The isof method is a terminal.  So no further operators are allowed.
+      return parseIsOfOrCastMethod(MethodKind.ISOF);
     } else {
       Expression left = parseExprAdd();
       TokenKind operatorTokenKind = ParserHelper.next(tokenizer,
@@ -264,30 +261,25 @@ public class ExpressionParser {
     }
   }
 
-  private Expression parseIsOfMethod(final TokenKind lastToken) throws UriParserException, UriValidationException {
-    if(lastToken == TokenKind.IsofMethod) {
-      // The TokenKind 'IsOfMethod' consumes also the opening parenthesis 
-
-      // The first parameter could be an expression or a type literal
-      final List<Expression> parameters = new ArrayList<Expression>();
+  private Expression parseIsOfOrCastMethod(final MethodKind kind) throws UriParserException, UriValidationException {
+    // The TokenKind 'IsOfMethod' consumes also the opening parenthesis.
+    // The first parameter could be an expression or a type literal.
+    List<Expression> parameters = new ArrayList<Expression>();
+    parameters.add(parseExpression());
+    if (!(parameters.get(0) instanceof TypeLiteral)) {
+      // The first parameter is not a type literal, so there must be a second parameter.
+      ParserHelper.requireNext(tokenizer, TokenKind.COMMA);
       parameters.add(parseExpression());
-      if(!(parameters.get(0) instanceof TypeLiteral)) {
-        // The first parameter is not a type literal, so there must be a second parameter
-        ParserHelper.requireNext(tokenizer, TokenKind.COMMA);
-        parameters.add(parseExpression());
-        
-        // The second parameter must be a type literal
-        if(!(parameters.get(1) instanceof TypeLiteral)) {
-          throw new UriParserSemanticException("Type literal extected", 
-              UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER);
-        }
+
+      // The second parameter must be a type literal.
+      if (!(parameters.get(1) instanceof TypeLiteral)) {
+        throw new UriParserSemanticException("Type literal expected.",
+            UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER);
       }
-      
-      ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
-      return new MethodImpl(MethodKind.ISOF, parameters);
-    } else {
-      throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
     }
+
+    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+    return new MethodImpl(kind, parameters);
   }
 
   private Expression parseExprAdd() throws UriParserException, UriValidationException {
@@ -296,9 +288,9 @@ public class ExpressionParser {
     // Null for everything other than ADD or SUB
     while (operatorTokenKind != null) {
       final Expression right = parseExprMul();
-      checkAddSubTypes(left, right, operatorTokenKind == TokenKind.AddOperator);
-      left = new BinaryImpl(left, tokenToBinaryOperator.get(operatorTokenKind), right,
-          odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double));
+      final EdmType resultType = getAddSubTypeAndCheckLeftAndRight(left, right,
+          operatorTokenKind == TokenKind.SubOperator);
+      left = new BinaryImpl(left, tokenToBinaryOperator.get(operatorTokenKind), right, resultType);
       operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.AddOperator, TokenKind.SubOperator);
     }
     return left;
@@ -328,10 +320,7 @@ public class ExpressionParser {
   }
 
   private Expression parseExprUnary() throws UriParserException, UriValidationException {
-    final TokenKind operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.MINUS, TokenKind.NotOperator, 
-                                                                     TokenKind.CastMethod);
-    
-    if(operatorTokenKind == TokenKind.MINUS) {
+    if (tokenizer.next(TokenKind.MinusOperator)) {
       final Expression expression = parseExprPrimary();
       checkType(expression,
           EdmPrimitiveTypeKind.Int16, EdmPrimitiveTypeKind.Int32, EdmPrimitiveTypeKind.Int64,
@@ -339,37 +328,14 @@ public class ExpressionParser {
           EdmPrimitiveTypeKind.Decimal, EdmPrimitiveTypeKind.Single, EdmPrimitiveTypeKind.Double,
           EdmPrimitiveTypeKind.Duration);
       return new UnaryImpl(UnaryOperatorKind.MINUS, expression, getType(expression));
-    } else if(operatorTokenKind == TokenKind.NotOperator) {
+    } else if (tokenizer.next(TokenKind.NotOperator)) {
       final Expression expression = parseExprPrimary();
       checkType(expression, EdmPrimitiveTypeKind.Boolean);
       return new UnaryImpl(UnaryOperatorKind.NOT, expression, getType(expression));
-    } else if(operatorTokenKind == TokenKind.CastMethod) {
-      return parseCastMethod(operatorTokenKind);
+    } else if (tokenizer.next(TokenKind.CastMethod)) {
+      return parseIsOfOrCastMethod(MethodKind.CAST);
     } else {
-      final Expression expression = parseExprPrimary();
-      return expression;
-    }
-  }
-
-  private Expression parseCastMethod(final TokenKind lastToken) throws UriParserException, UriValidationException {
-    // The TokenKind 'CastMethod' consumes also the opening parenthesis 
-    if(lastToken == TokenKind.CastMethod) {
-      final List<Expression> parameters = new ArrayList<Expression>();
-      parameters.add(parseExpression());
-      
-      if(!(parameters.get(0) instanceof TypeLiteral)) {
-        ParserHelper.requireNext(tokenizer, TokenKind.COMMA);
-        parameters.add(parseExpression());
-        if(!(parameters.get(1) instanceof TypeLiteral)) {
-          throw new UriParserSemanticException("Type literal extected", 
-              UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER);
-        }
-      }
-      
-      ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
-      return new MethodImpl(MethodKind.CAST, parameters);
-    } else {
-      throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
+      return parseExprPrimary();
     }
   }
 
@@ -433,22 +399,20 @@ public class ExpressionParser {
   private Expression parseMethod(final TokenKind nextMethod) throws UriParserException, UriValidationException {
     // The method token text includes the opening parenthesis so that method calls can be recognized unambiguously.
     // OData identifiers have to be considered after that.
-    
     final MethodKind methodKind = tokenToMethod.get(nextMethod);
     return new MethodImpl(methodKind, parseMethodParameters(methodKind));
   }
 
-  private Expression parsePrimitive(TokenKind nextPrimitive) throws UriParserException {
+  private Expression parsePrimitive(final TokenKind primitiveTokenKind) throws UriParserException {
     final String primitiveValueLiteral = tokenizer.getText();
-    if (nextPrimitive == TokenKind.EnumValue) {
+    if (primitiveTokenKind == TokenKind.EnumValue) {
       return createEnumExpression(primitiveValueLiteral);
     } else {
-      EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(nextPrimitive);
-      
-      if(primitiveTypeKind == EdmPrimitiveTypeKind.Int64) {
+      EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(primitiveTokenKind);
+      if (primitiveTypeKind == EdmPrimitiveTypeKind.Int64) {
         primitiveTypeKind = determineIntegerType(primitiveValueLiteral);
       }
-      
+
       final EdmPrimitiveType type = primitiveTypeKind == null ?
           // Null handling
           null :
@@ -472,12 +436,11 @@ public class ExpressionParser {
       } else {
         typeKind = EdmPrimitiveTypeKind.Int64;
       }
-    } catch (NumberFormatException e) {
-      // This should never happen. Because the tokenizer has figured out that the literal is an integer
-      throw new UriParserSyntaxException(intValueAsString + " is not an integer", 
+    } catch (final NumberFormatException e) {
+      // This should never happen because the tokenizer has figured out that the literal is an integer.
+      throw new UriParserSyntaxException("'" + intValueAsString + "' is not an integer.", e,
           UriParserSyntaxException.MessageKeys.SYNTAX);
     }
-
     return typeKind;
   }
 
@@ -622,19 +585,19 @@ public class ExpressionParser {
       if (filterType == null) {
         filterType = edm.getComplexType(fullQualifiedName);
       }
-      
-      if(filterType == null) {
-        filterType = getEdmType(fullQualifiedName);
+
+      if (filterType == null) {
+        filterType = getPrimitiveType(fullQualifiedName);
       }
-      
-      if(filterType == null) {
+
+      if (filterType == null) {
         filterType = edm.getEnumType(fullQualifiedName);
       }
-      
-      if(filterType == null) {
+
+      if (filterType == null) {
         filterType = edm.getTypeDefinition(fullQualifiedName);
       }
-      
+
       if (filterType != null) {
         if (tokenizer.next(TokenKind.SLASH)) {
           // Leading type cast
@@ -642,30 +605,29 @@ public class ExpressionParser {
           startTypeFilter = filterType;
 
           final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
-          parseMemberExpression(tokenKind, uriInfo, new UriResourceStartingTypeFilterImpl(filterType, false), 
-              false);
+          parseMemberExpression(tokenKind, uriInfo, new UriResourceStartingTypeFilterImpl(filterType, false), false);
         } else {
           // Type literal
           return new TypeLiteralImpl(filterType);
         }
       } else {
-        // Must be bound or unbound function. 
+        // Must be bound or unbound function.
         parseFunction(fullQualifiedName, uriInfo, referringType, true);
       }
     } else if (lastTokenKind == TokenKind.ODataIdentifier) {
       parseFirstMemberODataIdentifier(uriInfo);
     }
-    
+
     return new MemberImpl(uriInfo, startTypeFilter);
   }
 
-  private EdmType getEdmType(final FullQualifiedName fullQualifiedName) {
-    if(!fullQualifiedName.getNamespace().equals(EdmPrimitiveType.EDM_NAMESPACE)) {
+  private EdmType getPrimitiveType(final FullQualifiedName fullQualifiedName) {
+    if (EdmPrimitiveType.EDM_NAMESPACE.equals(fullQualifiedName.getNamespace())) {
+      final EdmPrimitiveTypeKind primitiveTypeKind = EdmPrimitiveTypeKind.valueOf(fullQualifiedName.getName());
+      return primitiveTypeKind == null ? null : odata.createPrimitiveTypeInstance(primitiveTypeKind);
+    } else {
       return null;
     }
-    
-    final EdmPrimitiveTypeKind primitiveTypeKind = EdmPrimitiveTypeKind.valueOfFQN(fullQualifiedName);
-    return primitiveTypeKind == null ? null : EdmPrimitiveTypeFactory.getInstance(primitiveTypeKind);
   }
 
   private void parseDollarRoot(UriInfoImpl uriInfo) throws UriParserException, UriValidationException {
@@ -694,7 +656,7 @@ public class ExpressionParser {
     parseSingleNavigationExpr(uriInfo, resource);
   }
 
-  private void parseDollarIt(UriInfoImpl uriInfo, EdmType referringType) 
+  private void parseDollarIt(UriInfoImpl uriInfo, final EdmType referringType)
       throws UriParserException, UriValidationException {
     UriResourceItImpl itResource = new UriResourceItImpl(referringType, false);
     uriInfo.addResourcePart(itResource);
@@ -759,16 +721,14 @@ public class ExpressionParser {
       if (edmEntityType != null) {
         if (allowTypeFilter) {
           setTypeFilter(lastResource, edmEntityType);
-          
-          if(tokenizer.next(TokenKind.SLASH)) {
-            final TokenKind nextTokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, 
-                                                                         TokenKind.ODataIdentifier);
-            if(nextTokenKind == TokenKind.ODataIdentifier) {
-              parsePropertyPathExpr(uriInfo, lastResource);
-            } else if(nextTokenKind == TokenKind.QualifiedName) {
+
+          if (tokenizer.next(TokenKind.SLASH)) {
+            if (tokenizer.next(TokenKind.QualifiedName)) {
               parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
+            } else if (tokenizer.next(TokenKind.ODataIdentifier)) {
+              parsePropertyPathExpr(uriInfo, lastResource);
             } else {
-              throw new UriParserSyntaxException("Extected OData Identifier or Full Qualified Name", 
+              throw new UriParserSyntaxException("Expected OData Identifier or Full Qualified Name.",
                   UriParserSyntaxException.MessageKeys.SYNTAX);
             }
           }
@@ -814,7 +774,9 @@ public class ExpressionParser {
 
     if (property == null) {
       throw new UriParserSemanticException("Unknown property.",
-          UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE, oDataIdentifier);
+          UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE,
+          lastType.getFullQualifiedName().getFullQualifiedNameAsString(),
+          oDataIdentifier);
     }
 
     if (property.getType() instanceof EdmComplexType) {
@@ -823,7 +785,9 @@ public class ExpressionParser {
       uriInfo.addResourcePart(complexResource);
 
       if (property.isCollection()) {
-        parseCollectionPathExpr(uriInfo, complexResource);
+        if (tokenizer.next(TokenKind.SLASH)) {
+          parseCollectionPathExpr(uriInfo, complexResource);
+        }
       } else {
         parseComplexPathExpr(uriInfo, complexResource);
       }
@@ -847,7 +811,9 @@ public class ExpressionParser {
       uriInfo.addResourcePart(primitiveResource);
 
       if (property.isCollection()) {
-        parseCollectionPathExpr(uriInfo, primitiveResource);
+        if (tokenizer.next(TokenKind.SLASH)) {
+          parseCollectionPathExpr(uriInfo, primitiveResource);
+        }
       } else {
         parseSinglePathExpr(uriInfo, primitiveResource);
       }
@@ -856,7 +822,6 @@ public class ExpressionParser {
 
   private void parseSingleNavigationExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
       throws UriParserException, UriValidationException {
-    // TODO: Is that correct?
     if (tokenizer.next(TokenKind.SLASH)) {
       final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
       parseMemberExpression(tokenKind, uriInfo, lastResource, true);
@@ -865,8 +830,22 @@ public class ExpressionParser {
 
   private void parseCollectionNavigationExpr(UriInfoImpl uriInfo, UriResourcePartTyped lastResource)
       throws UriParserException, UriValidationException {
-    // TODO: Is type cast missing?
-    if (tokenizer.next(TokenKind.OPEN)) {
+    boolean hasSlash = false;
+    if (tokenizer.next(TokenKind.SLASH)) {
+      hasSlash = true;
+      if (tokenizer.next(TokenKind.QualifiedName)) {
+        final FullQualifiedName qualifiedName = new FullQualifiedName(tokenizer.getText());
+        final EdmEntityType edmEntityType = edm.getEntityType(qualifiedName);
+        if (edmEntityType == null) {
+          parseBoundFunction(qualifiedName, uriInfo, lastResource);
+        } else {
+          setTypeFilter(lastResource, edmEntityType);
+        }
+        hasSlash = false;
+      }
+    }
+
+    if (!hasSlash && tokenizer.next(TokenKind.OPEN)) {
       if (lastResource instanceof UriResourceNavigation) {
         ((UriResourceNavigationPropertyImpl) lastResource).setKeyPredicates(
               ParserHelper.parseNavigationKeyPredicate(tokenizer,
@@ -883,7 +862,10 @@ public class ExpressionParser {
       }
       parseSingleNavigationExpr(uriInfo, lastResource);
     }
-    parseCollectionPathExpr(uriInfo, lastResource);
+
+    if (hasSlash || tokenizer.next(TokenKind.SLASH)) {
+      parseCollectionPathExpr(uriInfo, lastResource);
+    }
   }
 
   private void parseSinglePathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
@@ -932,25 +914,23 @@ public class ExpressionParser {
 
   private void parseCollectionPathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
       throws UriParserException, UriValidationException {
-
-    if (tokenizer.next(TokenKind.SLASH)) {
-      if (tokenizer.next(TokenKind.COUNT)) {
-        uriInfo.addResourcePart(new UriResourceCountImpl());
-      } else if (tokenizer.next(TokenKind.ANY)) {
-        uriInfo.addResourcePart(parseLambdaRest(TokenKind.ANY, lastResource));
-      } else if (tokenizer.next(TokenKind.ALL)) {
-        uriInfo.addResourcePart(parseLambdaRest(TokenKind.ALL, lastResource));
-      } else if (tokenizer.next(TokenKind.QualifiedName)) {
-        final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
-        parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
-      }
+    // The initial slash (see grammar) must have been checked and consumed by the caller.
+    if (tokenizer.next(TokenKind.COUNT)) {
+      uriInfo.addResourcePart(new UriResourceCountImpl());
+    } else if (tokenizer.next(TokenKind.ANY)) {
+      uriInfo.addResourcePart(parseLambdaRest(TokenKind.ANY, lastResource));
+    } else if (tokenizer.next(TokenKind.ALL)) {
+      uriInfo.addResourcePart(parseLambdaRest(TokenKind.ALL, lastResource));
+    } else if (tokenizer.next(TokenKind.QualifiedName)) {
+      final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
+      parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
     }
   }
 
   private void parseFunction(final FullQualifiedName fullQualifiedName, UriInfoImpl uriInfo,
       final EdmType lastType, final boolean lastIsCollection) throws UriParserException, UriValidationException {
 
-    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, true);
+    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, edm, referringType, true);
     final List<String> parameterNames = ParserHelper.getParameterNames(parameters);
     final EdmFunction boundFunction = edm.getBoundFunction(fullQualifiedName,
         lastType.getFullQualifiedName(), lastIsCollection, parameterNames);
@@ -966,18 +946,19 @@ public class ExpressionParser {
       return;
     }
 
-    throw new UriParserSemanticException("No function found.",
+    throw new UriParserSemanticException("No function '" + fullQualifiedName + "' found.",
         UriParserSemanticException.MessageKeys.FUNCTION_NOT_FOUND, fullQualifiedName.getFullQualifiedNameAsString());
   }
 
   private void parseBoundFunction(final FullQualifiedName fullQualifiedName, UriInfoImpl uriInfo,
       final UriResourcePartTyped lastResource) throws UriParserException, UriValidationException {
-    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, true);
+    final EdmType type = lastResource.getType();
+    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, edm, referringType, true);
     final List<String> parameterNames = ParserHelper.getParameterNames(parameters);
     final EdmFunction boundFunction = edm.getBoundFunction(fullQualifiedName,
-        lastResource.getType().getFullQualifiedName(), lastResource.isCollection(), parameterNames);
+        type.getFullQualifiedName(), lastResource.isCollection(), parameterNames);
     if (boundFunction == null) {
-      throw new UriParserSemanticException("Bound function not found.",
+      throw new UriParserSemanticException("Bound function '" + fullQualifiedName + "' not found.",
           UriParserSemanticException.MessageKeys.FUNCTION_NOT_FOUND, fullQualifiedName.getFullQualifiedNameAsString());
     }
     parseFunctionRest(uriInfo, boundFunction, parameters);
@@ -995,19 +976,23 @@ public class ExpressionParser {
     if (function.isComposable()) {
       if (edmType instanceof EdmEntityType ) {
         if (isCollection) {
-          parseCollectionNavigationExpr(uriInfo, functionResource); 
+          parseCollectionNavigationExpr(uriInfo, functionResource);
         } else {
           parseSingleNavigationExpr(uriInfo, functionResource);
         }
       } else if (edmType instanceof EdmComplexType) {
         if (isCollection) {
-          parseCollectionPathExpr(uriInfo, functionResource);
+          if (tokenizer.next(TokenKind.SLASH)) {
+            parseCollectionPathExpr(uriInfo, functionResource);
+          }
         } else {
           parseComplexPathExpr(uriInfo, functionResource);
         }
       } else if (edmType instanceof EdmPrimitiveType) {
         if (isCollection) {
-          parseCollectionPathExpr(uriInfo, functionResource);
+          if (tokenizer.next(TokenKind.SLASH)) {
+            parseCollectionPathExpr(uriInfo, functionResource);
+          }
         } else {
           parseSinglePathExpr(uriInfo, functionResource);
         }
@@ -1077,7 +1062,7 @@ public class ExpressionParser {
         TokenKind.YearMethod);
   }
 
-  private EdmType getType(final Expression expression) throws UriParserException {
+  protected static EdmType getType(final Expression expression) throws UriParserException {
     EdmType type;
     if (expression instanceof Literal) {
       type = ((Literal) expression).getType();
@@ -1108,13 +1093,12 @@ public class ExpressionParser {
     return type;
   }
 
-  private boolean isType(final Expression expression, final EdmPrimitiveTypeKind... kinds) throws UriParserException {
-    final EdmType expressionType = getType(expression);
-    if (expressionType == null) {
+  private boolean isType(final EdmType type, final EdmPrimitiveTypeKind... kinds) throws UriParserException {
+    if (type == null) {
       return true;
     }
     for (final EdmPrimitiveTypeKind kind : kinds) {
-      if (expressionType.equals(odata.createPrimitiveTypeInstance(kind))) {
+      if (type.equals(odata.createPrimitiveTypeInstance(kind))) {
         return true;
       }
     }
@@ -1122,12 +1106,13 @@ public class ExpressionParser {
   }
 
   private void checkType(final Expression expression, final EdmPrimitiveTypeKind... kinds) throws UriParserException {
-    if (!isType(expression, kinds)) {
+    final EdmType type = getType(expression);
+    if (!isType(type, kinds)) {
       throw new UriParserSemanticException("Incompatible type.",
           UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, // TODO: better message
-          getType(expression) == null ?
+          type == null ?
               "" :
-              getType(expression).getFullQualifiedName().getFullQualifiedNameAsString());
+              type.getFullQualifiedName().getFullQualifiedNameAsString());
     }
   }
 
@@ -1137,21 +1122,21 @@ public class ExpressionParser {
     if (leftType == null || rightType == null || leftType.equals(rightType)) {
       return;
     }
-    
+
     // Numeric promotion for Edm.Byte and Edm.SByte
-    if((leftType instanceof EdmByte || leftType instanceof EdmSByte) 
-        && (rightType instanceof EdmByte || rightType instanceof EdmSByte)) {
+    if (isType(leftType, EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte)
+        && isType(rightType, EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte)) {
       return;
     }
-    
+
     if (leftType.getKind() != EdmTypeKind.PRIMITIVE
         || rightType.getKind() != EdmTypeKind.PRIMITIVE
         || !(((EdmPrimitiveType) leftType).isCompatible((EdmPrimitiveType) rightType)
-        || ((EdmPrimitiveType) rightType).isCompatible((EdmPrimitiveType) leftType)))
-        {
+        || ((EdmPrimitiveType) rightType).isCompatible((EdmPrimitiveType) leftType))) {
       throw new UriParserSemanticException("Incompatible types.",
-          UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE, leftType.getFullQualifiedName().toString(), 
-                                                                       rightType.getFullQualifiedName().toString());
+          UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE,
+          leftType.getFullQualifiedName().getFullQualifiedNameAsString(),
+          rightType.getFullQualifiedName().getFullQualifiedNameAsString());
     }
   }
 
@@ -1164,12 +1149,12 @@ public class ExpressionParser {
     }
     return type;
   }
-  
+
   private boolean isEnumType(final Expression expression) throws UriParserException {
     final EdmType expressionType = getType(expression);
     return expressionType == null
         || expressionType.getKind() == EdmTypeKind.ENUM
-        || isType(expression,
+        || isType(expressionType,
             EdmPrimitiveTypeKind.Int16, EdmPrimitiveTypeKind.Int32, EdmPrimitiveTypeKind.Int64,
             EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte);
   }
@@ -1208,44 +1193,69 @@ public class ExpressionParser {
         EdmPrimitiveTypeKind.Date, EdmPrimitiveTypeKind.TimeOfDay,
         EdmPrimitiveTypeKind.DateTimeOffset, EdmPrimitiveTypeKind.Duration);
     if (!(((EdmPrimitiveType) leftType).isCompatible((EdmPrimitiveType) rightType)
-    || ((EdmPrimitiveType) rightType).isCompatible((EdmPrimitiveType) leftType))) {
+        || ((EdmPrimitiveType) rightType).isCompatible((EdmPrimitiveType) leftType))) {
       throw new UriParserSemanticException("Incompatible types.",
-          UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, ""); // TODO: better message
+          UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE,
+          leftType.getFullQualifiedName().getFullQualifiedNameAsString(),
+          rightType.getFullQualifiedName().getFullQualifiedNameAsString());
     }
   }
 
-  private void checkAddSubTypes(final Expression left, final Expression right, final boolean isAdd)
+  private EdmType getAddSubTypeAndCheckLeftAndRight(final Expression left, final Expression right, final boolean isSub)
       throws UriParserException {
     final EdmType leftType = getType(left);
     final EdmType rightType = getType(right);
-    if (leftType == null || rightType == null
-        || isType(left,
+    if (leftType == null || rightType == null) {
+      return null;
+    }
+    if (isType(leftType,
             EdmPrimitiveTypeKind.Int16, EdmPrimitiveTypeKind.Int32, EdmPrimitiveTypeKind.Int64,
             EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte,
             EdmPrimitiveTypeKind.Decimal, EdmPrimitiveTypeKind.Single, EdmPrimitiveTypeKind.Double)
-        && isType(right,
+        && isType(rightType,
             EdmPrimitiveTypeKind.Int16, EdmPrimitiveTypeKind.Int32, EdmPrimitiveTypeKind.Int64,
             EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte,
             EdmPrimitiveTypeKind.Decimal, EdmPrimitiveTypeKind.Single, EdmPrimitiveTypeKind.Double)) {
-      return;
+      // The result type must be able to handle the overflow,
+      // so we return always a wider type than the types of the operands.
+      if (isType(leftType, EdmPrimitiveTypeKind.Decimal, EdmPrimitiveTypeKind.Single, EdmPrimitiveTypeKind.Double)
+          || isType(rightType,
+              EdmPrimitiveTypeKind.Decimal, EdmPrimitiveTypeKind.Single, EdmPrimitiveTypeKind.Double)) {
+        return odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double);
+      } else if (isType(leftType, EdmPrimitiveTypeKind.Int64) || isType(rightType, EdmPrimitiveTypeKind.Int64)) {
+        return odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal);
+      } else if (isType(leftType, EdmPrimitiveTypeKind.Int32) || isType(rightType, EdmPrimitiveTypeKind.Int32)) {
+        return odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int64);
+      } else if (isType(leftType, EdmPrimitiveTypeKind.Int16) || isType(rightType, EdmPrimitiveTypeKind.Int16)) {
+        return odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int32);
+      } else {
+        return odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int16);
+      }
     }
-    if (isType(left, EdmPrimitiveTypeKind.DateTimeOffset)
-        && (isType(right, EdmPrimitiveTypeKind.Duration)
-        || isType(right, EdmPrimitiveTypeKind.DateTimeOffset) && !isAdd)) {
-      return;
+    if ((isType(leftType, EdmPrimitiveTypeKind.DateTimeOffset)
+        || isType(leftType, EdmPrimitiveTypeKind.Duration))
+        && isType(rightType, EdmPrimitiveTypeKind.Duration)) {
+      return leftType;
     }
-    if (isType(left, EdmPrimitiveTypeKind.Duration) && isType(right, EdmPrimitiveTypeKind.Duration)
-        || isType(left, EdmPrimitiveTypeKind.Date)
-        && (isType(right, EdmPrimitiveTypeKind.Duration) || isType(right, EdmPrimitiveTypeKind.Date) && !isAdd)) {
-      return;
+    if (isType(leftType, EdmPrimitiveTypeKind.Date) && isType(rightType, EdmPrimitiveTypeKind.Duration)) {
+      return odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.DateTimeOffset);
+    }
+    if (isSub
+        && (isType(leftType, EdmPrimitiveTypeKind.DateTimeOffset)
+            && isType(rightType, EdmPrimitiveTypeKind.DateTimeOffset)
+            || isType(leftType, EdmPrimitiveTypeKind.Date)
+            && isType(rightType, EdmPrimitiveTypeKind.Date))) {
+      return odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Duration);
     }
     throw new UriParserSemanticException("Incompatible types.",
-        UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, ""); // TODO: better message
+        UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE,
+        leftType.getFullQualifiedName().getFullQualifiedNameAsString(),
+        rightType.getFullQualifiedName().getFullQualifiedNameAsString());
   }
 
   private void checkStructuredTypeFilter(final EdmType type, final EdmType filterType)
       throws UriParserException {
-    if (!(filterType instanceof EdmStructuredType && ((EdmStructuredType)filterType).compatibleTo(type))) {
+    if (!(filterType instanceof EdmStructuredType && ((EdmStructuredType) filterType).compatibleTo(type))) {
       throw new UriParserSemanticException("Incompatible type filter.",
           UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER,
           filterType.getFullQualifiedName().getFullQualifiedNameAsString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
index e2767a1..dd73009 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
@@ -21,6 +21,7 @@ package org.apache.olingo.server.core.uri.parser;
 import java.util.Collection;
 
 import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.queryoption.FilterOption;
@@ -43,7 +44,13 @@ public class FilterParser {
       throws UriParserException, UriValidationException {
     final Expression filterExpression = new ExpressionParser(edm, odata)
         .parse(tokenizer, referencedType, crossjoinEntitySetNames);
-    // TODO: Check that the expression is boolean.
-    return new FilterOptionImpl().setExpression(filterExpression);
+    final EdmType type = ExpressionParser.getType(filterExpression);
+    if (type == null || type.equals(odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean))) {
+      return new FilterOptionImpl().setExpression(filterExpression);
+    } else {
+      throw new UriParserSemanticException("Filter expressions must be boolean.",
+          UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE,
+          "Edm.Boolean", type.getFullQualifiedName().getFullQualifiedNameAsString());
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
index 47efda5..3125fa6 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
@@ -18,18 +18,11 @@
  */
 package org.apache.olingo.server.core.uri.parser;
 
+import java.util.ArrayDeque;
+import java.util.Deque;
 import java.util.List;
 
-import org.antlr.v4.runtime.ANTLRInputStream;
-import org.antlr.v4.runtime.BailErrorStrategy;
-import org.antlr.v4.runtime.CommonTokenStream;
-import org.antlr.v4.runtime.Lexer;
-import org.antlr.v4.runtime.ParserRuleContext;
-import org.antlr.v4.runtime.RecognitionException;
-import org.antlr.v4.runtime.atn.PredictionMode;
-import org.antlr.v4.runtime.misc.ParseCancellationException;
 import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntityContainer;
 import org.apache.olingo.commons.api.edm.EdmEntitySet;
 import org.apache.olingo.commons.api.edm.EdmStructuredType;
 import org.apache.olingo.commons.api.edm.EdmType;
@@ -52,14 +45,10 @@ import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
 import org.apache.olingo.server.core.uri.UriInfoImpl;
 import org.apache.olingo.server.core.uri.UriResourceStartingTypeFilterImpl;
-import org.apache.olingo.server.core.uri.antlr.UriLexer;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemsEOFContext;
 import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
 import org.apache.olingo.server.core.uri.parser.search.SearchParser;
 import org.apache.olingo.server.core.uri.queryoption.AliasQueryOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.FormatOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.IdOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl;
@@ -77,8 +66,6 @@ public class Parser {
   private final Edm edm;
   private final OData odata;
 
-  private enum ParserEntryRules { ExpandItems }
-
   public Parser(final Edm edm, final OData odata) {
     this.edm = edm;
     this.odata = odata;
@@ -87,8 +74,9 @@ public class Parser {
   public UriInfo parseUri(final String path, final String query, final String fragment)
       throws UriParserException, UriValidationException {
 
-    UriContext context = new UriContext();
-    UriParseTreeVisitor uriParseTreeVisitor = new UriParseTreeVisitor(edm, context);
+    UriInfoImpl contextUriInfo = new UriInfoImpl();
+    Deque<EdmType> contextTypes = new ArrayDeque<EdmType>();
+    boolean contextIsCollection = false;
 
     final List<String> pathSegmentsDecoded = UriDecoder.splitAndDecodePath(path);
     final int numberOfSegments = pathSegmentsDecoded.size();
@@ -98,49 +86,46 @@ public class Parser {
 
     if (firstSegment.isEmpty()) {
       ensureLastSegment(firstSegment, 0, numberOfSegments);
-      context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.service);
+      contextUriInfo.setKind(UriInfoKind.service);
 
     } else if (firstSegment.equals("$batch")) {
       ensureLastSegment(firstSegment, 1, numberOfSegments);
-      context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.batch);
+      contextUriInfo.setKind(UriInfoKind.batch);
 
     } else if (firstSegment.equals("$metadata")) {
       ensureLastSegment(firstSegment, 1, numberOfSegments);
-      context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.metadata);
-      context.contextUriInfo.setFragment(fragment);
+      contextUriInfo.setKind(UriInfoKind.metadata);
+      contextUriInfo.setFragment(fragment);
 
     } else if (firstSegment.equals("$all")) {
       ensureLastSegment(firstSegment, 1, numberOfSegments);
-      context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.all);
+      contextUriInfo.setKind(UriInfoKind.all);
       // This loads nearly the whole schema, but sooner or later '$all' needs all entity sets anyway.
       for (final EdmEntitySet entitySet : edm.getEntityContainer().getEntitySets()) {
-        context.contextTypes.push(entitySet.getEntityType());
+        contextTypes.push(entitySet.getEntityType());
       }
-      context.isCollection = true;
+      contextIsCollection = true;
 
     } else if (firstSegment.equals("$entity")) {
       if (numberOfSegments > 1) {
         final String typeCastSegment = pathSegmentsDecoded.get(1);
         ensureLastSegment(typeCastSegment, 2, numberOfSegments);
-        context.contextUriInfo = new ResourcePathParser(edm).parseDollarEntityTypeCast(typeCastSegment);
-        context.contextTypes.push(context.contextUriInfo.getEntityTypeCast());
+        contextUriInfo = new ResourcePathParser(edm).parseDollarEntityTypeCast(typeCastSegment);
+        contextTypes.push(contextUriInfo.getEntityTypeCast());
       } else {
-        context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.entityId);
+        contextUriInfo.setKind(UriInfoKind.entityId);
         // The type of the entity is not known until the $id query option has been parsed.
+        // TODO: Set the type (needed for the evaluation of system query options).
       }
-      context.isCollection = false;
+      contextIsCollection = false;
 
     } else if (firstSegment.startsWith("$crossjoin")) {
       ensureLastSegment(firstSegment, 1, numberOfSegments);
-      context.contextUriInfo = new ResourcePathParser(edm).parseCrossjoinSegment(firstSegment);
-      final EdmEntityContainer container = edm.getEntityContainer();
-      for (final String name : context.contextUriInfo.getEntitySetNames()) {
-        context.contextTypes.push(container.getEntitySet(name).getEntityType());
-      }
-      context.isCollection = true;
+      contextUriInfo = new ResourcePathParser(edm).parseCrossjoinSegment(firstSegment);
+      contextIsCollection = true;
 
     } else {
-      context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.resource);
+      contextUriInfo.setKind(UriInfoKind.resource);
       final ResourcePathParser resourcePathParser = new ResourcePathParser(edm);
       int count = 0;
       UriResource lastSegment = null;
@@ -168,7 +153,7 @@ public class Parser {
           } else {
             lastSegment = segment;
           }
-          context.contextUriInfo.addResourcePart(segment);
+          contextUriInfo.addResourcePart(segment);
         }
       }
 
@@ -176,9 +161,9 @@ public class Parser {
         final UriResourcePartTyped typed = (UriResourcePartTyped) lastSegment;
         final EdmType type = ParserHelper.getTypeInformation(typed);
         if (type != null) { // could be null for, e.g., actions without return type
-          context.contextTypes.push(type);
+          contextTypes.push(type);
         }
-        context.isCollection = typed.isCollection();
+        contextIsCollection = typed.isCollection();
       }
     }
 
@@ -191,9 +176,10 @@ public class Parser {
         SystemQueryOption systemOption = null;
         if (optionName.equals(SystemQueryOptionKind.FILTER.toString())) {
           UriTokenizer filterTokenizer = new UriTokenizer(optionValue);
-          // The Referring type could also be a primitive type not only a structured type
-          systemOption = new FilterParser(edm, odata).parse(filterTokenizer, context.contextTypes.peek(),
-                  context.contextUriInfo.getEntitySetNames());
+          // The referring type could be a primitive type or a structured type.
+          systemOption = new FilterParser(edm, odata).parse(filterTokenizer,
+              contextTypes.peek(),
+              contextUriInfo.getEntitySetNames());
           checkOptionEOF(filterTokenizer, optionName, optionValue);
 
         } else if (optionName.equals(SystemQueryOptionKind.FORMAT.toString())) {
@@ -211,19 +197,26 @@ public class Parser {
           systemOption = formatOption;
 
         } else if (optionName.equals(SystemQueryOptionKind.EXPAND.toString())) {
-          try {
-            ExpandItemsEOFContext ctxExpandItems =
-                (ExpandItemsEOFContext) parseRule(optionValue, ParserEntryRules.ExpandItems);
-            systemOption = (ExpandOptionImpl) uriParseTreeVisitor.visitExpandItemsEOF(ctxExpandItems);
-          } catch (final ParseCancellationException e) {
-            throw e.getCause() instanceof UriParserException ?
-                (UriParserException) e.getCause() :
-                new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX);
+          if (contextTypes.peek() instanceof EdmStructuredType
+              || !contextUriInfo.getEntitySetNames().isEmpty()
+              || contextUriInfo.getKind() == UriInfoKind.entityId) { // TODO: Remove once the type has been set above.
+            UriTokenizer expandTokenizer = new UriTokenizer(optionValue);
+            systemOption = new ExpandParser(edm, odata).parse(expandTokenizer,
+                contextTypes.peek() instanceof EdmStructuredType ? (EdmStructuredType) contextTypes.peek() : null);
+            checkOptionEOF(expandTokenizer, optionName, optionValue);
+          } else {
+            throw new UriValidationException("Expand is only allowed on structured types!",
+                UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED, optionName);
           }
 
         } else if (optionName.equals(SystemQueryOptionKind.ID.toString())) {
           IdOptionImpl idOption = new IdOptionImpl();
           idOption.setText(optionValue);
+          if (optionValue == null || optionValue.isEmpty()) {
+            throw new UriParserSyntaxException("Illegal value of $id option!",
+                UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
+                optionName, optionValue);
+          }
           idOption.setValue(optionValue);
           systemOption = idOption;
 
@@ -234,10 +227,8 @@ public class Parser {
         } else if (optionName.equals(SystemQueryOptionKind.ORDERBY.toString())) {
           UriTokenizer orderByTokenizer = new UriTokenizer(optionValue);
           systemOption = new OrderByParser(edm, odata).parse(orderByTokenizer,
-              context.contextTypes.peek() instanceof EdmStructuredType ?
-                  (EdmStructuredType) context.contextTypes.peek() :
-                  null,
-                  context.contextUriInfo.getEntitySetNames());
+              contextTypes.peek() instanceof EdmStructuredType ? (EdmStructuredType) contextTypes.peek() : null,
+              contextUriInfo.getEntitySetNames());
           checkOptionEOF(orderByTokenizer, optionName, optionValue);
 
         } else if (optionName.equals(SystemQueryOptionKind.SEARCH.toString())) {
@@ -246,40 +237,31 @@ public class Parser {
         } else if (optionName.equals(SystemQueryOptionKind.SELECT.toString())) {
           UriTokenizer selectTokenizer = new UriTokenizer(optionValue);
           systemOption = new SelectParser(edm).parse(selectTokenizer,
-              context.contextTypes.peek() instanceof EdmStructuredType ?
-                  (EdmStructuredType) context.contextTypes.peek() :
-                  null,
-              context.isCollection);
+              contextTypes.peek() instanceof EdmStructuredType ? (EdmStructuredType) contextTypes.peek() : null,
+              contextIsCollection);
           checkOptionEOF(selectTokenizer, optionName, optionValue);
 
         } else if (optionName.equals(SystemQueryOptionKind.SKIP.toString())) {
           SkipOptionImpl skipOption = new SkipOptionImpl();
           skipOption.setText(optionValue);
-          try {
-            skipOption.setValue(Integer.parseInt(optionValue));
-          } catch (final NumberFormatException e) {
-            throw new UriParserSyntaxException("Illegal value of $skip option!", e,
-                UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
-                optionName, optionValue);
-          }
+          skipOption.setValue(ParserHelper.parseNonNegativeInteger(optionName, optionValue, true));
           systemOption = skipOption;
 
         } else if (optionName.equals(SystemQueryOptionKind.SKIPTOKEN.toString())) {
           SkipTokenOptionImpl skipTokenOption = new SkipTokenOptionImpl();
           skipTokenOption.setText(optionValue);
+          if (optionValue == null || optionValue.isEmpty()) {
+            throw new UriParserSyntaxException("Illegal value of $skiptoken option!",
+                UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
+                optionName, optionValue);
+          }
           skipTokenOption.setValue(optionValue);
           systemOption = skipTokenOption;
 
         } else if (optionName.equals(SystemQueryOptionKind.TOP.toString())) {
           TopOptionImpl topOption = new TopOptionImpl();
           topOption.setText(optionValue);
-          try {
-            topOption.setValue(Integer.parseInt(optionValue));
-          } catch (final NumberFormatException e) {
-            throw new UriParserSyntaxException("Illegal value of $top option!", e,
-                UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
-                optionName, optionValue);
-          }
+          topOption.setValue(ParserHelper.parseNonNegativeInteger(optionName, optionValue, true));
           systemOption = topOption;
 
         } else if (optionName.equals(SystemQueryOptionKind.COUNT.toString())) {
@@ -299,14 +281,14 @@ public class Parser {
               UriParserSyntaxException.MessageKeys.UNKNOWN_SYSTEM_QUERY_OPTION, optionName);
         }
         try {
-          context.contextUriInfo.setSystemQueryOption(systemOption);
+          contextUriInfo.setSystemQueryOption(systemOption);
         } catch (final ODataRuntimeException e) {
           throw new UriParserSyntaxException("Double system query option!", e,
               UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION, optionName);
         }
 
       } else if (optionName.startsWith(AT)) {
-        if (context.contextUriInfo.getAlias(optionName) == null) {
+        if (contextUriInfo.getAlias(optionName) == null) {
           // TODO: Create a proper alias-value parser that can parse also common expressions.
           Expression expression = null;
           UriTokenizer aliasTokenizer = new UriTokenizer(optionValue);
@@ -318,13 +300,13 @@ public class Parser {
           } else {
             UriTokenizer aliasValueTokenizer = new UriTokenizer(optionValue);
             expression = new ExpressionParser(edm, odata).parse(aliasValueTokenizer, null,
-                context.contextUriInfo.getEntitySetNames());
+                contextUriInfo.getEntitySetNames());
             if (!aliasValueTokenizer.next(TokenKind.EOF)) {
               throw new UriParserSyntaxException("Illegal value for alias '" + optionName + "'.",
                   UriParserSyntaxException.MessageKeys.SYNTAX);
             }
           }
-          context.contextUriInfo.addAlias((AliasQueryOption) new AliasQueryOptionImpl()
+          contextUriInfo.addAlias((AliasQueryOption) new AliasQueryOptionImpl()
               .setAliasValue(expression)
               .setName(optionName)
               .setText(NULL.equals(optionValue) ? null : optionValue));
@@ -334,11 +316,11 @@ public class Parser {
         }
 
       } else {
-        context.contextUriInfo.addCustomQueryOption((CustomQueryOption) option);
+        contextUriInfo.addCustomQueryOption((CustomQueryOption) option);
       }
     }
 
-    return context.contextUriInfo;
+    return contextUriInfo;
   }
 
   private void ensureLastSegment(final String segment, final int pos, final int size)
@@ -362,102 +344,4 @@ public class Parser {
           optionName, optionValue);
     }
   }
-
-  private ParserRuleContext parseRule(final String input, final ParserEntryRules entryPoint)
-      throws UriParserSyntaxException {
-    UriParserParser parser = null;
-    UriLexer lexer = null;
-    ParserRuleContext ret = null;
-
-    // Use 2 stage approach to improve performance
-    // see https://github.com/antlr/antlr4/issues/192
-
-    // stage = 1
-    try {
-
-      // create parser
-      lexer = new UriLexer(new ANTLRInputStream(input));
-      parser = new UriParserParser(new CommonTokenStream(lexer));
-
-      // Set error strategy
-      addStage1ErrorStrategy(parser);
-
-      // Set error collector
-      addStage1ErrorListener(parser);
-
-      // user the faster LL parsing
-      parser.getInterpreter().setPredictionMode(PredictionMode.SLL);
-
-      // parse
-      switch (entryPoint) {
-      case ExpandItems:
-        lexer.mode(Lexer.DEFAULT_MODE);
-        ret = parser.expandItemsEOF();
-        break;
-      default:
-        break;
-
-      }
-
-    } catch (ParseCancellationException hardException) {
-      // stage = 2
-      try {
-
-        // create parser
-        lexer = new UriLexer(new ANTLRInputStream(input));
-        parser = new UriParserParser(new CommonTokenStream(lexer));
-
-        // Set error strategy
-        addStage2ErrorStrategy(parser);
-
-        // Set error collector
-        addStage2ErrorListener(parser);
-
-        // Use the slower SLL parsing
-        parser.getInterpreter().setPredictionMode(PredictionMode.LL);
-
-        // parse
-        switch (entryPoint) {
-        case ExpandItems:
-          lexer.mode(Lexer.DEFAULT_MODE);
-          ret = parser.expandItemsEOF();
-          break;
-        default:
-          break;
-        }
-
-      } catch (final RecognitionException weakException) {
-        throw new UriParserSyntaxException("Error in syntax", weakException,
-            UriParserSyntaxException.MessageKeys.SYNTAX);
-
-        // exceptionOnStage = 2;
-      }
-    } catch (final RecognitionException hardException) {
-      throw new UriParserSyntaxException("Error in syntax", hardException,
-          UriParserSyntaxException.MessageKeys.SYNTAX);
-    }
-
-    return ret;
-  }
-
-  protected void addStage1ErrorStrategy(final UriParserParser parser) {
-    // Throw exception at first syntax error
-    parser.setErrorHandler(new BailErrorStrategy());
-
-  }
-
-  protected void addStage2ErrorStrategy(final UriParserParser parser) {
-    // Throw exception at first syntax error
-    parser.setErrorHandler(new BailErrorStrategy());
-  }
-
-  protected void addStage1ErrorListener(final UriParserParser parser) {
-    // No error logging to System.out or System.err, only exceptions used (depending on ErrorStrategy)
-    parser.removeErrorListeners();
-  }
-
-  protected void addStage2ErrorListener(final UriParserParser parser) {
-    // No error logging to System.out or System.err, only exceptions used (depending on ErrorStrategy)
-    parser.removeErrorListeners();
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
index 65ee461..7f4abf7 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
@@ -23,6 +23,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
 import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
 import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
@@ -36,6 +37,8 @@ import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.UriParameter;
 import org.apache.olingo.server.api.uri.UriResourcePartTyped;
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.server.api.uri.queryoption.expression.Literal;
 import org.apache.olingo.server.core.ODataImpl;
 import org.apache.olingo.server.core.uri.UriParameterImpl;
 import org.apache.olingo.server.core.uri.UriResourceTypedImpl;
@@ -88,8 +91,9 @@ public class ParserHelper {
         TokenKind.EnumValue);
   }
 
-  protected static List<UriParameter> parseFunctionParameters(UriTokenizer tokenizer, final boolean withComplex)
-      throws UriParserException {
+  protected static List<UriParameter> parseFunctionParameters(UriTokenizer tokenizer,
+      final Edm edm, final EdmType referringType, final boolean withComplex)
+      throws UriParserException, UriValidationException {
     List<UriParameter> parameters = new ArrayList<UriParameter>();
     ParserHelper.requireNext(tokenizer, TokenKind.OPEN);
     if (tokenizer.next(TokenKind.CLOSE)) {
@@ -115,6 +119,13 @@ public class ParserHelper {
           throw new UriParserSemanticException("A JSON array or object is not allowed as parameter value.",
               UriParserSemanticException.MessageKeys.COMPLEX_PARAMETER_IN_RESOURCE_PATH, tokenizer.getText());
         }
+      } else if (withComplex) {
+        final Expression expression = new ExpressionParser(edm, odata).parse(tokenizer, referringType, null);
+        parameters.add(new UriParameterImpl().setName(name)
+            .setText(expression instanceof Literal ?
+                "null".equals(((Literal) expression).getText()) ? null : ((Literal) expression).getText() :
+                null)
+            .setExpression(expression instanceof Literal ? null : expression));
       } else if (nextPrimitiveValue(tokenizer) == null) {
         throw new UriParserSemanticException("Wrong parameter value.",
             UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, "");
@@ -387,4 +398,23 @@ public class ParserHelper {
 
     return type;
   }
+
+  protected static int parseNonNegativeInteger(final String optionName, final String optionValue,
+      final boolean zeroAllowed) throws UriParserException {
+    int value;
+    try {
+      value = Integer.parseInt(optionValue);
+    } catch (final NumberFormatException e) {
+      throw new UriParserSyntaxException("Illegal value of '" + optionName + "' option!", e,
+          UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
+          optionName, optionValue);
+    }
+    if (value > 0 || value == 0 && zeroAllowed) {
+      return value;
+    } else {
+      throw new UriParserSyntaxException("Illegal value of '" + optionName + "' option!",
+          UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION,
+          optionName, optionValue);
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
index 1cd4d7a..87cb91a 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
@@ -261,30 +261,33 @@ public class ResourcePathParser {
       throws UriParserException, UriValidationException {
     final FullQualifiedName name = new FullQualifiedName(tokenizer.getText());
     requireTyped(previous, name.getFullQualifiedNameAsString());
-      final UriResourcePartTyped previousTyped = (UriResourcePartTyped) previous;
-      final EdmType previousTypeFilter = getPreviousTypeFilter(previousTyped);
-      final EdmType previousType = previousTypeFilter == null ? previousTyped.getType() : previousTypeFilter;
-      final EdmAction boundAction = edm.getBoundAction(name,
-          previousType.getFullQualifiedName(),
-          previousTyped.isCollection());
-      if (boundAction != null) {
-        ParserHelper.requireTokenEnd(tokenizer);
-        return new UriResourceActionImpl(boundAction);
-      }
-      EdmStructuredType type = edm.getEntityType(name);
-      if (type == null) {
-        type = edm.getComplexType(name);
-      }
-      if (type != null) {
-        return typeCast(name, type, previousTyped);
-      }
-      if (tokenizer.next(TokenKind.EOF)) {
-        throw new UriParserSemanticException("Type '" + name.getFullQualifiedNameAsString() + "' not found.",
-            UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, name.getFullQualifiedNameAsString());
-      }
-      return functionCall(null, name,
-          previousType.getFullQualifiedName(),
-          previousTyped.isCollection());
+    final UriResourcePartTyped previousTyped = (UriResourcePartTyped) previous;
+    final EdmType previousTypeFilter = getPreviousTypeFilter(previousTyped);
+    final EdmType previousType = previousTypeFilter == null ? previousTyped.getType() : previousTypeFilter;
+
+    // We check for bound actions first because they cannot be followed by anything.
+    final EdmAction boundAction =
+        edm.getBoundAction(name, previousType.getFullQualifiedName(), previousTyped.isCollection());
+    if (boundAction != null) {
+      ParserHelper.requireTokenEnd(tokenizer);
+      return new UriResourceActionImpl(boundAction);
+    }
+
+    // Type casts can be syntactically indistinguishable from bound function calls in the case of additional keys.
+    // But normally they are shorter, so they come next.
+    final EdmStructuredType type = previousTyped.getType() instanceof EdmEntityType ?
+        edm.getEntityType(name) :
+        edm.getComplexType(name);
+    if (type != null) {
+      return typeCast(name, type, previousTyped);
+    }
+    if (tokenizer.next(TokenKind.EOF)) {
+      throw new UriParserSemanticException("Type '" + name.getFullQualifiedNameAsString() + "' not found.",
+          UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, name.getFullQualifiedNameAsString());
+    }
+
+    // Now a bound function call is the only remaining option.
+    return functionCall(null, name, previousType.getFullQualifiedName(), previousTyped.isCollection());
   }
 
   private void requireTyped(final UriResource previous, final String forWhat) throws UriParserException {
@@ -317,8 +320,13 @@ public class ResourcePathParser {
           ((UriResourceWithKeysImpl) previousTyped).setEntryTypeFilter(type);
         }
         if (tokenizer.next(TokenKind.OPEN)) {
-          ((UriResourceWithKeysImpl) previousTyped).setKeyPredicates(
-              ParserHelper.parseKeyPredicate(tokenizer, (EdmEntityType) type, null));
+          final List<UriParameter> keys = ParserHelper.parseKeyPredicate(tokenizer, (EdmEntityType) type, null);
+          if (previousTyped.isCollection()) {
+            ((UriResourceWithKeysImpl) previousTyped).setKeyPredicates(keys);
+          } else {
+            throw new UriParserSemanticException("Key not allowed here.",
+                UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED);
+          }
         }
       } else {
         previousTypeFilter = ((UriResourceTypedImpl) previousTyped).getTypeFilter();
@@ -351,7 +359,7 @@ public class ResourcePathParser {
   private UriResource functionCall(final EdmFunctionImport edmFunctionImport,
       final FullQualifiedName boundFunctionName, final FullQualifiedName bindingParameterTypeName,
       final boolean isBindingParameterCollection) throws UriParserException, UriValidationException {
-    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, false);
+    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, edm, null, false);
     final List<String> names = ParserHelper.getParameterNames(parameters);
     EdmFunction function = null;
     if (edmFunctionImport != null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SearchParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SearchParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SearchParser.java
new file mode 100644
index 0000000..a072327
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SearchParser.java
@@ -0,0 +1,108 @@
+/*
+ * 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.core.uri.parser;
+
+import org.apache.olingo.server.api.uri.queryoption.SearchOption;
+import org.apache.olingo.server.api.uri.queryoption.search.SearchBinaryOperatorKind;
+import org.apache.olingo.server.api.uri.queryoption.search.SearchExpression;
+import org.apache.olingo.server.api.uri.queryoption.search.SearchTerm;
+import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
+import org.apache.olingo.server.core.uri.parser.search.SearchBinaryImpl;
+import org.apache.olingo.server.core.uri.parser.search.SearchParserException;
+import org.apache.olingo.server.core.uri.parser.search.SearchTermImpl;
+import org.apache.olingo.server.core.uri.parser.search.SearchUnaryImpl;
+import org.apache.olingo.server.core.uri.queryoption.SearchOptionImpl;
+
+/**
+ * Parses search expressions according to the following (rewritten) grammar:
+ * <pre>
+ * SearchExpr  ::= ExprOR
+ * ExprOR      ::= ExprAnd ('OR' ExprAnd)*
+ * ExprAnd     ::= Term ('AND'? Term)*
+ * Term        ::= ('NOT'? (Word | Phrase)) | ('(' SearchExpr ')')
+ * </pre> 
+ */
+public class SearchParser {
+
+  public SearchOption parse(UriTokenizer tokenizer) throws SearchParserException {
+    SearchOptionImpl searchOption = new SearchOptionImpl();
+    searchOption.setSearchExpression(processExprOr(tokenizer));
+    return searchOption;
+  }
+
+  private SearchExpression processExprOr(UriTokenizer tokenizer) throws SearchParserException {
+    SearchExpression left = processExprAnd(tokenizer);
+
+    while (tokenizer.next(TokenKind.OrOperatorSearch)) {
+      final SearchExpression right = processExprAnd(tokenizer);
+      left = new SearchBinaryImpl(left, SearchBinaryOperatorKind.OR, right);
+    }
+
+    return left;
+  }
+
+  private SearchExpression processExprAnd(UriTokenizer tokenizer) throws SearchParserException {
+    SearchExpression left = processTerm(tokenizer);
+
+    while (tokenizer.next(TokenKind.AndOperatorSearch)) { // Could be whitespace or whitespace-surrounded 'AND'.
+      final SearchExpression right = processTerm(tokenizer);
+      left = new SearchBinaryImpl(left, SearchBinaryOperatorKind.AND, right);
+    }
+
+    return left;
+  }
+
+  private SearchExpression processTerm(UriTokenizer tokenizer) throws SearchParserException {
+    if (tokenizer.next(TokenKind.OPEN)) {
+      final SearchExpression expr = processExprOr(tokenizer);
+      if (!tokenizer.next(TokenKind.CLOSE)) {
+        throw new SearchParserException("Missing close parenthesis after open parenthesis.",
+            SearchParserException.MessageKeys.MISSING_CLOSE);
+      }
+      return expr;
+    } else if (tokenizer.next(TokenKind.NotOperatorSearch)) {
+      return processNot(tokenizer);
+    } else if (tokenizer.next(TokenKind.Word)) {
+      return new SearchTermImpl(tokenizer.getText());
+    } else if (tokenizer.next(TokenKind.Phrase)) {
+      return processPhrase(tokenizer);
+    } else {
+      throw new SearchParserException("Expected PHRASE or WORD not found.",
+          SearchParserException.MessageKeys.EXPECTED_DIFFERENT_TOKEN, "PHRASE, WORD", "");
+    }
+  }
+
+  private SearchExpression processNot(UriTokenizer tokenizer) throws SearchParserException {
+    if (tokenizer.next(TokenKind.Word)) {
+      return new SearchUnaryImpl(new SearchTermImpl(tokenizer.getText()));
+    } else if (tokenizer.next(TokenKind.Phrase)) {
+      return new SearchUnaryImpl(processPhrase(tokenizer));
+    } else {
+      throw new SearchParserException("NOT must be followed by a term.",
+          SearchParserException.MessageKeys.INVALID_NOT_OPERAND, "");
+    }
+  }
+
+  private SearchTerm processPhrase(UriTokenizer tokenizer) {
+    final String literal = tokenizer.getText();
+    return new SearchTermImpl(literal.substring(1, literal.length() - 1)
+        .replace("\\\"", "\"")
+        .replace("\\\\", "\\"));
+  }
+}


[27/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] Adjust LICENSE file

Posted by mi...@apache.org.
[OLINGO-834] Adjust LICENSE file

I removed the Antlr and treelayout bsd license.


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 53d2e8bb8c81433a96a235b8a0f8a485278cd0b6
Parents: 40be3e4
Author: Christian Amend <ch...@sap.com>
Authored: Fri Jan 8 10:03:04 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Fri Jan 8 10:03:04 2016 +0100

----------------------------------------------------------------------
 dist/server-lib/src/main/resources/LICENSE      | 67 --------------------
 dist/server-lib/src/main/resources/NOTICE       | 31 +--------
 fit/pom.xml                                     |  1 -
 .../olingo/server/core/uri/parser/RawUri.java   | 46 --------------
 .../queryoption/expression/ExpressionImpl.java  | 25 --------
 5 files changed, 1 insertion(+), 169 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53d2e8bb/dist/server-lib/src/main/resources/LICENSE
----------------------------------------------------------------------
diff --git a/dist/server-lib/src/main/resources/LICENSE b/dist/server-lib/src/main/resources/LICENSE
index f858fe4..1685307 100644
--- a/dist/server-lib/src/main/resources/LICENSE
+++ b/dist/server-lib/src/main/resources/LICENSE
@@ -205,73 +205,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 
 
-From: 'abego Software GmbH, Germany' (http://abego-software.de) - abego
-TreeLayout Core (http://code.google.com/p/treelayout/)
-org.abego.treelayout:org.abego.treelayout.core:jar:1.0.1 License: BSD 3-Clause
-"New" or "Revised" License (BSD-3-Clause)
-(http://treelayout.googlecode.com/files/LICENSE.TXT)
-
-[The "BSD license"]
-Copyright (c) 2011, abego Software GmbH, Germany (http://www.abego.org)
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without 
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, 
-   this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice, 
-   this list of conditions and the following disclaimer in the documentation 
-   and/or other materials provided with the distribution.
-3. Neither the name of the abego Software GmbH nor the names of its 
-   contributors may be used to endorse or promote products derived from this 
-   software without specific prior written permission.
-   
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-POSSIBILITY OF SUCH DAMAGE.
-
-
-
-
-From: 'ANTLR' (http://www.antlr.org) - ANTLR 4 Runtime
-(http://www.antlr.org/antlr4-runtime) org.antlr:antlr4-runtime:jar:4.1 License:
-The BSD License (http://www.antlr.org/license.html)
-
-[The BSD License]
-Copyright (c) 2012 Terence Parr and Sam Harwell
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    Redistributions of source code must retain the above copyright notice, this
-    list of conditions and the following disclaimer. Redistributions in binary
-    form must reproduce the above copyright notice, this list of conditions and
-    the following disclaimer in the documentation and/or other materials
-    provided with the distribution. Neither the name of the author nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 From: 'fasterxml.com' (http://fasterxml.com) - Stax2 API
 (http://wiki.fasterxml.com/WoodstoxStax2)
 org.codehaus.woodstox:stax2-api:bundle:3.1.4 License: The BSD License

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53d2e8bb/dist/server-lib/src/main/resources/NOTICE
----------------------------------------------------------------------
diff --git a/dist/server-lib/src/main/resources/NOTICE b/dist/server-lib/src/main/resources/NOTICE
index 5a87ef7..bb34cf8 100644
--- a/dist/server-lib/src/main/resources/NOTICE
+++ b/dist/server-lib/src/main/resources/NOTICE
@@ -18,33 +18,4 @@ FasterXML.com (http://fasterxml.com).
 ## Credits
 A list of contributors may be found from CREDITS file, which is included
 in some artifacts (usually source distributions); but is always available
-from the source code management (SCM) system project uses.
-
-This distribution includes TreeLayout Core (http://code.google.com/p/treelayout/)
-Copyright (c) 2011, abego Software GmbH, Germany (http://www.abego.org)
-All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-1. Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
-3. Neither the name of the abego Software GmbH nor the names of its
-   contributors may be used to endorse or promote products derived from this
-   software without specific prior written permission.
-(http://treelayout.googlecode.com/files/LICENSE.TXT)
-
-This distribution includes  ANTLR 4 Runtime (http://www.antlr.org/antlr4-runtime)
-Copyright (c) 2012 Terence Parr and Sam Harwell
-All rights reserved.
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation
-and/or other materials provided with the distribution.
-Neither the name of the author nor the names of its contributors may be used to
-endorse or promote products derived from this software without specific prior written permission.
-(http://www.antlr.org/license.html)
+from the source code management (SCM) system project uses.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53d2e8bb/fit/pom.xml
----------------------------------------------------------------------
diff --git a/fit/pom.xml b/fit/pom.xml
index 34eff39..08dd7fc 100644
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@ -239,7 +239,6 @@
               <exclude>org/apache/olingo/**/tecsvc/**/*.class</exclude>
               <exclude>org/apache/olingo/**/fit/**/*.class</exclude>
               <exclude>org/apache/olingo/**/testutil/**/*.class</exclude>
-              <exclude>org/apache/olingo/**/antlr/**/*.class</exclude>
             </excludes>
           </instrumentation>
           <check/>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53d2e8bb/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
deleted file mode 100644
index 231317f..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
+++ /dev/null
@@ -1,46 +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.server.core.uri.parser;
-
-import java.util.List;
-
-public class RawUri {
-  public String uri;
-  public String scheme;
-  public String authority;
-  public String path;
-  public String queryOptionString;
-  public String fragment;
-  public List<QueryOption> queryOptionList;
-  public List<QueryOption> queryOptionListDecoded;
-
-  public List<String> pathSegmentList;
-  public List<String> pathSegmentListDecoded;
-
-  public static class QueryOption {
-    public String name;
-    public String value;
-
-    QueryOption(final String name, final String value) {
-      this.name = name;
-      this.value = value;
-    }
-
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53d2e8bb/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
deleted file mode 100644
index e64a363..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
+++ /dev/null
@@ -1,25 +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.server.core.uri.queryoption.expression;
-
-import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
-
-public abstract class ExpressionImpl implements Expression {
-  // No additional methods needed for now.
-}


[37/51] [abbrv] olingo-odata4 git commit: [OLINGO-575] removal of some test V3 code

Posted by mi...@apache.org.
[OLINGO-575] removal of some test V3 code

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: c7aa842fb40856e068dc2741fe5c33f1abb7b6ec
Parents: 1b6259b
Author: Klaus Straubinger <kl...@sap.com>
Authored: Fri Jan 15 16:06:45 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Jan 18 13:35:48 2016 +0100

----------------------------------------------------------------------
 .../org/apache/olingo/fit/AbstractServices.java |  46 --------
 .../apache/olingo/fit/metadata/Association.java |  70 ------------
 .../olingo/fit/metadata/AssociationSet.java     |  74 -------------
 .../apache/olingo/fit/metadata/Container.java   |  13 ---
 .../apache/olingo/fit/metadata/Metadata.java    | 110 +++----------------
 .../olingo/fit/metadata/NavigationProperty.java |  27 -----
 .../org/apache/olingo/fit/metadata/Schema.java  |  14 ---
 .../org/apache/olingo/fit/methods/MERGE.java    |  33 ------
 .../org/apache/olingo/fit/utils/Constants.java  |  60 +++-------
 .../olingo/fit/base/EntityUpdateTestITCase.java |   2 +-
 .../edm/annotation/EdmConstantExpression.java   |   8 +-
 11 files changed, 35 insertions(+), 422 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/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 fc886ff..c287e5b 100644
--- a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
+++ b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
@@ -88,7 +88,6 @@ import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 import org.apache.olingo.fit.metadata.EntityType;
 import org.apache.olingo.fit.metadata.Metadata;
 import org.apache.olingo.fit.metadata.NavigationProperty;
-import org.apache.olingo.fit.methods.MERGE;
 import org.apache.olingo.fit.methods.PATCH;
 import org.apache.olingo.fit.serializer.FITAtomDeserializer;
 import org.apache.olingo.fit.utils.AbstractUtilities;
@@ -414,23 +413,6 @@ public abstract class AbstractServices {
     addSingleBatchResponse(xml.createFaultResponse(Accept.XML.toString(), e), contentId, bos);
   }
 
-  @MERGE
-  @Path("/{entitySetName}({entityId})")
-  @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON })
-  @Consumes({ MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON })
-  public Response mergeEntity(
-      @Context final UriInfo uriInfo,
-      @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
-      @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
-      @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) final String prefer,
-      @HeaderParam("If-Match") @DefaultValue(StringUtils.EMPTY) final String ifMatch,
-      @PathParam("entitySetName") final String entitySetName,
-      @PathParam("entityId") final String entityId,
-      final String changes) {
-
-    return patchEntity(uriInfo, accept, contentType, prefer, ifMatch, entitySetName, entityId, changes);
-  }
-
   @PATCH
   @Path("/{entitySetName}({entityId})")
   @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON })
@@ -1510,34 +1492,6 @@ public abstract class AbstractServices {
    * @param changes
    * @return response
    */
-  @MERGE
-  @Path("/{entitySetName}({entityId})/{path:.*}")
-  public Response mergeProperty(
-      @Context final UriInfo uriInfo,
-      @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
-      @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
-      @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) final String prefer,
-      @PathParam("entitySetName") final String entitySetName,
-      @PathParam("entityId") final String entityId,
-      @PathParam("path") final String path,
-      @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
-      final String changes) {
-
-    return replaceProperty(uriInfo.getRequestUri().toASCIIString(),
-        accept, contentType, prefer, entitySetName, entityId, path, format, changes, false);
-  }
-
-  /**
-   * Replace property.
-   *
-   * @param accept
-   * @param entitySetName
-   * @param entityId
-   * @param path
-   * @param format
-   * @param changes
-   * @return response
-   */
   @PATCH
   @Path("/{entitySetName}({entityId})/{path:.*}")
   public Response patchProperty(

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java
deleted file mode 100644
index aa0ce6d..0000000
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java
+++ /dev/null
@@ -1,70 +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.fit.metadata;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public class Association extends AbstractMetadataElement {
-
-  private final String name;
-
-  private Map<String, Role> roles;
-
-  public Association(final String name) {
-    this.name = name;
-    roles = new LinkedHashMap<String, Role>();
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public Association addRole(final String name, final String type, final String multiplicity) {
-    roles.put(name, new Role(name, type, multiplicity));
-    return this;
-  }
-
-  public Role getRole(final String name) {
-    return roles.get(name);
-  }
-
-  public static class Role {
-
-    final String name;
-
-    final String type;
-
-    final String multiplicity;
-
-    public Role(final String name, final String type, final String multiplicity) {
-      this.name = name;
-      this.type = type;
-      this.multiplicity = multiplicity;
-    }
-
-    public String getType() {
-      return type;
-    }
-
-    public String getMultiplicity() {
-      return multiplicity;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java b/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java
deleted file mode 100644
index 9bda9db..0000000
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java
+++ /dev/null
@@ -1,74 +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.fit.metadata;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public class AssociationSet extends AbstractMetadataElement {
-
-  private final String name;
-
-  private final String association;
-
-  private Map<String, Role> roles;
-
-  public AssociationSet(final String name, final String association) {
-    this.name = name;
-    this.association = association;
-    roles = new LinkedHashMap<String, Role>();
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public String getAssociation() {
-    return association;
-  }
-
-  public AssociationSet addRole(final String name, final String entitySet) {
-    roles.put(name, new Role(name, entitySet));
-    return this;
-  }
-
-  public Role getRole(final String name) {
-    return roles.get(name);
-  }
-
-  public static class Role {
-
-    final String name;
-
-    final String entitySet;
-
-    public Role(final String name, final String entitySet) {
-      this.name = name;
-      this.entitySet = entitySet;
-    }
-
-    public String getName() {
-      return name;
-    }
-
-    public String getEntitySet() {
-      return entitySet;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
index aab6143..e8eb3bf 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
@@ -26,25 +26,17 @@ import java.util.Map;
 public class Container extends AbstractMetadataElement {
 
   private final String name;
-
   private final Map<String, EntitySet> entitySets;
 
-  private final Map<String, AssociationSet> associationSets;
-
   public Container(final String name) {
     this.name = name;
     entitySets = new HashMap<String, EntitySet>();
-    associationSets = new HashMap<String, AssociationSet>();
   }
 
   public String getName() {
     return name;
   }
 
-  public AssociationSet getAssociationSet(final String association) {
-    return associationSets.get(association);
-  }
-
   public Collection<EntitySet> getEntitySets() {
     return entitySets.values();
   }
@@ -68,9 +60,4 @@ public class Container extends AbstractMetadataElement {
     entitySets.put(name, entitySet);
     return this;
   }
-
-  public Container addAssociationSet(final String name, final AssociationSet associationSet) {
-    associationSets.put(name, associationSet);
-    return this;
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
index 6482143..0d88b1d 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
@@ -82,37 +82,20 @@ public class Metadata extends AbstractMetadataElement {
     for (Map.Entry<String, Schema> schemaEntry : schemas.entrySet()) {
       for (EntityType entityType : schemaEntry.getValue().getEntityTypes()) {
         for (NavigationProperty property : entityType.getNavigationProperties()) {
-          if (StringUtils.isNotBlank(property.getReleationship())) {
-            // V3 ...
-            final Association association = schemaEntry.getValue().getAssociation(
-                property.getReleationship().replaceAll(schemaEntry.getKey() + "\\.", ""));
-            final Association.Role role = association.getRole(property.getToRole());
-            property.setFeed(role.getMultiplicity().equals("*"));
-            property.setType(property.isEntitySet() ? "Collection(" + role.getType() + ")" : role.getType());
-
-            // let me assume that it will be just a single container
-            final AssociationSet associationSet = schemaEntry.getValue().getContainers().iterator().next().
-                getAssociationSet(property.getReleationship());
-
-            final AssociationSet.Role associationSetRole = associationSet.getRole(property.getToRole());
-            property.setTarget(associationSetRole.getEntitySet());
-          } else {
-            // V4 ...
-            property.setFeed(property.getType().startsWith("Collection("));
-
-            final Collection<EntitySet> entitySets = schemaEntry.getValue().getContainers().iterator().next().
-                getEntitySets(schemaEntry.getKey(), entityType.getName());
-
-            final Iterator<EntitySet> iter = entitySets.iterator();
-            boolean found = false;
-
-            while (!found && iter.hasNext()) {
-              final EntitySet entitySet = iter.next();
-              final String target = entitySet.getTarget(property.getName());
-              if (StringUtils.isNotBlank(target)) {
-                property.setTarget(entitySet.getTarget(property.getName()));
-                found = true;
-              }
+          property.setFeed(property.getType().startsWith("Collection("));
+
+          final Collection<EntitySet> entitySets = schemaEntry.getValue().getContainers().iterator().next().
+              getEntitySets(schemaEntry.getKey(), entityType.getName());
+
+          final Iterator<EntitySet> iter = entitySets.iterator();
+          boolean found = false;
+
+          while (!found && iter.hasNext()) {
+            final EntitySet entitySet = iter.next();
+            final String target = entitySet.getTarget(property.getName());
+            if (StringUtils.isNotBlank(target)) {
+              property.setTarget(entitySet.getTarget(property.getName()));
+              found = true;
             }
           }
         }
@@ -209,10 +192,6 @@ public class Metadata extends AbstractMetadataElement {
           && event.asStartElement().getName().equals(new QName(DEF_NS, "EntityContainer"))) {
         final org.apache.olingo.fit.metadata.Container container = getContainer(event.asStartElement(), reader);
         schema.addContainer(container.getName(), container);
-      } else if (event.isStartElement() && event.asStartElement().getName().equals(new QName(DEF_NS, "Association"))) {
-        // just for V3
-        final Association association = getAssociation(event.asStartElement(), reader);
-        schema.addAssociation(association.getName(), association);
       } else if (event.isEndElement() && event.asEndElement().getName().equals(start.getName())) {
         completed = true;
       }
@@ -236,11 +215,6 @@ public class Metadata extends AbstractMetadataElement {
               || event.asStartElement().getName().equals(new QName(DEF_NS, "Singleton")))) {
         final EntitySet entitySet = getEntitySet(event.asStartElement(), reader);
         container.addEntitySet(entitySet.getName(), entitySet);
-      } else if (event.isStartElement()
-          && event.asStartElement().getName().equals(new QName(DEF_NS, "AssociationSet"))) {
-        // just for V3
-        final AssociationSet associationSet = getAssociationSet(event.asStartElement(), reader);
-        container.addAssociationSet(associationSet.getAssociation(), associationSet);
       } else if (event.isEndElement() && event.asEndElement().getName().equals(start.getName())) {
         completed = true;
       }
@@ -249,52 +223,6 @@ public class Metadata extends AbstractMetadataElement {
     return container;
   }
 
-  private Association getAssociation(
-      final StartElement start, final XMLEventReader reader) throws XMLStreamException {
-    final Association association = new Association(start.getAttributeByName(new QName("Name")).getValue());
-
-    boolean completed = false;
-
-    while (!completed && reader.hasNext()) {
-      XMLEvent event = reader.nextEvent();
-
-      if (event.isStartElement() && event.asStartElement().getName().equals(new QName(DEF_NS, "End"))) {
-        final String role = event.asStartElement().getAttributeByName(new QName("Role")).getValue();
-        final String type = event.asStartElement().getAttributeByName(new QName("Type")).getValue();
-        final String multiplicity =
-            event.asStartElement().getAttributeByName(new QName("Multiplicity")).getValue();
-        association.addRole(role, type, multiplicity);
-      } else if (event.isEndElement() && event.asEndElement().getName().equals(start.getName())) {
-        completed = true;
-      }
-    }
-
-    return association;
-  }
-
-  private AssociationSet getAssociationSet(
-      final StartElement start, final XMLEventReader reader) throws XMLStreamException {
-    final AssociationSet associationSet = new AssociationSet(
-        start.getAttributeByName(new QName("Name")).getValue(),
-        start.getAttributeByName(new QName("Association")).getValue());
-
-    boolean completed = false;
-
-    while (!completed && reader.hasNext()) {
-      XMLEvent event = reader.nextEvent();
-
-      if (event.isStartElement() && event.asStartElement().getName().equals(new QName(DEF_NS, "End"))) {
-        final String role = event.asStartElement().getAttributeByName(new QName("Role")).getValue();
-        final String entitySet = event.asStartElement().getAttributeByName(new QName("EntitySet")).getValue();
-        associationSet.addRole(role, entitySet);
-      } else if (event.isEndElement() && event.asEndElement().getName().equals(start.getName())) {
-        completed = true;
-      }
-    }
-
-    return associationSet;
-  }
-
   private EntityType getEntityType(final StartElement start, final XMLEventReader reader) throws XMLStreamException {
     final EntityType entityType = new EntityType(start.getAttributeByName(new QName("Name")).getValue());
     final Attribute baseType = start.getAttributeByName(new QName("BaseType"));
@@ -348,16 +276,6 @@ public class Metadata extends AbstractMetadataElement {
       property.setType(type.getValue());
     }
 
-    final Attribute relationship = start.getAttributeByName(new QName("Relationship"));
-    if (relationship != null) {
-      property.setReleationship(relationship.getValue());
-    }
-
-    final Attribute toRole = start.getAttributeByName(new QName("ToRole"));
-    if (toRole != null) {
-      property.setToRole(toRole.getValue());
-    }
-
     return property;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java b/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
index 0e27dc1..e0cf627 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
@@ -21,19 +21,8 @@ package org.apache.olingo.fit.metadata;
 public class NavigationProperty extends AbstractMetadataElement {
 
   private final String name;
-
-  // -----------------------
-  // just for v3
-  // -----------------------
-  private String releationship;
-
-  private String toRole;
-  // -----------------------
-
   private String type;
-
   private String target;
-
   private boolean entitySet;
 
   public NavigationProperty(final String name) {
@@ -44,22 +33,6 @@ public class NavigationProperty extends AbstractMetadataElement {
     return name;
   }
 
-  public String getReleationship() {
-    return releationship;
-  }
-
-  public void setReleationship(final String releationship) {
-    this.releationship = releationship;
-  }
-
-  public String getToRole() {
-    return toRole;
-  }
-
-  public void setToRole(final String toRole) {
-    this.toRole = toRole;
-  }
-
   public String getType() {
     return type;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
index 9a23f40..368894f 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
@@ -25,18 +25,13 @@ import java.util.Map;
 public class Schema extends AbstractMetadataElement {
 
   private final String namespace;
-
   private final Map<String, Container> containers;
-
-  private final Map<String, Association> associations;
-
   private final Map<String, EntityType> entityTypes;
 
   public Schema(final String namespace) {
     this.namespace = namespace;
     entityTypes = new HashMap<String, EntityType>();
     containers = new HashMap<String, Container>();
-    associations = new HashMap<String, Association>();
   }
 
   public String getNamespace() {
@@ -68,13 +63,4 @@ public class Schema extends AbstractMetadataElement {
     containers.put(name, container);
     return this;
   }
-
-  public Association getAssociation(final String name) {
-    return associations.get(name);
-  }
-
-  public Schema addAssociation(final String name, final Association association) {
-    associations.put(name, association);
-    return this;
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java b/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java
deleted file mode 100644
index 8115826..0000000
--- a/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java
+++ /dev/null
@@ -1,33 +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.fit.methods;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.ws.rs.HttpMethod;
-
-@Target({ ElementType.METHOD })
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod("MERGE")
-public @interface MERGE {
-  // No additional methods needed for now.
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/main/java/org/apache/olingo/fit/utils/Constants.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/Constants.java b/fit/src/main/java/org/apache/olingo/fit/utils/Constants.java
index c2eaa7d..d0915a4 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/Constants.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/Constants.java
@@ -26,52 +26,35 @@ import java.util.Map;
 
 public class Constants {
 
-  private final static Map<ConstantKey, String> v4constants = new EnumMap<ConstantKey, String>(ConstantKey.class);
-
-  private final static Map<ConstantKey, String> constants = new EnumMap<ConstantKey, String>(ConstantKey.class);
+  private static Map<ConstantKey, String> constants = new EnumMap<ConstantKey, String>(ConstantKey.class);
 
   /**
    * CR/LF.
    */
   public static final byte[] CRLF = { 13, 10 };
-
   public static final Charset ENCODING = Charset.forName("UTF-8");
-
   public static final CharsetDecoder DECODER = ENCODING.newDecoder();
 
   static {
     DECODER.onMalformedInput(CodingErrorAction.IGNORE);
     DECODER.onUnmappableCharacter(CodingErrorAction.IGNORE);
 
-    // -----------------------------
-    // V4 only
-    // -----------------------------
-    v4constants.put(ConstantKey.JSON_ID_NAME, "@odata.id");
-    v4constants.put(ConstantKey.JSON_TYPE_NAME, "@odata.type");
-    v4constants.put(ConstantKey.JSON_NAVIGATION_SUFFIX, "@odata.navigationLink");
-    v4constants.put(ConstantKey.JSON_EDITLINK_NAME, "@odata.editLink");
-    v4constants.put(ConstantKey.DATASERVICES_NS, "http://docs.oasis-open.org/odata/ns/dataservices");
-    v4constants.put(ConstantKey.METADATA_NS, "http://docs.oasis-open.org/odata/ns/metadata");
-    v4constants.put(ConstantKey.GEORSS_NS, "http://www.georss.org/georss");
-    v4constants.put(ConstantKey.GML_NS, "http://www.opengis.net/gml");
-    v4constants.put(ConstantKey.EDM_NS, "http://docs.oasis-open.org/odata/ns/edm");
-    v4constants.put(ConstantKey.ATOM_LINK_REL, "http://docs.oasis-open.org/odata/ns/related/");
-    v4constants.put(ConstantKey.ODATA_SERVICE_VERSION, "OData-Version");
-    v4constants.put(ConstantKey.DEFAULT_SERVICE_URL, "http://localhost:9080/stub/StaticService/V40/Static.svc/");
-    v4constants.put(ConstantKey.ODATA_METADATA_PREFIX,
+    constants.put(ConstantKey.JSON_ID_NAME, "@odata.id");
+    constants.put(ConstantKey.JSON_TYPE_NAME, "@odata.type");
+    constants.put(ConstantKey.JSON_NAVIGATION_SUFFIX, "@odata.navigationLink");
+    constants.put(ConstantKey.JSON_EDITLINK_NAME, "@odata.editLink");
+    constants.put(ConstantKey.DATASERVICES_NS, "http://docs.oasis-open.org/odata/ns/dataservices");
+    constants.put(ConstantKey.METADATA_NS, "http://docs.oasis-open.org/odata/ns/metadata");
+    constants.put(ConstantKey.GEORSS_NS, "http://www.georss.org/georss");
+    constants.put(ConstantKey.GML_NS, "http://www.opengis.net/gml");
+    constants.put(ConstantKey.EDM_NS, "http://docs.oasis-open.org/odata/ns/edm");
+    constants.put(ConstantKey.ATOM_LINK_REL, "http://docs.oasis-open.org/odata/ns/related/");
+    constants.put(ConstantKey.ODATA_SERVICE_VERSION, "OData-Version");
+    constants.put(ConstantKey.DEFAULT_SERVICE_URL, "http://localhost:9080/stub/StaticService/V40/Static.svc/");
+    constants.put(ConstantKey.ODATA_METADATA_PREFIX,
         "http://localhost:9080/stub/StaticService/V40/Static.svc/$metadata#");
-    v4constants.put(ConstantKey.ODATA_METADATA_ENTITY_SUFFIX, "/$entity");
-    // -----------------------------
-
-    // -----------------------------
-    // V3 and defaults
-    // -----------------------------
-    constants.put(ConstantKey.ODATA_SERVICE_VERSION, "DataServiceVersion");
-    constants.put(ConstantKey.DEFAULT_SERVICE_URL, "http://localhost:9080/stub/StaticService/V30/Static.svc/");
+    constants.put(ConstantKey.ODATA_METADATA_ENTITY_SUFFIX, "/$entity");
     constants.put(ConstantKey.ODATA_COUNT_NAME, "odata.count");
-    constants.put(ConstantKey.ODATA_METADATA_PREFIX,
-        "http://localhost:9080/stub/StaticService/V30/Static.svc/$metadata#");
-    constants.put(ConstantKey.ODATA_METADATA_ENTITY_SUFFIX, "/@Element");
     constants.put(ConstantKey.ATOM_DEF_TYPE, "Edm.String");
     constants.put(ConstantKey.ATOM_PROPERTY_PREFIX, "d:");
     constants.put(ConstantKey.ATOM_METADATA_PREFIX, "m:");
@@ -79,7 +62,6 @@ public class Constants {
     constants.put(ConstantKey.ATOM_DATASERVICE_NS, "xmlns:d");
     constants.put(ConstantKey.ATOM_LINK_ENTRY, "application/atom+xml;type=entry");
     constants.put(ConstantKey.ATOM_LINK_FEED, "application/atom+xml;type=feed");
-    constants.put(ConstantKey.ATOM_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/related/");
     constants.put(ConstantKey.TYPE, "m:type");
     constants.put(ConstantKey.INLINE_LOCAL, "inline");
     constants.put(ConstantKey.INLINE_FILE_PATH, "inline");
@@ -88,11 +70,6 @@ public class Constants {
     constants.put(ConstantKey.CONTENT, "content");
     constants.put(ConstantKey.PROPERTIES, "m:properties");
     constants.put(ConstantKey.LINK, "link");
-    constants.put(ConstantKey.METADATA_NS, "http://schemas.microsoft.com/ado/2007/08/dataservices/metadta");
-    constants.put(ConstantKey.DATASERVICES_NS, "http://schemas.microsoft.com/ado/2007/08/dataservices");
-    constants.put(ConstantKey.GEORSS_NS, "http://www.georss.org/georss");
-    constants.put(ConstantKey.GML_NS, "http://www.opengis.net/gml");
-    constants.put(ConstantKey.EDM_NS, "http://schemas.microsoft.com/ado/2009/11/edm");
     constants.put(ConstantKey.METADATA, "metadata");
     constants.put(ConstantKey.SERVICES, "services");
     constants.put(ConstantKey.FEED, "feed");
@@ -107,17 +84,12 @@ public class Constants {
     constants.put(ConstantKey.JSON_NEXTLINK_SUFFIX, "@odata.nextLink");
     constants.put(ConstantKey.JSON_ODATAMETADATA_NAME, "odata.metadata");
     constants.put(ConstantKey.JSON_NAVIGATION_BIND_SUFFIX, "@odata.bind");
-    constants.put(ConstantKey.JSON_NAVIGATION_SUFFIX, "@odata.navigationLinkUrl");
     constants.put(ConstantKey.JSON_MEDIA_SUFFIX, "@odata.mediaEditLink");
-    constants.put(ConstantKey.JSON_TYPE_NAME, "odata.type");
     constants.put(ConstantKey.JSON_TYPE_SUFFIX, "@odata.type");
-    constants.put(ConstantKey.JSON_ID_NAME, "odata.id");
-    constants.put(ConstantKey.JSON_EDITLINK_NAME, "odata.editLink");
     constants.put(ConstantKey.XHTTP_HEADER_NAME, "X-HTTP-METHOD");
-    // -----------------------------
   }
 
   public static String get(final ConstantKey key) {
-    return (!v4constants.containsKey(key) ? constants : v4constants).get(key);
+    return constants.get(key);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/fit/src/test/java/org/apache/olingo/fit/base/EntityUpdateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/base/EntityUpdateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/base/EntityUpdateTestITCase.java
index aa2bc06..d1abb08 100644
--- a/fit/src/test/java/org/apache/olingo/fit/base/EntityUpdateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/base/EntityUpdateTestITCase.java
@@ -79,7 +79,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
 
   @Test
   @Ignore
-  public void testUpateSingleValuedNavtiogationReference() throws Exception {
+  public void updateSingleValuedNavigationReference() throws Exception {
     URI targetURI =
         getClient().newURIBuilder(testStaticServiceRootURL)
         .appendEntitySetSegment("People")

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c7aa842f/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
index 7c9c69d..3541a3d 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
@@ -36,25 +36,25 @@ public interface EdmConstantExpression extends EdmExpression {
   Object asPrimitive();
 
   /**
-   * A list of enum members or empty list if this expression is of type primitve or geospatial.
+   * A list of enum members or empty list if this expression is of type primitive or geospatial.
    * @return a list of all enum members or empty list
    */
   List<String> asEnumMembers();
 
   /**
-   * Return the Enum type name or null if this expression is of type primitve or geospatial.
+   * Return the Enum type name or null if this expression is of type primitive or geospatial.
    * @return enum type name or null
    */
   String getEnumTypeName();
 
   /**
-   * Return the geospatial object or null if this expression is of type primitve or enum.
+   * Return the geospatial object or null if this expression is of type primitive or enum.
    * @return geospatial object or null
    */
   Geospatial asGeospatial();
 
   /**
-   * Returns the value of the expression as String
+   * Returns the value of the expression as String.
    * @return String representation of the expression
    */
   String getValueAsString();


[21/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] $expand parser in Java + clean-up

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
deleted file mode 100644
index 1bab218..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
+++ /dev/null
@@ -1,2313 +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.server.core.uri.parser;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.antlr.v4.runtime.misc.NotNull;
-import org.antlr.v4.runtime.misc.ParseCancellationException;
-import org.antlr.v4.runtime.tree.ParseTree;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmAction;
-import org.apache.olingo.commons.api.edm.EdmActionImport;
-import org.apache.olingo.commons.api.edm.EdmComplexType;
-import org.apache.olingo.commons.api.edm.EdmElement;
-import org.apache.olingo.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmEnumType;
-import org.apache.olingo.commons.api.edm.EdmFunction;
-import org.apache.olingo.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.EdmProperty;
-import org.apache.olingo.commons.api.edm.EdmReturnType;
-import org.apache.olingo.commons.api.edm.EdmSingleton;
-import org.apache.olingo.commons.api.edm.EdmStructuredType;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.commons.api.ex.ODataRuntimeException;
-import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriInfoResource;
-import org.apache.olingo.server.api.uri.UriParameter;
-import org.apache.olingo.server.api.uri.UriResource;
-import org.apache.olingo.server.api.uri.UriResourceEntitySet;
-import org.apache.olingo.server.api.uri.UriResourceFunction;
-import org.apache.olingo.server.api.uri.UriResourceNavigation;
-import org.apache.olingo.server.api.uri.UriResourcePartTyped;
-import org.apache.olingo.server.api.uri.UriResourceRoot;
-import org.apache.olingo.server.api.uri.queryoption.SelectItem;
-import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.UriParameterImpl;
-import org.apache.olingo.server.core.uri.UriResourceActionImpl;
-import org.apache.olingo.server.core.uri.UriResourceComplexPropertyImpl;
-import org.apache.olingo.server.core.uri.UriResourceCountImpl;
-import org.apache.olingo.server.core.uri.UriResourceEntitySetImpl;
-import org.apache.olingo.server.core.uri.UriResourceFunctionImpl;
-import org.apache.olingo.server.core.uri.UriResourceImpl;
-import org.apache.olingo.server.core.uri.UriResourceItImpl;
-import org.apache.olingo.server.core.uri.UriResourceLambdaAllImpl;
-import org.apache.olingo.server.core.uri.UriResourceLambdaAnyImpl;
-import org.apache.olingo.server.core.uri.UriResourceLambdaVarImpl;
-import org.apache.olingo.server.core.uri.UriResourceNavigationPropertyImpl;
-import org.apache.olingo.server.core.uri.UriResourcePrimitivePropertyImpl;
-import org.apache.olingo.server.core.uri.UriResourceRefImpl;
-import org.apache.olingo.server.core.uri.UriResourceRootImpl;
-import org.apache.olingo.server.core.uri.UriResourceSingletonImpl;
-import org.apache.olingo.server.core.uri.UriResourceStartingTypeFilterImpl;
-import org.apache.olingo.server.core.uri.UriResourceTypedImpl;
-import org.apache.olingo.server.core.uri.UriResourceValueImpl;
-import org.apache.olingo.server.core.uri.UriResourceWithKeysImpl;
-import org.apache.olingo.server.core.uri.antlr.UriLexer;
-import org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AllEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AllExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltAddContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltAllContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltAndContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltAnyContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltComparismContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltEqualityContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltHasContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltMultContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltOrContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.AnyExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ArrayOrObjectContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.BinaryLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.BooleanNonCaseLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.CastExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.CeilingMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ConcatMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ConstSegmentContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ContainsMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.DateLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.DateMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.DatetimeoffsetLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.DayMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.DecimalLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.DurationLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.EndsWithMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.EntityEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.EnumLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandCountOptionContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemsContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemsEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandOptionContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathExtensionContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandRefOptionContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.FilterContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.FilterExpressionEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.FloorMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.FractionalsecondsMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.GeoDistanceMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.GeoIntersectsMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.GeoLengthMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.GuidLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.HourMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.IndexOfMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.InlinecountContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.IntLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.IsofExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.LengthMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.LevelsContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.MaxDateTimeMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.MemberExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.MetadataEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.MinDateTimeMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.MinuteMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.MonthMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.NameValueOptListContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.NameValuePairContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.NamespaceContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.NaninfinityLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.NowMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.NullruleLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.OrderByContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.OrderByEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.OrderByItemContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.OrderListContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.PathSegmentContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.PathSegmentsContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.PrimitiveLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.QueryOptionContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.QueryOptionsContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.RootExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.RoundMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SearchSpecialTokenContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SecondMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectEOFContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectItemContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectSegmentContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SkipContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SkiptokenContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.StartsWithMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.StringLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.SubstringMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.TimeMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.TimeofdayLiteralContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ToLowerMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.ToUpperMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.TopContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.TotalOffsetMinutesMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.TotalsecondsMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.TrimMethodCallExprContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser.YearMethodCallExprContext;
-import org.apache.olingo.server.core.uri.parser.UriParserSemanticException.MessageKeys;
-import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandItemImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.LevelsOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.OrderByItemImpl;
-import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.QueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectItemImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SkipTokenOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SystemQueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.TopOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.AliasImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.BinaryImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.EnumerationImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.MemberImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.MethodImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.TypeLiteralImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.UnaryImpl;
-
-/**
- * Converts the URI parse tree as generated by ANTLR into an internal representation
- * suitable to give to an application.
- * While converting the tree is only validated against the EDM if necessary.
- * <br>
- * Attention:
- * <ul>
- * <li>This UriVisitor is at somes point more lax than the original ABNF.</li>
- * <li>It is more tolerable against additional white spaces.</li>
- * </ul>
- * Currently not supported are
- * <ul>
- * <li>parsing the context of $metadata</li>
- * <li>parsing $search</li>
- * </ul>
- */
-public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
-
-  public UriContext context = null;
-
-  public Edm edm;
-
-  public EdmEntityContainer edmEntityContainer;
-
-  // --- class ---
-  public UriParseTreeVisitor(final Edm edm, final UriContext context) {
-    this.edm = edm;
-    this.context = context;
-    edmEntityContainer = edm.getEntityContainer();
-  }
-
-  @Override
-  protected Object aggregateResult(final Object aggregate, final Object nextResult) {
-    if (aggregate != null) {
-      return aggregate;
-    } else {
-      return nextResult;
-    }
-  }
-
-  private FullQualifiedName getFullNameFromContext(final NamespaceContext vNS, final String odi) {
-    String namespace = vNS.getText();
-    namespace = namespace.substring(0, namespace.length() - 1); // vNS contains a trailing point that has to be removed
-    return new FullQualifiedName(namespace, odi);
-  }
-
-  private UriContext.LambdaVariable getLambdaVar(final String odi) {
-    for (UriContext.LambdaVariable item : context.allowedLambdaVariables) {
-      if (item.name.equals(odi)) {
-        return item;
-      }
-    }
-    return null;
-  }
-
-  public UriResourceTypedImpl readResourcePathSegment(final PathSegmentContext ctx) {
-
-    final boolean checkFirst =
-        context.contextUriInfo.getLastResourcePart() == null
-            || context.contextUriInfo.getLastResourcePart() instanceof UriResourceRootImpl;
-
-    String odi = ctx.vODI.getText();
-
-    boolean searchInContainer = true;
-    // validate if context type and according property is available
-    // otherwise search in container for first element
-    if (checkFirst && ctx.vNS == null && !context.contextTypes.isEmpty()) {
-      EdmType sourceType = context.contextTypes.peek();
-      if (sourceType instanceof EdmStructuredType) {
-        EdmStructuredType str = (EdmStructuredType) sourceType;
-        EdmElement property = str.getProperty(odi);
-        if (property != null) {
-          searchInContainer = false;
-        }
-      }
-    }
-
-    if (searchInContainer) {
-      final List<UriResource> parts = context.contextUriInfo.getUriResourceParts();
-      // check EntitySet
-      EdmEntitySet edmEntitySet = edmEntityContainer.getEntitySet(odi);
-      if (edmEntitySet != null
-          && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
-        ensureNamespaceIsNull(ctx.vNS);
-        context.contextUriInfo.addResourcePart(
-            new UriResourceEntitySetImpl(edmEntitySet));
-        return null;
-      }
-
-      // check Singleton
-      EdmSingleton edmSingleton = edmEntityContainer.getSingleton(odi);
-      if (edmSingleton != null
-          && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
-        ensureNamespaceIsNull(ctx.vNS);
-        context.contextUriInfo.addResourcePart(
-            new UriResourceSingletonImpl(edmSingleton));
-        return null;
-      }
-
-      // check ActionImport
-      EdmActionImport edmActionImport = edmEntityContainer.getActionImport(odi);
-      if (edmActionImport != null
-          && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
-        ensureNamespaceIsNull(ctx.vNS);
-        context.contextUriInfo.addResourcePart(
-            new UriResourceActionImpl(edmActionImport));
-        return null;
-      }
-
-      // check FunctionImport
-      EdmFunctionImport edmFunctionImport = edmEntityContainer.getFunctionImport(odi);
-      
-      if(edmFunctionImport != null && context.contextReadingQueryPart) {
-        throw wrap(new UriParserSemanticException("Function Imports are not allowed in $filter or $orderby", 
-            UriParserSemanticException.MessageKeys.FUNCTION_IMPORT_NOT_ALLOWED, odi));
-      }
-      
-      if (edmFunctionImport != null
-          && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
-
-        // read the URI parameters
-        if (ctx.vlNVO.isEmpty()) {
-          throw wrap(new UriParserSyntaxException(
-              "Function imports must have a (possibly empty) parameter list written in parentheses",
-              UriParserSyntaxException.MessageKeys.SYNTAX));
-        }
-        context.contextReadingFunctionParameters = true;
-        @SuppressWarnings("unchecked")
-        List<UriParameter> parameters = (List<UriParameter>) ctx.vlNVO.get(0).accept(this);
-        context.contextReadingFunctionParameters = false;
-
-        // mark parameters as consumed
-        ctx.vlNVO.remove(0);
-
-        // collect parameter names
-        List<String> names = new ArrayList<String>();
-        for (UriParameter item : parameters) {
-          names.add(item.getName());
-        }
-
-        // get function from function import
-        EdmFunction function = edmFunctionImport.getUnboundFunction(names);
-        if (function == null) {
-          StringBuilder tmp = new StringBuilder();
-          for (String name : names) {
-            tmp.append((tmp.length() != 0 ? "," : "")).append(name);
-          }
-          throw wrap(new UriParserSemanticException("Function of functionimport '" + edmFunctionImport.getName()
-              + "' with parameters [" + tmp.toString() + "] not found",
-              UriParserSemanticException.MessageKeys.FUNCTION_NOT_FOUND, edmFunctionImport.getName(), tmp.toString()));
-        }
-
-        ensureNamespaceIsNull(ctx.vNS);
-        UriResourceFunctionImpl uriResource = new UriResourceFunctionImpl(edmFunctionImport,
-            edmFunctionImport.getUnboundFunction(names),
-            parameters);
-        context.contextUriInfo.addResourcePart(uriResource);
-        return null;
-      }
-    }
-
-    EdmType sourceType;
-    boolean sourceIsCollection = false;
-    final UriResource lastResourcePart = context.contextUriInfo.getLastResourcePart();
-
-    if (lastResourcePart == null) {
-      if (context.contextTypes.isEmpty()) {
-        if (checkFirst && ctx.vNS == null) {
-          throw wrap(new UriParserSemanticException(
-              "Cannot find EntitySet, Singleton, ActionImport or FunctionImport with name '" + odi + "'.",
-              UriParserSemanticException.MessageKeys.RESOURCE_NOT_FOUND, odi));
-        }
-        throw wrap(new UriParserSemanticException(
-            "Resource part '" + odi + "' can only applied on typed resource parts",
-            UriParserSemanticException.MessageKeys.RESOURCE_PART_ONLY_FOR_TYPED_PARTS, odi));
-      }
-      sourceType = context.contextTypes.peek();
-      sourceIsCollection = context.isCollection;
-    } else if (lastResourcePart instanceof UriResourcePartTyped) {
-      sourceType = ParserHelper.getTypeInformation((UriResourcePartTyped) lastResourcePart);
-      sourceIsCollection = ((UriResourcePartTyped) lastResourcePart).isCollection();
-    } else {
-      throw wrap(new UriParserSemanticException(
-          "Resource part '" + odi + "' can only be applied on typed resource parts.",
-          UriParserSemanticException.MessageKeys.RESOURCE_PART_ONLY_FOR_TYPED_PARTS, odi));
-    }
-
-    if (ctx.vNS == null) { // without namespace
-
-      // first check for lambda variable because a newly add property should not shadow a long used lambda variable
-      UriContext.LambdaVariable lVar = getLambdaVar(odi);
-      if (lVar != null) {
-        UriResourceLambdaVarImpl lambdaResource = new UriResourceLambdaVarImpl(lVar.name, lVar.type);
-        context.contextUriInfo.addResourcePart(lambdaResource);
-        return null;
-      }
-
-      if (!(sourceType instanceof EdmStructuredType)) {
-        throw wrap(new UriParserSemanticException(
-            "Cannot parse '" + odi + "'; previous path segment is not a structural type.",
-            UriParserSemanticException.MessageKeys.RESOURCE_PART_MUST_BE_PRECEDED_BY_STRUCTURAL_TYPE, odi));
-      }
-
-      if ((ctx.depth() <= 2 // path evaluation for the resource path
-          || lastResourcePart instanceof UriResourceTypedImpl
-          || lastResourcePart instanceof UriResourceNavigationPropertyImpl)
-          && sourceIsCollection) {
-        throw wrap(new UriParserSemanticException("Property '" + odi + "' is not allowed after collection.",
-            UriParserSemanticException.MessageKeys.PROPERTY_AFTER_COLLECTION, odi));
-      }
-
-      EdmStructuredType structType = (EdmStructuredType) sourceType;
-
-      EdmElement property = structType.getProperty(odi);
-      if (property == null) {
-        throw wrap(new UriParserSemanticException("Property '" + odi + "' not found in type '"
-            + structType.getFullQualifiedName().getFullQualifiedNameAsString() + "'",
-            ctx.depth() > 2 ? // path evaluation inside an expression or for the resource path?
-                UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE
-                : UriParserSemanticException.MessageKeys.PROPERTY_NOT_IN_TYPE,
-            structType.getFullQualifiedName().getFullQualifiedNameAsString(), odi));
-      }
-
-      if (property instanceof EdmProperty) {
-        if (((EdmProperty) property).isPrimitive()
-            || property.getType().getKind() == EdmTypeKind.ENUM
-            || property.getType().getKind() == EdmTypeKind.DEFINITION) {
-          // create simple property
-          UriResourcePrimitivePropertyImpl simpleResource =
-              new UriResourcePrimitivePropertyImpl((EdmProperty) property);
-          context.contextUriInfo.addResourcePart(simpleResource);
-          return null;
-        } else {
-          // create complex property
-          UriResourceComplexPropertyImpl complexResource = new UriResourceComplexPropertyImpl((EdmProperty) property);
-          context.contextUriInfo.addResourcePart(complexResource);
-          return null;
-        }
-      } else if (property instanceof EdmNavigationProperty) {
-        // create navigation property
-        if (context.contextVisitExpandResourcePath && ctx.vlNVO.size() > 0) {
-          throw wrap(new UriParserSemanticException(
-              "Navigation properties in expand system query options must not be followed by a key.",
-              UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
-        }
-
-        UriResourceNavigationPropertyImpl navigationResource =
-            new UriResourceNavigationPropertyImpl((EdmNavigationProperty) property);
-        context.contextUriInfo.addResourcePart(navigationResource);
-        return null;
-      } else {
-        throw wrap(new UriParserSemanticException("Unkown type for property '" + property + "'",
-            UriParserSemanticException.MessageKeys.UNKNOWN_PROPERTY_TYPE, property.getName()));
-      }
-
-    } else { // with namespace
-
-      FullQualifiedName fullFilterName = getFullNameFromContext(ctx.vNS, odi);
-
-      // EdmType lastType = getLastType(lastTyped);
-      if (sourceType instanceof EdmEntityType) {
-
-        EdmEntityType filterEntityType = edm.getEntityType(fullFilterName);
-        if (filterEntityType != null) {
-          // is entity type cast
-          if (!(filterEntityType.compatibleTo(sourceType))) {
-            throw wrap(new UriParserSemanticException(
-                "Entity typefilter not compatible to previous path segment: " + fullFilterName.toString(),
-                UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER, fullFilterName.toString()));
-          }
-
-          if (lastResourcePart == null) {
-            // this may be the case if a member expression within a filter starts with a typeCast
-            UriResourceStartingTypeFilterImpl uriResource = new UriResourceStartingTypeFilterImpl(
-                filterEntityType,
-                sourceIsCollection);
-            if (sourceIsCollection) {
-              uriResource.setCollectionTypeFilter(filterEntityType);
-            } else {
-              uriResource.setEntryTypeFilter(filterEntityType);
-            }
-            context.contextUriInfo.addResourcePart(uriResource);
-            return null;
-          } else {
-
-            // check if last segment may contain key properties
-            if (lastResourcePart instanceof UriResourceWithKeysImpl) {
-              UriResourceWithKeysImpl lastPartWithKeys = (UriResourceWithKeysImpl) lastResourcePart;
-
-              if (!lastPartWithKeys.isCollection()) {
-                if (lastPartWithKeys.getTypeFilterOnEntry() != null) {
-                  throw wrap(new UriParserSemanticException("Entry typefilters are not chainable, used '"
-                      + getName(filterEntityType) + "' behind '"
-                      + getName(lastPartWithKeys.getTypeFilterOnEntry()) + "'",
-                      UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
-                      getName(lastPartWithKeys.getTypeFilterOnEntry()), getName(filterEntityType)));
-                }
-                lastPartWithKeys.setEntryTypeFilter(filterEntityType);
-                return null;
-              } else {
-                if (lastPartWithKeys.getTypeFilterOnCollection() != null) {
-                  throw wrap(new UriParserSemanticException("Collection typefilters are not chainable, used '"
-                      + getName(filterEntityType) + "' behind '"
-                      + getName(lastPartWithKeys.getTypeFilterOnCollection()) + "'",
-                      UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
-                      getName(lastPartWithKeys.getTypeFilterOnCollection()), getName(filterEntityType)));
-                }
-                lastPartWithKeys.setCollectionTypeFilter(filterEntityType);
-                return null;
-              }
-            } else if (lastResourcePart instanceof UriResourceTypedImpl) {
-              UriResourceTypedImpl lastPartTyped = (UriResourceTypedImpl) lastResourcePart;
-              if (lastPartTyped.getTypeFilter() != null) {
-                throw wrap(new UriParserSemanticException("Typefilters are not chainable, used '"
-                    + getName(filterEntityType) + "' behind '"
-                    + getName(lastPartTyped.getTypeFilter()) + "'",
-                    UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
-                    getName(lastPartTyped.getTypeFilter()), getName(filterEntityType)));
-              }
-
-              lastPartTyped.setTypeFilter(filterEntityType);
-              return null;
-            } else {
-              throw wrap(new UriParserSemanticException("Path segment before '" + getName(filterEntityType)
-                  + "' not typed",
-                  UriParserSemanticException.MessageKeys.PREVIOUS_PART_NOT_TYPED, getName(filterEntityType)));
-            }
-          }
-        }
-
-      } else if (sourceType instanceof EdmComplexType) {
-
-        EdmComplexType filterComplexType = edm.getComplexType(fullFilterName);
-
-        if (filterComplexType != null) {
-
-          // is complex type cast
-          if (!(filterComplexType.compatibleTo(sourceType))) {
-            throw wrap(new UriParserSemanticException(
-                "Complex typefilter '" + getName(sourceType) + "'not compatible type of previous path segment '"
-                    + getName(filterComplexType) + "'",
-                UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER, getName(sourceType)));
-          }
-
-          // is simple complex type cast
-          if (lastResourcePart == null) {
-            // this may be the case if a member expression within a filter starts with a typeCast
-            UriResourceStartingTypeFilterImpl uriResource =
-                new UriResourceStartingTypeFilterImpl(filterComplexType, sourceIsCollection);
-
-            if (sourceIsCollection) {
-              uriResource.setCollectionTypeFilter(filterComplexType);
-            } else {
-              uriResource.setEntryTypeFilter(filterComplexType);
-            }
-            context.contextUriInfo.addResourcePart(uriResource);
-            return null;
-          } else {
-            if (lastResourcePart instanceof UriResourceWithKeysImpl) {
-              // e.g. in case of function returning complex data or a list of complex data
-              UriResourceWithKeysImpl lastPartWithKeys = (UriResourceWithKeysImpl) lastResourcePart;
-
-              if (!lastPartWithKeys.isCollection()) {
-                if (lastPartWithKeys.getTypeFilterOnEntry() != null) {
-                  throw wrap(new UriParserSemanticException("Entry typefilters are not chainable, used '"
-                      + getName(filterComplexType) + "' behind '"
-                      + getName(lastPartWithKeys.getTypeFilterOnEntry()) + "'",
-                      UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
-                      getName(lastPartWithKeys.getTypeFilterOnEntry()), getName(filterComplexType)));
-                }
-                lastPartWithKeys.setEntryTypeFilter(filterComplexType);
-                return null;
-              } else {
-                if (lastPartWithKeys.getTypeFilterOnCollection() != null) {
-                  throw wrap(new UriParserSemanticException("Collection typefilters are not chainable, used '"
-                      + getName(filterComplexType) + "' behind '"
-                      + getName(lastPartWithKeys.getTypeFilterOnCollection()) + "'",
-                      UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
-                      getName(lastPartWithKeys.getTypeFilterOnCollection()), getName(filterComplexType)));
-                }
-                lastPartWithKeys.setCollectionTypeFilter(filterComplexType);
-                return null;
-              }
-
-            } else if (lastResourcePart instanceof UriResourceTypedImpl) {
-              UriResourceTypedImpl lastPartTyped = (UriResourceTypedImpl) lastResourcePart;
-              if (lastPartTyped.getTypeFilter() != null) {
-                throw wrap(new UriParserSemanticException("Typefilters are not chainable, used '"
-                    + getName(filterComplexType) + "' behind '"
-                    + getName(lastPartTyped.getTypeFilter()) + "'",
-                    UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
-                    getName(lastPartTyped.getTypeFilter()), getName(filterComplexType)));
-              }
-
-              lastPartTyped.setTypeFilter(filterComplexType);
-              return null;
-            } else {
-              throw wrap(new UriParserSemanticException("Path segment before '" + getName(filterComplexType)
-                  + "' not typed",
-                  UriParserSemanticException.MessageKeys.PREVIOUS_PART_NOT_TYPED, getName(filterComplexType)));
-            }
-          }
-        }
-      }
-
-      FullQualifiedName fullBindingTypeName = sourceType.getFullQualifiedName();
-
-      // check for action
-      EdmAction action = edm.getBoundAction(fullFilterName, fullBindingTypeName, sourceIsCollection);
-      if (action != null) {
-        UriResourceActionImpl pathInfoAction = new UriResourceActionImpl(action);
-        context.contextUriInfo.addResourcePart(pathInfoAction);
-        return null;
-      }
-
-      // do a check for bound functions (which requires a parameter list)
-      if (ctx.vlNVO.size() == 0) {
-        throw wrap(new UriParserSemanticException("Unknown type for type cast " + fullFilterName.toString()
-            + " not found", UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, fullFilterName.toString()));
-      }
-
-      context.contextReadingFunctionParameters = true;
-      @SuppressWarnings("unchecked")
-      List<UriParameter> parameters = (List<UriParameter>) ctx.vlNVO.get(0).accept(this);
-      context.contextReadingFunctionParameters = false;
-
-      // get names of function parameters
-      List<String> names = new ArrayList<String>();
-      for (UriParameter item : parameters) {
-        names.add(item.getName());
-      }
-
-      EdmFunction function = edm.getBoundFunction(fullFilterName, fullBindingTypeName, sourceIsCollection, names);
-
-      if (function != null) {
-        UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl(null, function, parameters);
-        context.contextUriInfo.addResourcePart(pathInfoFunction);
-
-        // mark parameters as consumed
-        ctx.vlNVO.remove(0);
-        return null;
-      }
-
-      // check for unbound function in the $filter case ( where the previous resource segment is a $it)
-      function = edm.getUnboundFunction(fullFilterName, names);
-
-      if (function != null) {
-        UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl(null, function, parameters);
-        context.contextUriInfo.addResourcePart(pathInfoFunction);
-
-        // mark parameters as consumed
-        ctx.vlNVO.remove(0);
-        return null;
-      }
-
-      throw wrap(new UriParserSemanticException("Unknown resource path segment:" + fullFilterName.toString(),
-          UriParserSemanticException.MessageKeys.UNKNOWN_PART, fullFilterName.toString()));
-    }
-  }
-
-  /**
-   * Ensures that the namespace of the first resource parts is null
-   * @param vNS namespace or null
-   */
-  private void ensureNamespaceIsNull(final NamespaceContext vNS) {
-    if (vNS != null && context.contextUriInfo.getLastResourcePart() == null) {
-      // First resource part and namespace is not null!
-      throw wrap(new UriParserSemanticException("Namespace is not allowed for EntitySets, Singeltons, "
-          + " Action Imports and Function Imports. Found " + vNS.getText(),
-          UriParserSemanticException.MessageKeys.NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT, vNS.getText()));
-    }
-  }
-
-  private String getName(final EdmType type) {
-    return type.getFullQualifiedName().getFullQualifiedNameAsString();
-  }
-
-  @Override
-  public Object visitAllEOF(final AllEOFContext ctx) {
-    context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.all);
-    return null;
-  }
-
-  @Override
-  public Object visitAllExpr(final AllExprContext ctx) {
-    UriResource obj = context.contextUriInfo.getLastResourcePart();
-    if (!(obj instanceof UriResourcePartTyped)) {
-      throw wrap(new UriParserSemanticException("all only allowed on typed path segments",
-          UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "all"));
-    } else if (obj instanceof UriResourceNavigation) {
-      if (!((UriResourceNavigation) obj).getKeyPredicates().isEmpty()) {
-        throw wrap(new UriParserSemanticException(
-            "Any lamdba expression must not be following navigation properties with key predicates.",
-            UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
-      }
-    }
-
-    UriContext.LambdaVariable var = new UriContext.LambdaVariable();
-    var.name = ctx.vLV.getText();
-    var.type = ParserHelper.getTypeInformation((UriResourcePartTyped) obj);
-
-    context.allowedLambdaVariables.push(var);
-    Expression expression = (Expression) ctx.vLE.accept(this);
-    context.allowedLambdaVariables.pop();
-    return new UriResourceLambdaAllImpl(var.name, expression);
-  }
-
-  @Override
-  public Expression visitAltAdd(final AltAddContext ctx) {
-    int tokenIndex = ctx.vO.getType();
-    return new BinaryImpl(
-        (Expression) ctx.vE1.accept(this),
-        tokenIndex == UriLexer.ADD ? BinaryOperatorKind.ADD : BinaryOperatorKind.SUB,
-        (Expression) ctx.vE2.accept(this),
-        null);
-  }
-
-  @Override
-  public Object visitAltAll(final AltAllContext ctx) {
-
-    UriInfoImpl uriInfoImplpath = new UriInfoImpl().setKind(UriInfoKind.resource);
-
-    uriInfoImplpath.addResourcePart((UriResourceImpl) super.visitAltAll(ctx));
-
-    EdmType startType = removeUriResourceStartingTypeFilterImpl(uriInfoImplpath);
-
-    return new MemberImpl(uriInfoImplpath, startType);
-  }
-
-  private EdmType removeUriResourceStartingTypeFilterImpl(final UriInfoImpl uriInfoImplpath) {
-
-    List<UriResource> segments = uriInfoImplpath.getUriResourceParts();
-    if (segments.size() == 0) {
-      return null;
-    }
-
-    UriResource segment = segments.get(0);
-    if (segment instanceof UriResourceStartingTypeFilterImpl) {
-      UriResourceStartingTypeFilterImpl startingTypeFilter = (UriResourceStartingTypeFilterImpl) segment;
-
-      EdmType type = null;
-      if (startingTypeFilter.getTypeFilterOnEntry() != null) {
-        type = startingTypeFilter.getTypeFilterOnEntry();
-      } else if (startingTypeFilter.getTypeFilterOnCollection() != null) {
-        type = startingTypeFilter.getTypeFilterOnCollection();
-      } else {
-        type = startingTypeFilter.getType();
-      }
-
-      uriInfoImplpath.removeResourcePart(0);
-      return type;
-    }
-
-    return null;
-  }
-
-  @Override
-  public Expression visitAltAnd(final AltAndContext ctx) {
-    return new BinaryImpl(
-        (Expression) ctx.vE1.accept(this),
-        BinaryOperatorKind.AND,
-        (Expression) ctx.vE2.accept(this),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean));
-  }
-
-  @Override
-  public Object visitAltAny(final AltAnyContext ctx) {
-    UriInfoImpl uriInfoImplpath = new UriInfoImpl().setKind(UriInfoKind.resource);
-
-    uriInfoImplpath.addResourcePart((UriResourceImpl) super.visitAltAny(ctx));
-
-    EdmType startType = removeUriResourceStartingTypeFilterImpl(uriInfoImplpath);
-
-    return new MemberImpl(uriInfoImplpath, startType);
-  }
-
-  @Override
-  public Expression visitAltComparism(final AltComparismContext ctx) {
-    int tokenIndex = ctx.vO.getType();
-    BinaryOperatorKind kind = null;
-    if (tokenIndex == UriLexer.GT) {
-      kind = BinaryOperatorKind.GT;
-    } else if (tokenIndex == UriLexer.GE) {
-      kind = BinaryOperatorKind.GE;
-    } else if (tokenIndex == UriLexer.LT) {
-      kind = BinaryOperatorKind.LT;
-    } else if (tokenIndex == UriLexer.LE) {
-      kind = BinaryOperatorKind.LE;
-    }
-    return new BinaryImpl(
-        (Expression) ctx.vE1.accept(this),
-        kind,
-        (Expression) ctx.vE2.accept(this),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean));
-  }
-
-  @Override
-  public Object visitEntityEOF(final EntityEOFContext ctx) {
-    String odi = ctx.vODI.getText();
-    FullQualifiedName fullName = getFullNameFromContext(ctx.vNS, odi);
-
-    EdmEntityType type = edm.getEntityType(fullName);
-    if (type == null) {
-      throw wrap(new UriParserSemanticException("Expected EntityTypeName",
-          UriParserSemanticException.MessageKeys.UNKNOWN_ENTITY_TYPE, fullName.toString()));
-    }
-    context.contextUriInfo.setEntityTypeCast(type);
-
-    // contextUriInfo = uriInfo;
-    context.contextTypes.push(context.contextUriInfo.getEntityTypeCast());
-    context.isCollection = true;  // TODO: check!
-
-    return null;
-  }
-
-  @Override
-  public Expression visitAltEquality(final AltEqualityContext ctx) {
-    int tokenIndex = ctx.vO.getType();
-    return new BinaryImpl(
-        (Expression) ctx.vE1.accept(this),
-        tokenIndex == UriLexer.EQ_ALPHA ? BinaryOperatorKind.EQ : BinaryOperatorKind.NE,
-        (Expression) ctx.vE2.accept(this),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean));
-  }
-
-  @Override
-  public Object visitAltHas(final AltHasContext ctx) {
-    return new BinaryImpl(
-        (Expression) ctx.vE1.accept(this),
-        BinaryOperatorKind.HAS,
-        (Expression) ctx.vE2.accept(this),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean));
-  }
-
-  @Override
-  public Object visitMetadataEOF(final MetadataEOFContext ctx) {
-
-    context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.metadata);
-    return null;
-  }
-
-  @Override
-  public Expression visitAltMult(final AltMultContext ctx) {
-    int tokenIndex = ctx.vO.getType();
-    BinaryOperatorKind kind;
-    if (tokenIndex == UriLexer.MUL) {
-      kind = BinaryOperatorKind.MUL;
-    } else if (tokenIndex == UriLexer.DIV) {
-      kind = BinaryOperatorKind.DIV;
-    } else {
-      kind = BinaryOperatorKind.MOD;
-    }
-    return new BinaryImpl(
-        (Expression) ctx.vE1.accept(this),
-        kind,
-        (Expression) ctx.vE2.accept(this),
-        null);
-  }
-
-  @Override
-  public Expression visitAltOr(final AltOrContext ctx) {
-    return new BinaryImpl(
-        (Expression) ctx.vE1.accept(this),
-        BinaryOperatorKind.OR,
-        (Expression) ctx.vE2.accept(this),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean));
-  }
-
-  @Override
-  public Object visitAnyExpr(final AnyExprContext ctx) {
-    if (ctx.vLV != null) {
-      UriResourceImpl lastResourcePart = (UriResourceImpl) context.contextUriInfo.getLastResourcePart();
-      if (!(lastResourcePart instanceof UriResourcePartTyped)) {
-        throw wrap(new UriParserSemanticException("any only allowed on typed path segments",
-            UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "any"));
-      } else if (lastResourcePart instanceof UriResourceNavigation) {
-        if (!((UriResourceNavigation) lastResourcePart).getKeyPredicates().isEmpty()) {
-          throw wrap(new UriParserSemanticException(
-              "Any lamdba expression must not be following navigation properties with key predicates",
-              UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
-        }
-      }
-
-      UriContext.LambdaVariable var = new UriContext.LambdaVariable();
-      var.name = ctx.vLV.getText();
-      var.type = ParserHelper.getTypeInformation((UriResourcePartTyped) lastResourcePart);
-
-      context.allowedLambdaVariables.push(var);
-      Expression expression = (Expression) ctx.vLE.accept(this);
-      context.allowedLambdaVariables.pop();
-      return new UriResourceLambdaAnyImpl(var.name, expression);
-    }
-    return null;
-  }
-
-  @Override
-  public Object visitBooleanNonCaseLiteral(final BooleanNonCaseLiteralContext ctx) {
-    final String text = ctx.getText().toLowerCase();
-    return new LiteralImpl(text.equals("false") ? "false" : "true",
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean));
-  }
-
-  @Override
-  public Expression visitCastExpr(final CastExprContext ctx) {
-    List<Expression> parameters = new ArrayList<Expression>();
-    if (ctx.vE1 != null) {
-      // is optional parameter
-      parameters.add((Expression) ctx.vE1.accept(this));
-    }
-
-    String namespace = ctx.vNS.getText();
-    namespace = namespace.substring(0, namespace.length() - 1);
-
-    FullQualifiedName fullName = new FullQualifiedName(namespace, ctx.vODI.getText());
-    EdmType type = getType(fullName);
-    parameters.add(new TypeLiteralImpl(type));
-    return new MethodImpl(MethodKind.CAST, parameters);
-  }
-
-  private EdmType getType(final FullQualifiedName fullName) {
-    EdmType type = null;
-
-    type = edm.getEntityType(fullName);
-    if (type != null) {
-      return type;
-    }
-
-    type = edm.getComplexType(fullName);
-    if (type != null) {
-      return type;
-    }
-
-    type = edm.getTypeDefinition(fullName);
-    if (type != null) {
-      return type;
-    }
-
-    type = edm.getEnumType(fullName);
-    if (type != null) {
-      return type;
-    }
-
-    if (fullName.getNamespace().equals(EdmPrimitiveType.EDM_NAMESPACE)) {
-      final EdmPrimitiveTypeKind typeKind = EdmPrimitiveTypeKind.valueOf(fullName.getName());
-      type = EdmPrimitiveTypeFactory.getInstance(typeKind);
-      if (type != null) {
-        return type;
-      }
-    }
-
-    return null;
-
-  }
-
-  @Override
-  public Expression visitCeilingMethodCallExpr(final CeilingMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.CEILING, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitConcatMethodCallExpr(final ConcatMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.CONCAT, Arrays.asList(
-        (Expression) ctx.vE1.accept(this),
-        (Expression) ctx.vE2.accept(this)));
-  }
-
-  @Override
-  public Object visitConstSegment(final ConstSegmentContext ctx) {
-    UriInfoImpl uriInfoResource = context.contextUriInfo;
-    UriResource pathInfo = uriInfoResource.getLastResourcePart();
-
-    if (ctx.vV != null) {
-      if (pathInfo instanceof UriResourcePartTyped) {
-        if (!((UriResourcePartTyped) pathInfo).isCollection()) {
-          context.contextUriInfo.addResourcePart(new UriResourceValueImpl());
-        } else {
-          throw wrap(new UriParserSemanticException("$value only allowed on typed path segments",
-              UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "$value"));
-        }
-        return null;
-      } else {
-        throw wrap(new UriParserSemanticException("$value only allowed on typed path segments",
-            UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "$value"));
-      }
-
-    } else if (ctx.vC != null) {
-      if (pathInfo instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) pathInfo).isCollection()) {
-          context.contextUriInfo.addResourcePart(new UriResourceCountImpl());
-        } else {
-          throw wrap(new UriParserSemanticException("$count only allowed on collection properties",
-              UriParserSemanticException.MessageKeys.ONLY_FOR_COLLECTIONS, "$count"));
-        }
-      } else {
-        throw wrap(new UriParserSemanticException("$count only allowed on typed properties",
-            UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "$count"));
-      }
-    } else if (ctx.vR != null) {
-      if (pathInfo instanceof UriResourcePartTyped) {
-        EdmType type = ((UriResourcePartTyped) pathInfo).getType();
-        if (type instanceof EdmEntityType) {
-          context.contextUriInfo.addResourcePart(new UriResourceRefImpl());
-        } else {
-          throw wrap(new UriParserSemanticException("$ref only allowed on entity types",
-              UriParserSemanticException.MessageKeys.ONLY_FOR_ENTITY_TYPES, "$ref"));
-        }
-      } else {
-        throw wrap(new UriParserSemanticException("$ref only allowed on typed properties",
-            UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PROPERTIES, "$ref"));
-      }
-
-    } else if (ctx.vAll != null) {
-      context.contextUriInfo.addResourcePart((UriResourceLambdaAllImpl) ctx.vAll.accept(this));
-    } else if (ctx.vAny != null) {
-      context.contextUriInfo.addResourcePart((UriResourceLambdaAnyImpl) ctx.vAny.accept(this));
-    }
-    return null;
-  }
-
-  @Override
-  public Expression visitContainsMethodCallExpr(final ContainsMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.CONTAINS, Arrays.asList(
-        (Expression) ctx.vE1.accept(this),
-        (Expression) ctx.vE2.accept(this)));
-  }
-
-  @Override
-  public Object visitDateMethodCallExpr(final DateMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.DATE, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitDayMethodCallExpr(final DayMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.DAY, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitGeoDistanceMethodCallExpr(final GeoDistanceMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.GEODISTANCE, Arrays.asList(
-        (Expression) ctx.vE1.accept(this),
-        (Expression) ctx.vE2.accept(this)));
-  }
-
-  @Override
-  public Object visitEndsWithMethodCallExpr(final EndsWithMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.ENDSWITH, Arrays.asList(
-        (Expression) ctx.vE1.accept(this),
-        (Expression) ctx.vE2.accept(this)));
-  }
-
-  @Override
-  public Object visitEnumLiteral(final EnumLiteralContext ctx) {
-    // get type
-    final String odi = ctx.vODI.getText();
-
-    final FullQualifiedName fullName = getFullNameFromContext(ctx.vNS, odi);
-    final EdmEnumType edmEnumType = edm.getEnumType(fullName);
-    if (edmEnumType == null) {
-      throw wrap(new UriParserSemanticException(
-          "Enum type '" + fullName.getFullQualifiedNameAsString() + "' not found!",
-          UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, fullName.getFullQualifiedNameAsString()));
-    }
-
-    String valueString = ctx.vValues.getText();
-    valueString = valueString.substring(1, valueString.length() - 1);
-    String[] values = valueString.split(",");
-    return new EnumerationImpl(edmEnumType, Arrays.asList(values));
-  }
-
-  @Override
-  public Object visitExpandItems(final ExpandItemsContext ctx) {
-    ExpandOptionImpl expand = new ExpandOptionImpl();
-    expand.setText(ctx.getText());
-    for (ExpandItemContext eI : ctx.vlEI) {
-      expand.addExpandItem((ExpandItemImpl) eI.accept(this));
-    }
-
-    return expand;
-  }
-
-  @Override
-  public Object visitExpandItem(final ExpandItemContext ctx) {
-
-    ExpandItemImpl expandItem = null;
-    if (ctx.vS != null) {
-      expandItem = new ExpandItemImpl().setIsStar(true);
-      if (ctx.vR != null) {
-        expandItem.setIsRef(true);
-      } else if (ctx.vM != null) {
-        LevelsOptionImpl levels = new LevelsOptionImpl().setMax();
-        levels.setText(ctx.vM.getText());
-        try {
-          expandItem.setSystemQueryOption(levels);
-        } catch (ODataRuntimeException e) {
-          // Thrown if duplicated system query options are detected
-          throw wrap(new UriParserSyntaxException("Double system query option!", e,
-              UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION, e.getMessage()));
-        }
-      } else if (ctx.vL != null) {
-        LevelsOptionImpl levels = new LevelsOptionImpl();
-        String text = ctx.vL.getText();
-        levels.setText(text);
-        levels.setValue(Integer.parseInt(text));
-        try {
-          expandItem.setSystemQueryOption(levels);
-        } catch (ODataRuntimeException e) {
-          // Thrown if duplicated system query options are detected
-          throw wrap(new UriParserSyntaxException("Double system query option!", e,
-              UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION, e.getMessage()));
-        }
-      }
-
-    } else if (ctx.vEP != null) {
-      expandItem = (ExpandItemImpl) ctx.vEP.accept(this);
-
-      if (ctx.vEPE != null) {
-        ExpandItemImpl contextExpandItemPathBU = context.contextExpandItemPath;
-        context.contextExpandItemPath = expandItem;
-
-        @SuppressWarnings("unchecked")
-        List<SystemQueryOptionImpl> list = (List<SystemQueryOptionImpl>) ctx.vEPE.accept(this);
-        try {
-          for (SystemQueryOptionImpl option : list) {
-            expandItem.setSystemQueryOption(option);
-          }
-        } catch (ODataRuntimeException e) {
-          // Thrown if duplicated system query options are detected
-          throw wrap(new UriParserSyntaxException("Double system query option!", e,
-              UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION, e.getMessage()));
-        }
-        context.contextExpandItemPath = contextExpandItemPathBU;
-      }
-    }
-
-    return expandItem;
-
-  }
-
-  @Override
-  public Object visitExpandPath(final ExpandPathContext ctx) {
-    ExpandItemImpl expandItem = new ExpandItemImpl();
-
-    // save context
-    ExpandItemImpl contextExpandItemPathBU = context.contextExpandItemPath;
-    UriInfoImpl uriInfoResourceBU = context.contextUriInfo;
-
-    // set tmp context
-    context.contextExpandItemPath = expandItem;
-    context.contextUriInfo = new UriInfoImpl().setKind(UriInfoKind.resource);
-
-    context.contextVisitExpandResourcePath = true;
-    super.visitExpandPath(ctx);
-    context.contextVisitExpandResourcePath = false;
-
-    EdmType startType = removeUriResourceStartingTypeFilterImpl(context.contextUriInfo);
-    expandItem.setResourcePath(context.contextUriInfo);
-    if (startType != null) {
-      expandItem.setTypeFilter(startType);
-    }
-
-    // reset context
-    context.contextUriInfo = uriInfoResourceBU;
-    context.contextExpandItemPath = contextExpandItemPathBU;
-
-    // test
-    validate(uriInfoResourceBU.asUriInfoResource(), expandItem);
-    //
-
-    return expandItem;
-  }
-
-  private void validate(UriInfoResource uriInfoResource, ExpandItemImpl expandItem) {
-    if (uriInfoResource != null) {
-      EdmEntityType type = getEntityType(uriInfoResource);
-      EdmEntityType name = getEntityType(expandItem.getResourcePath());
-
-      if (name != null && type != null) {
-        EdmElement property = type.getProperty(name.getName());
-        if (!(property instanceof EdmNavigationProperty)) {
-          throw wrap(new UriParserSemanticException(
-              "NavigationProperty '" + name.getName() + "' not found in type '"
-                  + type.getFullQualifiedName().getFullQualifiedNameAsString() + "'",
-              UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE,
-              name.getFullQualifiedName().getFullQualifiedNameAsString(),
-              type.getFullQualifiedName().getFullQualifiedNameAsString()));
-        }
-      }
-    }
-  }
-
-  private EdmEntityType getEntityType(UriInfoResource test) {
-    List<UriResource> parts = test.getUriResourceParts();
-    if (!parts.isEmpty()) {
-      UriResource lastPart = parts.get(parts.size() - 1);
-      if (lastPart instanceof UriResourceEntitySet) {
-        UriResourceEntitySet entitySet = (UriResourceEntitySet) lastPart;
-        return entitySet.getEntityType();
-      }
-    }
-    return null;
-  }
-
-  @Override
-  public Object visitExpandPathExtension(final ExpandPathExtensionContext ctx) {
-    List<SystemQueryOptionImpl> list = new ArrayList<SystemQueryOptionImpl>();
-
-    EdmType targetType = null;
-    boolean isColl = false;
-    if (context.contextExpandItemPath == null) {
-      // use the type of the last resource path segement
-      UriResourceTypedImpl lastSegment = (UriResourceTypedImpl) context.contextUriInfo.getLastResourcePart();
-      targetType = ParserHelper.getTypeInformation(lastSegment);
-      isColl = lastSegment.isCollection();
-    } else {
-      if (context.contextExpandItemPath.getResourcePath() == null) {
-        // use the type of the last resource path segement
-        UriResourceTypedImpl lastSegment = (UriResourceTypedImpl) context.contextUriInfo.getLastResourcePart();
-        targetType = ParserHelper.getTypeInformation(lastSegment);
-        isColl = lastSegment.isCollection();
-      } else {
-        // use the type of the last ''expand'' path segement
-        UriInfoImpl info = (UriInfoImpl) context.contextExpandItemPath.getResourcePath();
-        targetType = ParserHelper.getTypeInformation((UriResourcePartTyped) info.getLastResourcePart());
-        isColl = ((UriResourcePartTyped) info.getLastResourcePart()).isCollection();
-      }
-    }
-
-    context.contextTypes.push(targetType);
-    context.isCollection = isColl;
-
-    if (ctx.vC != null) {
-      UriInfoImpl resourcePath = (UriInfoImpl) context.contextExpandItemPath.getResourcePath();
-      resourcePath.addResourcePart(new UriResourceCountImpl());
-
-      for (ExpandCountOptionContext s : ctx.vlEOC) {
-        list.add((SystemQueryOptionImpl) s.accept(this));
-      }
-    } else if (ctx.vR != null) {
-      UriInfoImpl resourcePath = (UriInfoImpl) context.contextExpandItemPath.getResourcePath();
-      resourcePath.addResourcePart(new UriResourceRefImpl());
-
-      for (ExpandRefOptionContext s : ctx.vlEOR) {
-        list.add((SystemQueryOptionImpl) s.accept(this));
-      }
-    } else {
-      for (ExpandOptionContext s : ctx.vlEO) {
-        list.add((SystemQueryOptionImpl) s.accept(this));
-      }
-    }
-
-    context.contextTypes.pop();
-    return list;
-
-  }
-
-  @Override
-  public Object visitFilter(final FilterContext ctx) {
-    context.contextReadingQueryPart = true;
-    final FilterOptionImpl result = new FilterOptionImpl().setExpression((Expression) ctx.children.get(2)
-                                                          .accept(this));
-    context.contextReadingQueryPart = false;
-
-    return result;
-  }
-
-  @Override
-  public Object visitFilterExpressionEOF(final FilterExpressionEOFContext ctx) {
-    context.contextReadingQueryPart = true;
-    final FilterOptionImpl result = new FilterOptionImpl().setExpression((Expression) ctx.children.get(0)
-                                                          .accept(this));
-    context.contextReadingQueryPart = false;
-
-    return result;
-  }
-
-  @Override
-  public Expression visitFloorMethodCallExpr(final FloorMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.FLOOR, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitFractionalsecondsMethodCallExpr(final FractionalsecondsMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.FRACTIONALSECONDS, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitGeoLengthMethodCallExpr(final GeoLengthMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.GEOLENGTH, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitHourMethodCallExpr(final HourMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.HOUR, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitIndexOfMethodCallExpr(final IndexOfMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.INDEXOF, Arrays.asList(
-        (Expression) ctx.vE1.accept(this),
-        (Expression) ctx.vE2.accept(this)));
-  }
-
-  @Override
-  public Object visitInlinecount(final InlinecountContext ctx) {
-    final String text = ctx.children.get(2).getText();
-    return new CountOptionImpl()
-        .setValue(text.equalsIgnoreCase("true") ? true : false)
-        .setText(text);
-  }
-
-  @Override
-  public Expression visitGeoIntersectsMethodCallExpr(final GeoIntersectsMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.GEOINTERSECTS, Arrays.asList(
-        (Expression) ctx.vE1.accept(this),
-        (Expression) ctx.vE2.accept(this)));
-  }
-
-  @Override
-  public Expression visitIsofExpr(final IsofExprContext ctx) {
-    List<Expression> parameters = new ArrayList<Expression>();
-    if (ctx.vE1 != null) {
-      parameters.add((Expression) ctx.vE1.accept(this));
-    }
-
-    String namespace = ctx.vNS.getText();
-    namespace = namespace.substring(0, namespace.length() - 1);
-
-    FullQualifiedName fullName = new FullQualifiedName(namespace, ctx.vODI.getText());
-    EdmType type = getType(fullName);
-    parameters.add(new TypeLiteralImpl(type));
-
-    return new MethodImpl(MethodKind.ISOF, parameters);
-  }
-
-  @Override
-  public Expression visitLengthMethodCallExpr(final LengthMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.LENGTH, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Object visitLevels(final LevelsContext ctx) {
-
-    LevelsOptionImpl levels = new LevelsOptionImpl();
-
-    String text = ctx.children.get(2).getText();
-
-    if (text.equals("max")) {
-      levels.setMax();
-    } else {
-      levels.setValue(Integer.parseInt(text));
-    }
-    levels.setText(text);
-
-    return levels;
-
-  }
-
-  @Override
-  public Expression visitMaxDateTimeMethodCallExpr(final MaxDateTimeMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.MAXDATETIME, null);
-  }
-
-  @Override
-  public Object visitMemberExpr(final MemberExprContext ctx) {
-
-    UriInfoImpl uriInfoImplpath = new UriInfoImpl().setKind(UriInfoKind.resource);
-
-    if (context.contextTypes.isEmpty()) {
-      throw wrap(new UriParserSemanticException("Expression '" + ctx.getText() + "' is not allowed as key value.",
-          UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, ctx.getText()));
-    }
-
-    if (ctx.vIt != null || ctx.vIts != null) {
-      uriInfoImplpath.addResourcePart(new UriResourceItImpl(context.contextTypes.peek(), context.isCollection));
-    }
-
-    if (ctx.vPs != null) {
-      // save the context
-      UriInfoImpl backupUriInfoPath = context.contextUriInfo;
-
-      // set temporary uriInfoPath
-      context.contextUriInfo = uriInfoImplpath;
-
-      ctx.vPs.accept(this);
-
-      // reset context
-      context.contextUriInfo = backupUriInfoPath;
-    }
-
-    if (ctx.vALL != null) {
-      uriInfoImplpath.addResourcePart((UriResourceImpl) ctx.vALL.accept(this));
-    }
-    if (ctx.vANY != null) {
-      uriInfoImplpath.addResourcePart((UriResourceImpl) ctx.vANY.accept(this));
-    }
-
-    EdmType startType = removeUriResourceStartingTypeFilterImpl(uriInfoImplpath);
-
-    return new MemberImpl(uriInfoImplpath, startType);
-  }
-
-  @Override
-  public Expression visitMinDateTimeMethodCallExpr(final MinDateTimeMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.MINDATETIME, null);
-  }
-
-  @Override
-  public Expression visitMinuteMethodCallExpr(final MinuteMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.MINUTE, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitMonthMethodCallExpr(final MonthMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.MONTH, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Object visitNameValueOptList(final NameValueOptListContext ctx) {
-    if (ctx.vVO != null) {
-      // This branch is chosen if the key predicate is a common expression e.g. EntitySet(0)
-
-      // is single key predicate without a name
-      String valueText = ctx.vVO.getText();
-      Expression expression = null;
-      try {
-        expression = (Expression) ctx.vVO.accept(this);
-      } catch (final RuntimeException e) {
-        throw wrap(new UriParserSemanticException("Invalid key value: " + valueText, e,
-            UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE, valueText));
-      }
-
-      // get type of last resource part
-      UriResource last = context.contextUriInfo.getLastResourcePart();
-      if (!(last instanceof UriResourcePartTyped)) {
-        throw wrap(new UriParserSemanticException("Parameters list on untyped resource path segment not allowed",
-            UriParserSemanticException.MessageKeys.PARAMETERS_LIST_ONLY_FOR_TYPED_PARTS));
-
-      } else if (last instanceof UriResourceFunction) {
-        // Handle functions
-        final UriResourceFunction uriResourceFunction =
-            (UriResourceFunction) context.contextUriInfo.getLastResourcePart();
-        final EdmReturnType returnType = uriResourceFunction.getFunction().getReturnType();
-
-        if (returnType.getType().getKind() != EdmTypeKind.ENTITY || !returnType.isCollection()) {
-          throw wrap(new UriParserSemanticException("No keys allowed",
-              UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
-        } else {
-          // The functions returns a collection of entities
-          // Get the EDM Type and determine how many key predicates are needed. In this case only one
-          // key predicate is allowed. If the entity type needs more than one key predicate, the client
-          // has to use the key value syntax e.g. EntitySet(ID=1,Order=2)
-          final EdmEntityType entityType = (EdmEntityType) uriResourceFunction.getFunction().getReturnType().getType();
-          final List<String> lastKeyPredicates = entityType.getKeyPredicateNames();
-
-          if (lastKeyPredicates.size() == 1) {
-            return Collections.singletonList(new UriParameterImpl()
-                .setName(lastKeyPredicates.get(0))
-                .setText(valueText)
-                .setExpression(expression));
-          } else {
-            throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-                UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-                Integer.toString(lastKeyPredicates.size()), "1"));
-          }
-        }
-      } else {
-        // Handle EntitySets
-        EdmEntityType lastType = (EdmEntityType) ((UriResourcePartTyped) last).getType();
-
-        // get list of keys for lastType
-        List<String> lastKeyPredicates = lastType.getKeyPredicateNames();
-
-        // If there is exactly one key defined in the EDM, then this key is the key written in the URI,
-        // so fill the keylist with this key and return.
-        if (lastKeyPredicates.size() == 1) {
-          return Collections.singletonList(new UriParameterImpl()
-              .setName(lastKeyPredicates.get(0))
-              .setText(valueText)
-              .setExpression(expression));
-        }
-
-        // There are more keys defined in the EDM, but only one is written in the URI. This is allowed only if
-        // referential constraints are defined on this navigation property which can be used to fill up all
-        // required keys.
-        // For using referential constraints the last resource part must be a navigation property.
-        if (!(context.contextUriInfo.getLastResourcePart() instanceof UriResourceNavigationPropertyImpl)) {
-          throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-              UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-              Integer.toString(lastKeyPredicates.size()), "1"));
-        }
-        UriResourceNavigationPropertyImpl lastNav = (UriResourceNavigationPropertyImpl) last;
-
-        // get the partner of the navigation property
-        EdmNavigationProperty partner = lastNav.getProperty().getPartner();
-        if (partner == null) {
-          throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-              UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-              Integer.toString(lastKeyPredicates.size()), "1"));
-        }
-
-        // create the keylist
-        List<UriParameterImpl> list = new ArrayList<UriParameterImpl>();
-
-        // Find the keys not filled by referential constraints
-        // and collect the other keys filled by referential constraints.
-        String missedKey = null;
-        for (String item : lastKeyPredicates) {
-          String property = partner.getReferencingPropertyName(item);
-          if (property != null) {
-            list.add(new UriParameterImpl().setName(item).setReferencedProperty(property));
-          } else {
-            if (missedKey == null) {
-              missedKey = item;
-            } else {
-              // two of more keys are missing
-              throw wrap(new UriParserSemanticException("Not enough referential constraints defined",
-                  UriParserSemanticException.MessageKeys.NOT_ENOUGH_REFERENTIAL_CONSTRAINTS));
-            }
-          }
-        }
-
-        // the missing key is the one which is defined in the URI
-        list.add(new UriParameterImpl().setName(missedKey).setText(valueText).setExpression(expression));
-
-        return list;
-      }
-    } else if (ctx.vNVL != null) {
-      // The client provided a list of key values pairs e.g. EntitySet(ID=1,Order=2)
-      List<UriParameterImpl> list = new ArrayList<UriParameterImpl>();
-
-      for (ParseTree c : ctx.vNVL.vlNVP) {
-        list.add((UriParameterImpl) c.accept(this));
-      }
-
-      if (context.contextReadingFunctionParameters) {
-        return list;
-      }
-
-      UriResource last = context.contextUriInfo.getLastResourcePart();
-
-      // get type of last resource part
-      if (!(last instanceof UriResourcePartTyped)) {
-        throw wrap(new UriParserSemanticException("Parameters list on untyped resource path segment not allowed",
-            UriParserSemanticException.MessageKeys.PARAMETERS_LIST_ONLY_FOR_TYPED_PARTS));
-      }
-      if (last instanceof UriResourceFunction) {
-        final UriResourceFunction uriResourceFunction = (UriResourceFunction) context.contextUriInfo
-            .getLastResourcePart();
-        final EdmReturnType returnType = uriResourceFunction.getFunction().getReturnType();
-
-        if (returnType.getType().getKind() != EdmTypeKind.ENTITY || !returnType.isCollection()) {
-          throw wrap(new UriParserSemanticException("No keys allowed",
-              UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
-        } else {
-          // The functions returns a collection of entities
-          // Get the EDM Type and determine how many key predicates are needed.
-          // In case of functions all key predicates must be provided by the client.
-          final EdmEntityType entityType = (EdmEntityType) uriResourceFunction.getFunction().getReturnType().getType();
-          final List<String> lastKeyPredicates = entityType.getKeyPredicateNames();
-
-          if (lastKeyPredicates.size() == list.size()) {
-            return list;
-          } else {
-            throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-                UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-                Integer.toString(lastKeyPredicates.size()), "1"));
-          }
-        }
-      } else {
-        // Handle entity sets
-        EdmEntityType lastType = (EdmEntityType) ((UriResourcePartTyped) last).getType();
-
-        // get list of keys for lastType
-        List<String> lastKeyPredicates = lastType.getKeyPredicateNames();
-
-        // check if all key are filled from the URI
-        if (list.size() == lastKeyPredicates.size()) {
-          return list;
-        }
-
-        // if not, check if the missing key predicates can be satisfied with help of the defined
-        // referential constraints
-        // for using referential constraints the last resource part must be a navigation property
-        if (!(context.contextUriInfo.getLastResourcePart() instanceof UriResourceNavigationPropertyImpl)) {
-          throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-              UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-              Integer.toString(lastKeyPredicates.size()), Integer.toString(list.size())));
-        }
-        UriResourceNavigationPropertyImpl lastNav = (UriResourceNavigationPropertyImpl) last;
-
-        // get the partner of the navigation property
-        EdmNavigationProperty partner = lastNav.getProperty().getPartner();
-        if (partner == null) {
-          throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-              UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-              Integer.toString(lastKeyPredicates.size()), Integer.toString(list.size())));
-        }
-
-        // fill missing keys from referential constraints
-        for (String key : lastKeyPredicates) {
-          boolean found = false;
-          for (UriParameterImpl item : list) {
-            if (item.getName().equals(key)) {
-              found = true;
-              break;
-            }
-          }
-
-          if (!found) {
-            String property = partner.getReferencingPropertyName(key);
-            if (property != null) {
-              // store the key name as referenced property
-              list.add(0, new UriParameterImpl().setName(key).setReferencedProperty(property));
-            }
-          }
-        }
-
-        // check again if all key predicates are filled from the URI
-        if (list.size() == lastKeyPredicates.size()) {
-          return list;
-        } else {
-          throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-              UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
-              Integer.toString(lastKeyPredicates.size()), Integer.toString(list.size())));
-        }
-      }
-    } else {
-      // No key predicates are provided by the client
-
-      if (context.contextReadingFunctionParameters) {
-        return Collections.emptyList();
-      } else {
-        final UriResource last = context.contextUriInfo.getLastResourcePart();
-        final int number = last instanceof UriResourcePartTyped ? ((EdmEntityType) ((UriResourcePartTyped) last)
-            .getType()).getKeyPredicateNames().size() : 0;
-        throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-            UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES, Integer.toString(number), "0"));
-      }
-    }
-  }
-
-  @Override
-  public UriParameterImpl visitNameValuePair(final NameValuePairContext ctx) {
-    UriParameterImpl uriParameter = new UriParameterImpl();
-    uriParameter.setName(ctx.vODI.getText());
-
-    if (ctx.vCOM != null) {
-      final String text = ctx.vCOM.getText();
-      uriParameter.setText("null".equals(text) ? null : text);
-      uriParameter.setExpression((Expression) ctx.vCOM.accept(this));
-    } else {
-      uriParameter.setAlias("@" + ctx.vALI.getText());
-    }
-
-    return uriParameter;
-  }
-
-  @Override
-  public Object visitNaninfinityLiteral(final NaninfinityLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Decimal));
-  }
-
-  @Override
-  public Expression visitNowMethodCallExpr(final NowMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.NOW, null);
-  }
-
-  @Override
-  public Object visitNullruleLiteral(final NullruleLiteralContext ctx) {
-    return new LiteralImpl("null", null);
-  }
-
-  @Override
-  public Object visitOrderBy(final OrderByContext ctx) {
-
-    OrderByOptionImpl orderBy = new OrderByOptionImpl();
-
-    for (OrderByItemContext item : ((OrderListContext) ctx.getChild(2)).vlOI) {
-      OrderByItemImpl oItem = (OrderByItemImpl) item.accept(this);
-      orderBy.addOrder(oItem);
-    }
-
-    return orderBy;
-  }
-
-  @Override
-  public Object visitOrderByEOF(final OrderByEOFContext ctx) {
-    context.contextReadingQueryPart = true;
-    
-    OrderByOptionImpl orderBy = new OrderByOptionImpl();
-
-    for (OrderByItemContext item : ((OrderListContext) ctx.getChild(0)).vlOI) {
-      OrderByItemImpl oItem = (OrderByItemImpl) item.accept(this);
-      orderBy.addOrder(oItem);
-    }
-
-    context.contextReadingFunctionParameters = false;
-    return orderBy;
-  }
-
-  @Override
-  public Object visitOrderByItem(final OrderByItemContext ctx) {
-    OrderByItemImpl oItem = new OrderByItemImpl();
-    if (ctx.vD != null) {
-      oItem.setDescending(true);
-    }
-
-    oItem.setExpression((Expression) ctx.vC.accept(this));
-    return oItem;
-  }
-
-  @Override
-  public Object visitPathSegment(final PathSegmentContext ctx) {
-    readResourcePathSegment(ctx);
-    /*
-     * if (contextUriInfo.getLastResourcePart() == null ||
-     * contextUriInfo.getLastResourcePart() instanceof UriResourceRootImpl) {
-     * 
-     * } else {
-     * readNextPathInfoSegment(ctx);
-     * }
-     */
-    UriResourceImpl pathInfoSegment = (UriResourceImpl) context.contextUriInfo.getLastResourcePart();
-
-    if (ctx.vlNVO.size() > 0) {
-      // check for keyPredicates
-      if (pathInfoSegment instanceof UriResourceWithKeysImpl) {
-        if (ctx.vlNVO.size() > 1) {
-          throw wrap(new UriParserSemanticException("More than one key predicates found",
-              UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES, "1",
-              Integer.toString(ctx.vlNVO.size())));
-        }
-
-        @SuppressWarnings("unchecked")
-        List<UriParameter> list = (List<UriParameter>) ctx.vlNVO.get(0).accept(this);
-        ((UriResourceWithKeysImpl) pathInfoSegment)
-            .setKeyPredicates(list);
-      } else {
-        throw wrap(new UriParserSemanticException("Key properties not allowed",
-            UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
-      }
-    }
-
-    return pathInfoSegment;
-  }
-
-  @Override
-  public Object visitPathSegments(final PathSegmentsContext ctx) {
-    // path segment
-    for (PathSegmentContext it : ctx.vlPS) {
-      it.accept(this);
-    }
-
-    // const segment
-    if (ctx.vCS != null) {
-      ctx.vCS.accept(this);
-    }
-    return null;
-  }
-
-  @Override
-  public Object visitPrimitiveLiteral(final PrimitiveLiteralContext ctx) {
-    ParseTree child1 = ctx.children.get(0);
-
-    if (child1 instanceof EnumLiteralContext
-        || child1 instanceof BooleanNonCaseLiteralContext
-        || child1 instanceof NullruleLiteralContext
-        || child1 instanceof NaninfinityLiteralContext
-        || child1 instanceof StringLiteralContext
-        || child1 instanceof IntLiteralContext
-        || child1 instanceof BinaryLiteralContext
-        || child1 instanceof DateLiteralContext
-        || child1 instanceof DatetimeoffsetLiteralContext
-        || child1 instanceof DurationLiteralContext
-        || child1 instanceof GuidLiteralContext
-        || child1 instanceof TimeofdayLiteralContext
-        || child1 instanceof DecimalLiteralContext
-        || child1 instanceof BinaryLiteralContext) {
-      return child1.accept(this);
-    }
-
-    // TODO Implement geography types and set a proper type
-    return new LiteralImpl(ctx.getText(), null);
-  }
-
-  @Override
-  public Object visitBinaryLiteral(BinaryLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Binary));
-  }
-
-  @Override
-  public Object visitStringLiteral(final StringLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.String));
-  }
-
-  @Override
-  public Object visitDecimalLiteral(final DecimalLiteralContext ctx) {
-    final EdmType type = EdmPrimitiveTypeFactory.getInstance(
-        ctx.getText().contains("e") || ctx.getText().contains("E") ?
-            EdmPrimitiveTypeKind.Double :
-            EdmPrimitiveTypeKind.Decimal);
-
-    return new LiteralImpl(ctx.getText(), type);
-  }
-
-  @Override
-  public Object visitIntLiteral(final IntLiteralContext ctx) {
-    EdmPrimitiveTypeKind typeKind = null;
-    try {
-      final long value = Long.parseLong(ctx.getText());
-      if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) {
-        typeKind = EdmPrimitiveTypeKind.SByte;
-      } else if (value >= 0 && value <= 255) {
-        typeKind = EdmPrimitiveTypeKind.Byte;
-      } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {
-        typeKind = EdmPrimitiveTypeKind.Int16;
-      } else if (value >= Integer.MIN_VALUE && value <= Integer.MAX_VALUE) {
-        typeKind = EdmPrimitiveTypeKind.Int32;
-      } else {
-        typeKind = EdmPrimitiveTypeKind.Int64;
-      }
-    } catch (NumberFormatException e) {
-      return new LiteralImpl(ctx.getText(),
-          EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Decimal));
-    }
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(typeKind));
-  }
-
-  @Override
-  public Object visitDateLiteral(final DateLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Date));
-  }
-
-  @Override
-  public Object visitDatetimeoffsetLiteral(final DatetimeoffsetLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.DateTimeOffset));
-  }
-
-  @Override
-  public Object visitDurationLiteral(final DurationLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Duration));
-  }
-
-  @Override
-  public Object visitGuidLiteral(final GuidLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Guid));
-  }
-
-  @Override
-  public Object visitTimeofdayLiteral(final TimeofdayLiteralContext ctx) {
-    return new LiteralImpl(ctx.getText(),
-        EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.TimeOfDay));
-  }
-
-  @Override
-  public Object visitQueryOptions(final QueryOptionsContext ctx) {
-
-    List<QueryOptionImpl> qpList = new ArrayList<QueryOptionImpl>();
-    for (QueryOptionContext entityOption : ctx.vlQO) {
-      qpList.add((QueryOptionImpl) entityOption.accept(this));
-    }
-
-    return qpList;
-  }
-
-  @Override
-  public Object visitRootExpr(final RootExprContext ctx) {
-
-    UriResource lastResource = context.contextUriInfo.getLastResourcePart();
-
-    if (!(lastResource instanceof UriResourcePartTyped)) {
-      throw wrap(new UriParserSemanticException("Resource path not typed",
-          UriParserSemanticException.MessageKeys.RESOURCE_PATH_NOT_TYPED));
-    }
-
-    UriResourcePartTyped lastType = (UriResourcePartTyped) lastResource;
-
-    UriResourceRootImpl pathInfoRoot = new UriResourceRootImpl(
-        ParserHelper.getTypeInformation(lastType),
-        lastType.isCollection());
-
-    UriInfoImpl uriInfoImplpath = new UriInfoImpl().setKind(UriInfoKind.resource);
-    uriInfoImplpath.addResourcePart(pathInfoRoot);
-
-    if (ctx.vPs != null) {
-      // store the context uriInfoPath
-      UriInfoImpl backupUriInfoPath = context.contextUriInfo;
-
-      // set temporary uriInfoPath to collect the path information of the memberExpression
-      context.contextUriInfo = uriInfoImplpath;
-
-      ctx.vPs.accept(this);
-
-      context.contextUriInfo = backupUriInfoPath;
-
-    }
-    return new MemberImpl(uriInfoImplpath, null);
-
-  }
-
-  @Override
-  public Expression visitRoundMethodCallExpr(final RoundMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.ROUND, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Expression visitSecondMethodCallExpr(final SecondMethodCallExprContext ctx) {
-    return new MethodImpl(MethodKind.SECOND, Collections.singletonList((Expression) ctx.vE1.accept(this)));
-  }
-
-  @Override
-  public Object visitSelect(final SelectContext ctx) {
-    List<SelectItem> selectItems = new ArrayList<SelectItem>();
-    for (SelectItemContext si : ctx.vlSI) {
-      selectItems.add((SelectItem) si.accept(this));
-    }
-
-    return new SelectOptionImpl().setSelectItems(selectItems).setText(ctx.children.get(2).getText());
-  }
-
-  @Override
-  public Object visitSelectEOF(final SelectEOFContext ctx) {
-    context.contextReadingQueryPart = true;
-    List<SelectItem> selectItems = new ArrayList<SelectItem>();
-    for (SelectItemContext si : ctx.vlSI) {
-      selectItems.add((SelectItem) si.accept(this));
-    }
-
-    final QueryOptionImpl result = new SelectOptionImpl().setSelectItems(selectItems).setText(ctx.getText());
-    context.contextReadingQueryPart = false;
-    
-    return result;
-  }
-
-  @Override
-  public Object visitSelectItem(final SelectItemContext ctx) {
-    SelectItemImpl selectItem = new SelectItemImpl();
-
-    context.contextSelectItem = selectItem;
-    for (SelectSegmentContext si : ctx.vlSS) {
-      si.accept(this);
-    }
-    context.contextSelectItem = null;
-
-    return selectItem;
-  }
-
-  @Override
-  public Object visitSelectSegment(final SelectSegmentContext ctx) {
-
-    if (ctx.vS != null) {
-      if (ctx.vNS != null) {
-        String namespace = ctx.vNS.getText();
-        namespace = namespace.substring(0, namespace.length() - 1);
-        FullQualifiedName fullName = new FullQualifiedName(namespace, "*");
-        context.contextSelectItem.addAllOperationsInSchema(fullName);
-      } else {
-        context.contextSelectItem.setStar(true);
-      }
-      return null;
-    }
-
-    String odi = ctx.vODI.getText();
-    if (ctx.vNS == null) {
-
-      EdmType prevType = null;
-      if (context.contextSelectItem.getResourcePath() == null) {
-        prevType = context.contextTypes.peek();
-      } else {
-        UriInfoImpl uriInfo = (UriInfoImpl) context.contextSelectItem.getResourcePath();
-        UriResource last = uriInfo.getLastResourcePart();
-
-        prevType = ParserHelper.getTypeInformation((UriResourcePartTyped) last);
-        if (prevType == null) {
-          throw wrap(new UriParserSemanticException("prev segment not typed",
-              UriParserSemanticException.MessageKeys.ONLY_FOR_TYPED_PARTS, "select"));
-        }
-      }
-
-      if (!(prevType instanceof EdmStructuredType)) {
-        throw wrap(new UriParserSemanticException("Previous select item is not a structural type",
-            UriParserSemanticException.MessageKeys.ONLY_FOR_STRUCTURAL_TYPES, "select"));

<TRUNCATED>

[47/51] [abbrv] olingo-odata4 git commit: OLINGO-854: The conversion of string to URI and from URI to string need to be correcty encoded and decoded, this fix addresses that

Posted by mi...@apache.org.
OLINGO-854: The conversion of string to URI and from URI to string need to be correcty encoded and decoded, this fix addresses that


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: b5eae4f6c25d7735b39d5e445db9e45f4d99c5d3
Parents: 16d238f
Author: Ramesh Reddy <ra...@jboss.org>
Authored: Thu Jan 21 16:17:18 2016 -0600
Committer: Ramesh Reddy <ra...@jboss.org>
Committed: Thu Jan 21 16:17:18 2016 -0600

----------------------------------------------------------------------
 .../olingo/commons/core/edm/primitivetype/EdmString.java       | 6 ++++--
 .../olingo/commons/core/edm/primitivetype/EdmStringTest.java   | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5eae4f6/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
index 8e9a42a..a63010b 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
@@ -21,6 +21,8 @@ package org.apache.olingo.commons.core.edm.primitivetype;
 import java.util.regex.Pattern;
 
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.core.Decoder;
+import org.apache.olingo.commons.core.Encoder;
 
 /**
  * Implementation of the EDM primitive type String.
@@ -95,11 +97,11 @@ public final class EdmString extends SingletonPrimitiveType {
       uriLiteral.append(c);
     }
     uriLiteral.append(uriSuffix);
-    return uriLiteral.toString();
+    return Encoder.encode(uriLiteral.toString());
   }
 
   @Override
   public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
-    return literal == null ? null : super.fromUriLiteral(literal).replace("''", "'");
+    return literal == null ? null : Decoder.decode(super.fromUriLiteral(literal).replace("''", "'"));
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5eae4f6/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
index b5f2a89..1035e6b 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
@@ -33,11 +33,13 @@ public class EdmStringTest extends PrimitiveTypeBaseTest {
     assertEquals("'StringValue'", instance.toUriLiteral("StringValue"));
     assertEquals("'String''Value'", instance.toUriLiteral("String'Value"));
     assertEquals("'String''''''Value'", instance.toUriLiteral("String'''Value"));
+    assertEquals("'ab%20cd%20'", instance.toUriLiteral("ab cd "));
   }
 
   @Test
   public void fromUriLiteral() throws Exception {
     assertEquals("String''Value", instance.fromUriLiteral("'String''''Value'"));
+    assertEquals("ab cd ", instance.fromUriLiteral("'ab%20cd%20'"));
 
     expectErrorInFromUriLiteral(instance, "");
     expectErrorInFromUriLiteral(instance, "'");


[31/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] URI parser shall not ignore empty path segments

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
deleted file mode 100644
index 6102fd8..0000000
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
+++ /dev/null
@@ -1,323 +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.server.core.uri.antlr;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.olingo.server.core.uri.parser.UriTokenizer;
-import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
-import org.junit.Test;
-
-/**
- * Tests originally written for the ANTLR lexer.
- */
-public class TestLexer {
-
-  private TokenValidator test = null;
-
-  // The last two chars are not in cPCT_ENCODED_UNESCAPED.
-  private static final String cPCT_ENCODED = "%45%46%47" + "%22" + "%5C";
-  private static final String cUNRESERVED = "ABCabc123-._~";
-  private static final String cOTHER_DELIMS = "!()*+,;";
-  private static final String cSUB_DELIMS = "$&'=" + cOTHER_DELIMS;
-
-  private static final String cPCHAR = cUNRESERVED + cPCT_ENCODED + cSUB_DELIMS + ":@";
-
-  public TestLexer() {
-    test = new TokenValidator();
-  }
-
-  @Test
-  public void unary() {
-    test.run("-a eq a").has(TokenKind.MinusOperator, TokenKind.ODataIdentifier, TokenKind.EqualsOperator,
-        TokenKind.ODataIdentifier).isInput();
-  }
-
-  @Test
-  public void uriTokens() {
-//    test.run("#").isType(TokenKind.FRAGMENT).isInput();
-    test.run("$count").has(TokenKind.COUNT).isInput();
-    test.run("$ref").has(TokenKind.REF).isInput();
-    test.run("$value").has(TokenKind.VALUE).isInput();
-  }
-
-  @Test
-  public void queryOptionsTokens() {
-    test.run("$skip=1").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-    test.run("$skip=2").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-    test.run("$skip=123").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-
-    test.run("$top=1").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-    test.run("$top=2").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-    test.run("$top=123").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-
-    test.run("$levels=1").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-    test.run("$levels=2").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-    test.run("$levels=123").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-    test.run("$levels=max").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.MAX).isInput();
-
-//    test.run("$format=atom").has(TokenKind.FORMAT, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
-//    test.run("$format=json").has(TokenKind.FORMAT, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
-//    test.run("$format=xml").has(TokenKind.FORMAT,, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
-//    test.run("$format=abc/def").has(TokenKind.FORMAT, TokenKind.EQ,
-//        TokenKind.ODataIdentifier, TokenKind.SLASH, TokenKind.ODataIdentifier).isInput();
-
-//    test.run("$id=123").has(TokenKind.ID, TokenKind.EQ, TokenKind.IntegerValue).isInput();
-//    test.run("$id=ABC").has(TokenKind.ID, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
-
-//    test.run("$skiptoken=ABC").has(TokenKind.SKIPTOKEN, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
-//    test.run("$skiptoken=ABC").has(TokenKind.SKIPTOKEN, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
-
-    test.run("$search=\"ABC\"").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase).isInput();
-    test.run("$search=ABC").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word).isInput();
-    test.run("$search=\"A%20B%20C\"").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase).isInput();
-    test.run("$search=Test Test").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word,
-        TokenKind.AndOperatorSearch, TokenKind.Word).isInput();
-    test.run("$search=Test&$filter=ABC eq 1").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word);
-  }
-
-  @Test
-  public void queryOptionsDefaultMode() {
-    test.run("$expand=ABC($skip=1)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
-    test.run("$expand=ABC($skip=123)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
-    test.run("$expand=ABC($search=abc)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word, TokenKind.CLOSE).isInput();
-    test.run("$expand=ABC($search=\"123\")").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase, TokenKind.CLOSE).isInput();
-    test.run("$expand=ABC($top=1)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
-    test.run("$expand=ABC($top=123)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
-
-    test.run("$expand=ABC($expand=DEF($skip=1))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
-        .isInput();
-    test.run("$expand=ABC($expand=DEF($skip=123))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
-        .isInput();
-
-    test.run("$expand=ABC($expand=DEF($top=1))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
-        .isInput();
-    test.run("$expand=ABC($expand=DEF($top=123))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
-        .isInput();
-
-    test.run("$expand=ABC($expand=DEF($search=Test Test))")
-        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word,
-            TokenKind.AndOperatorSearch, TokenKind.Word, TokenKind.CLOSE, TokenKind.CLOSE)
-        .isInput();
-    test.run("$expand=ABC($expand=DEF($search=\"Test\" \"Test\"))")
-        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase,
-            TokenKind.AndOperatorSearch, TokenKind.Phrase, TokenKind.CLOSE, TokenKind.CLOSE)
-        .isInput();
-    test.run("$expand=ABC($expand=DEF($search=\"Test\" \"Test\";$filter=PropertyInt16 eq 0;$orderby=PropertyInt16))")
-        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
-            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase,
-            TokenKind.AndOperatorSearch, TokenKind.Phrase, TokenKind.SEMI,
-            TokenKind.FILTER, TokenKind.EQ, TokenKind.ODataIdentifier, TokenKind.EqualsOperator,
-            TokenKind.IntegerValue, TokenKind.SEMI,
-            TokenKind.ORDERBY, TokenKind.EQ, TokenKind.ODataIdentifier, TokenKind.CLOSE, TokenKind.CLOSE)
-        .isInput();
-  }
-
-  @Test
-  public void queryExpressions() {
-    test.run("$it").has(TokenKind.IT).isText("$it");
-
-    test.run("$filter=contains(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ContainsMethod).isText("contains(");
-
-    test.run("$filter=containsabc").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ODataIdentifier)
-        .isText("containsabc");
-
-    test.run("$filter=startswith(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.StartswithMethod)
-        .isText("startswith(");
-    test.run("$filter=endswith(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.EndswithMethod).isText("endswith(");
-    test.run("$filter=length(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.LengthMethod).isText("length(");
-    test.run("$filter=indexof(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.IndexofMethod).isText("indexof(");
-    test.run("$filter=substring(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.SubstringMethod).isText("substring(");
-    test.run("$filter=tolower(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.TolowerMethod).isText("tolower(");
-    test.run("$filter=toupper(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ToupperMethod).isText("toupper(");
-    test.run("$filter=trim(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.TrimMethod).isText("trim(");
-    test.run("$filter=concat(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ConcatMethod).isText("concat(");
-  }
-
-  @Test
-  public void literalDataValues() {
-    // null
-    test.run("null").has(TokenKind.NULL).isInput();
-
-    // binary
-    test.run("binary'ABCD'").has(TokenKind.BinaryValue).isInput();
-    test.run("BiNaRy'ABCD'").has(TokenKind.BinaryValue).isInput();
-
-    // boolean
-    test.run("true").has(TokenKind.BooleanValue).isInput();
-    test.run("false").has(TokenKind.BooleanValue).isInput();
-    test.run("TrUe").has(TokenKind.BooleanValue).isInput();
-    test.run("FaLsE").has(TokenKind.BooleanValue).isInput();
-
-    // Lexer rule INT
-    test.run("123").has(TokenKind.IntegerValue).isInput();
-    test.run("123456789").has(TokenKind.IntegerValue).isInput();
-    test.run("+123").has(TokenKind.IntegerValue).isInput();
-    test.run("+123456789").has(TokenKind.IntegerValue).isInput();
-    test.run("-123").has(TokenKind.IntegerValue).isInput();
-    test.run("-123456789").has(TokenKind.IntegerValue).isInput();
-
-    // Lexer rule DECIMAL
-    test.run("0.1").has(TokenKind.DecimalValue).isInput();
-    test.run("1.1").has(TokenKind.DecimalValue).isInput();
-    test.run("+0.1").has(TokenKind.DecimalValue).isInput();
-    test.run("+1.1").has(TokenKind.DecimalValue).isInput();
-    test.run("-0.1").has(TokenKind.DecimalValue).isInput();
-    test.run("-1.1").has(TokenKind.DecimalValue).isInput();
-
-    // Lexer rule EXP
-    test.run("1.1e+1").has(TokenKind.DoubleValue).isInput();
-    test.run("1.1e-1").has(TokenKind.DoubleValue).isInput();
-
-    test.run("NaN").has(TokenKind.DoubleValue).isInput();
-    test.run("-INF").has(TokenKind.DoubleValue).isInput();
-    test.run("INF").has(TokenKind.DoubleValue).isInput();
-
-    // Lexer rule GUID
-    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").has(TokenKind.GuidValue).isInput();
-    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").has(TokenKind.GuidValue).isInput();
-
-    // Lexer rule DATE
-    test.run("2013-11-15").has(TokenKind.DateValue).isInput();
-
-    // Lexer rule DATETIMEOFFSET
-    test.run("2013-11-15T13:35Z").has(TokenKind.DateTimeOffsetValue).isInput();
-    test.run("2013-11-15T13:35:10Z").has(TokenKind.DateTimeOffsetValue).isInput();
-    test.run("2013-11-15T13:35:10.1234Z").has(TokenKind.DateTimeOffsetValue).isInput();
-
-    test.run("2013-11-15T13:35:10.1234+01:30").has(TokenKind.DateTimeOffsetValue).isInput();
-    test.run("2013-11-15T13:35:10.1234-01:12").has(TokenKind.DateTimeOffsetValue).isInput();
-
-    test.run("2013-11-15T13:35Z").has(TokenKind.DateTimeOffsetValue).isInput();
-
-    // Lexer rule DURATION
-    test.run("duration'PT67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT67.89S'").has(TokenKind.DurationValue).isInput();
-
-    test.run("duration'PT5M'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT5M67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT5M67.89S'").has(TokenKind.DurationValue).isInput();
-
-    test.run("duration'PT4H'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT4H67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT4H67.89S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT4H5M'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT4H5M67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'PT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
-
-    test.run("duration'P3D'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT67.89S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT5M'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT5M67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT5M67.89S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT4H'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT4H67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT4H67.89S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT4H5M'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT4H5M67S'").has(TokenKind.DurationValue).isInput();
-    test.run("duration'P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
-
-    test.run("DuRaTiOn'P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
-    test.run("DuRaTiOn'-P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
-
-    test.run("20:00").has(TokenKind.TimeOfDayValue).isInput();
-    test.run("20:15:01").has(TokenKind.TimeOfDayValue).isInput();
-    test.run("20:15:01.02").has(TokenKind.TimeOfDayValue).isInput();
-
-    test.run("20:15:01.02").has(TokenKind.TimeOfDayValue).isInput();
-
-    // String
-    test.run("'ABC'").has(TokenKind.StringValue).isInput();
-    test.run("'A%20C'").has(TokenKind.StringValue).isInput();
-    test.run("'%20%20%20ABC'").has(TokenKind.StringValue).isInput();
-  }
-
-  @Test
-  public void delims() {
-    final String reserved = "/";
-    // Test lexer rule UNRESERVED
-//    test.run("$format=A/" + cUNRESERVED).has(TokenKind.FORMAT).isInput();
-//    test.run("$format=A/" + cUNRESERVED + reserved).has(TokenKind.FORMAT).isText(cUNRESERVED);
-    // Test lexer rule PCT_ENCODED
-//    test.run("$format=A/" + cPCT_ENCODED).has(TokenKind.FORMAT).isInput();
-//    test.run("$format=A/" + cPCT_ENCODED + reserved).has(TokenKind.FORMAT).isText(cPCT_ENCODED);
-    // Test lexer rule SUB_DELIMS
-//    test.run("$format=A/" + cSUB_DELIMS).has(TokenKind.FORMAT).isInput();
-//    test.run("$format=A/" + cSUB_DELIMS + reserved).has(TokenKind.FORMAT).isText("$");
-    // Test lexer rule PCHAR rest
-//    test.run("$format=A/:@").has(TokenKind.FORMAT).isInput();
-//    test.run("$format=A/:@" + reserved).has(TokenKind.FORMAT).isText(":@");
-    // Test lexer rule PCHAR all
-//    test.run("$format=" + cPCHAR + "/" + cPCHAR).has(TokenKind.FORMAT).isInput();
-  }
-
-  public class TokenValidator {
-
-    private String input = null;
-    private UriTokenizer tokenizer = null;
-    private String curText = null;
-
-    public TokenValidator run(final String uri) {
-      input = uri;
-      tokenizer = new UriTokenizer(uri);
-      curText = "";
-      return this;
-    }
-
-    public TokenValidator has(final TokenKind... expected) {
-      for (final TokenKind kind : expected) {
-        assertTrue(tokenizer.next(kind));
-        curText += tokenizer.getText();
-      }
-      return this;
-    }
-
-    public TokenValidator isText(final String expected) {
-      assertEquals(expected, tokenizer.getText());
-      return this;
-    }
-
-    public TokenValidator isInput() {
-      assertEquals(input, curText);
-      assertTrue(tokenizer.next(TokenKind.EOF));
-      return this;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
deleted file mode 100644
index dd517f9..0000000
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
+++ /dev/null
@@ -1,1046 +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.server.core.uri.antlr;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.server.api.OData;
-import org.apache.olingo.server.api.edmx.EdmxReference;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriResourceKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
-import org.apache.olingo.server.core.uri.testutil.FilterValidator;
-import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
-import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
-import org.apache.olingo.server.core.uri.validator.UriValidationException;
-import org.apache.olingo.server.tecsvc.provider.ActionProvider;
-import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
-import org.apache.olingo.server.tecsvc.provider.ContainerProvider;
-import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
-import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
-import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class TestUriParserImpl {
-  private final Edm edm = OData.newInstance().createServiceMetadata(
-      new EdmTechProvider(), Collections.<EdmxReference> emptyList()).getEdm();
-  private final TestUriValidator testUri = new TestUriValidator().setEdm(edm);
-  private final ResourceValidator testRes = new ResourceValidator().setEdm(edm);
-  private final FilterValidator testFilter = new FilterValidator().setEdm(edm);
-
-  private final String PropertyBoolean = "PropertyBoolean=true";
-  private final String PropertyByte = "PropertyByte=1";
-  private final String PropertyDate = "PropertyDate=2013-09-25";
-  private final String PropertyDateTimeOffset = "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00";
-  private final String PropertyDecimal = "PropertyDecimal=12";
-  private final String PropertyDuration = "PropertyDuration=duration'P50903316DT2H25M4S'";
-  private final String PropertyGuid = "PropertyGuid=12345678-1234-1234-1234-123456789012";
-  private final String PropertyInt16 = "PropertyInt16=1";
-  private final String PropertyInt32 = "PropertyInt32=12";
-  private final String PropertyInt64 = "PropertyInt64=64";
-  private final String PropertySByte = "PropertySByte=1";
-  private final String PropertyString = "PropertyString='ABC'";
-  private final String PropertyTimeOfDay = "PropertyTimeOfDay=12:34:55";
-
-  private final String allKeys = PropertyString + "," + PropertyInt16 + "," + PropertyBoolean + "," + PropertyByte
-      + "," + PropertySByte + "," + PropertyInt32 + "," + PropertyInt64 + "," + PropertyDecimal + "," + PropertyDate
-      + "," + PropertyDateTimeOffset + "," + PropertyDuration + "," + PropertyGuid + "," + PropertyTimeOfDay;
-
-  @Test
-  public void boundFunctionImport_VarParameters() {
-    // no input
-    testRes.run("ESKeyNav(1)/olingo.odata.test1.BFCETKeyNavRTETKeyNav()")
-    .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
-    .at(1).isUriPathInfoKind(UriResourceKind.function);
-
-    // one input
-    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')")
-    .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
-    .at(1).isUriPathInfoKind(UriResourceKind.function)
-    .isParameter(0, "ParameterString", "'ABC'");
-
-    // two input
-    testRes.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
-    .at(0)
-    .isUriPathInfoKind(UriResourceKind.function)
-    .isParameter(0, "ParameterInt16", "1")
-    .isParameter(1, "ParameterString", "'2'");
-  }
-
-  @Test
-  public void functionBound_varReturnType() {
-    final String esTwoKeyNav = "ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')";
-
-    // returning primitive
-    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()")
-    .at(0)
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-    .at(1)
-    .isUriPathInfoKind(UriResourceKind.function)
-    .isType(PropertyProvider.nameString, false);
-
-    // returning collection of primitive
-    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()")
-    .at(0)
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-    .at(1)
-    .isUriPathInfoKind(UriResourceKind.function)
-    .isType(PropertyProvider.nameString, true);
-
-    // returning single complex
-    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()")
-    .at(0)
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-    .at(1)
-    .isUriPathInfoKind(UriResourceKind.function)
-    .isType(ComplexTypeProvider.nameCTTwoPrim, false);
-
-    // returning collection of complex
-    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
-    .at(0)
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-    .at(1)
-    .isUriPathInfoKind(UriResourceKind.function)
-    .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
-    // returning single entity
-    testRes.run(
-        esTwoKeyNav + "/olingo.odata.test1.ETBaseTwoKeyNav/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.function)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false);
-
-    // returning collection of entity (aka entitySet)
-    testRes.run(esTwoKeyNav + "/olingo.odata.test1.BFCSINavRTESTwoKeyNav()")
-    .at(0)
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-    .at(1)
-    .isUriPathInfoKind(UriResourceKind.function)
-    .isType(EntityTypeProvider.nameETTwoKeyNav, true);
-  }
-
-  @Test
-  public void actionImport_VarReturnType() {
-    testRes.run(ContainerProvider.AIRT_STRING).isKind(UriInfoKind.resource)
-    .first()
-    .isActionImport(ContainerProvider.AIRT_STRING)
-    .isAction(ActionProvider.nameUARTString.getName())
-    .isType(PropertyProvider.nameString, false);
-
-    testRes.run(ContainerProvider.AIRT_COLL_STRING_TWO_PARAM).isKind(UriInfoKind.resource)
-        .first()
-        .isActionImport(ContainerProvider.AIRT_COLL_STRING_TWO_PARAM)
-        .isAction(ActionProvider.nameUARTCollStringTwoParam.getName())
-        .isType(PropertyProvider.nameString, true);
-
-    testRes.run(ContainerProvider.AIRTCT_TWO_PRIM_PARAM).isKind(UriInfoKind.resource)
-    .first()
-    .isActionImport(ContainerProvider.AIRTCT_TWO_PRIM_PARAM)
-    .isAction(ActionProvider.nameUARTCTTwoPrimParam.getName())
-    .isType(ComplexTypeProvider.nameCTTwoPrim, false);
-
-    testRes.run(ContainerProvider.AIRT_COLL_CT_TWO_PRIM_PARAM).isKind(UriInfoKind.resource)
-    .first()
-    .isActionImport(ContainerProvider.AIRT_COLL_CT_TWO_PRIM_PARAM)
-    .isAction(ActionProvider.nameUARTCollCTTwoPrimParam.getName())
-    .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
-    testRes.run(ContainerProvider.AIRTET_TWO_KEY_TWO_PRIM_PARAM).isKind(UriInfoKind.resource)
-    .first()
-    .isActionImport(ContainerProvider.AIRTET_TWO_KEY_TWO_PRIM_PARAM)
-    .isAction(ActionProvider.nameUARTETTwoKeyTwoPrimParam.getName())
-    .isType(EntityTypeProvider.nameETTwoKeyTwoPrim, false);
-
-    testUri.runEx(ContainerProvider.AIRT_STRING + "/invalidElement")
-        .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
-  }
-
-  @Test
-  public void count() {
-    // count entity set
-    testRes.run("ESAllPrim/$count")
-    .at(0)
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETAllPrim, true)
-    .at(1)
-    .isUriPathInfoKind(UriResourceKind.count);
-
-    // count on collection of complex
-    testRes.run("ESKeyNav(1)/CollPropertyComp/$count")
-    .at(0)
-    .isType(EntityTypeProvider.nameETKeyNav)
-    .at(1)
-    .isType(ComplexTypeProvider.nameCTPrimComp, true)
-    .at(2)
-    .isUriPathInfoKind(UriResourceKind.count);
-
-    // count on collection of primitive
-    testRes.run("ESCollAllPrim(1)/CollPropertyString/$count")
-    .at(1)
-    .isType(PropertyProvider.nameString, true)
-    .at(2)
-    .isUriPathInfoKind(UriResourceKind.count);
-  }
-
-  @Test
-  public void crossJoin() throws Exception {
-    testUri.run("$crossjoin(ESAllKey)")
-    .isKind(UriInfoKind.crossjoin)
-    .isCrossJoinEntityList(Arrays.asList("ESAllKey"));
-
-    testUri.run("$crossjoin(ESAllKey,ESTwoPrim)")
-    .isKind(UriInfoKind.crossjoin)
-    .isCrossJoinEntityList(Arrays.asList("ESAllKey", "ESTwoPrim"));
-  }
-
-  @Test
-  public void entityFailOnValidation() throws Exception {
-    // simple entity set; with qualifiedentityTypeName; with filter
-    testUri.runEx("$entity/olingo.odata.test1.ETTwoPrim", "$filter=PropertyInt16 eq 123&$id=ESAllKey")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-  }
-
-  @Test
-  public void entity() throws Exception {
-    // simple entity set
-    testUri.run("$entity", "$id=ESAllPrim").isKind(UriInfoKind.entityId)
-    .isKind(UriInfoKind.entityId)
-    .isIdText("ESAllPrim");
-
-    // simple entity set; $format before $id
-    testUri.run("$entity", "$format=xml&$id=ETAllPrim").isKind(UriInfoKind.entityId)
-    .isFormatText("xml")
-    .isIdText("ETAllPrim");
-
-    testUri.run("$entity", "$format=xml&abc=123&$id=ESAllKey").isKind(UriInfoKind.entityId)
-    .isFormatText("xml")
-    .isCustomParameter(0, "abc", "123")
-    .isIdText("ESAllKey");
-
-    // simple entity set; $format after $id
-    testUri.run("$entity", "$id=ETAllPrim&$format=xml").isKind(UriInfoKind.entityId)
-    .isIdText("ETAllPrim")
-    .isFormatText("xml");
-
-    // simple entity set; $format and custom parameter after $id
-    testUri.run("$entity", "$id=ETAllPrim&$format=xml&abc=123").isKind(UriInfoKind.entityId)
-    .isIdText("ETAllPrim")
-    .isFormatText("xml")
-    .isCustomParameter(0, "abc", "123");
-
-    // simple entity set; $format before $id and custom parameter after $id
-    testUri.run("$entity", "$format=xml&$id=ETAllPrim&abc=123").isKind(UriInfoKind.entityId)
-    .isFormatText("xml")
-    .isIdText("ETAllPrim")
-    .isCustomParameter(0, "abc", "123");
-
-    // simple entity set; with qualifiedentityTypeName
-    testUri.run("$entity/olingo.odata.test1.ETTwoPrim", "$id=ESBase")
-    .isEntityType(EntityTypeProvider.nameETTwoPrim)
-    .isIdText("ESBase");
-
-    // simple entity set; with qualifiedentityTypeName;
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim")
-    .isEntityType(EntityTypeProvider.nameETBase)
-    .isKind(UriInfoKind.entityId)
-    .isIdText("ESTwoPrim");
-
-    // simple entity set; with qualifiedentityTypeName; with format
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$format=atom")
-    .isKind(UriInfoKind.entityId)
-    .isEntityType(EntityTypeProvider.nameETBase)
-    .isIdText("ESTwoPrim")
-    .isFormatText("atom");
-
-    // simple entity set; with qualifiedentityTypeName; with select
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$select=*")
-    .isKind(UriInfoKind.entityId)
-    .isEntityType(EntityTypeProvider.nameETBase)
-    .isIdText("ESTwoPrim")
-    .isSelectItemStar(0);
-
-    // simple entity set; with qualifiedentityTypeName; with expand
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$expand=*")
-    .isKind(UriInfoKind.entityId)
-    .isEntityType(EntityTypeProvider.nameETBase)
-    .isIdText("ESTwoPrim")
-    .goExpand().first().isSegmentStar();
-  }
-
-  @Test
-  public void entitySet() throws Exception {
-    // plain entity set
-    testRes.run("ESAllPrim")
-    .isEntitySet("ESAllPrim")
-    .isType(EntityTypeProvider.nameETAllPrim);
-
-    // with one key; simple key notation
-    testRes.run("ESAllPrim(1)")
-    .isEntitySet("ESAllPrim")
-    .isType(EntityTypeProvider.nameETAllPrim)
-    .isKeyPredicate(0, "PropertyInt16", "1");
-
-    // with one key; name value key notation
-    testRes.run("ESAllPrim(PropertyInt16=1)")
-    .isEntitySet("ESAllPrim")
-    .isKeyPredicate(0, "PropertyInt16", "1");
-
-    // with two keys
-    testRes.run("ESTwoKeyTwoPrim(PropertyInt16=1,PropertyString='ABC')")
-    .isEntitySet("ESTwoKeyTwoPrim")
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .isKeyPredicate(1, "PropertyString", "'ABC'");
-
-    // with all keys
-    testRes.run("ESAllKey(" + allKeys + ")")
-    .isEntitySet("ESAllKey")
-    .isKeyPredicate(0, "PropertyString", "'ABC'")
-    .isKeyPredicate(1, "PropertyInt16", "1")
-    .isKeyPredicate(2, "PropertyBoolean", "true")
-    .isKeyPredicate(3, "PropertyByte", "1")
-    .isKeyPredicate(4, "PropertySByte", "1")
-    .isKeyPredicate(5, "PropertyInt32", "12")
-    .isKeyPredicate(6, "PropertyInt64", "64")
-    .isKeyPredicate(7, "PropertyDecimal", "12")
-    .isKeyPredicate(8, "PropertyDate", "2013-09-25")
-    .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
-    .isKeyPredicate(10, "PropertyDuration", "duration'P50903316DT2H25M4S'")
-    .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
-    .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55");
-  }
-
-  @Test
-  public void entitySet_NavigationProperty() {
-    // with navigation property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
-    .at(0)
-    .isEntitySet("ESKeyNav")
-    .isType(EntityTypeProvider.nameETKeyNav)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-    .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    // with navigation property -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
-    .at(0)
-    .isEntitySet("ESKeyNav")
-    .isType(EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-    .at(2)
-    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    // with navigation property -> navigation property -> navigation property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
-    .at(0)
-    .isEntitySet("ESKeyNav")
-    .isType(EntityTypeProvider.nameETKeyNav)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-    .isType(EntityTypeProvider.nameETTwoKeyNav)
-    .at(2)
-    .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
-    .isType(EntityTypeProvider.nameETKeyNav);
-
-    // with navigation property(key)
-    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)")
-    .at(0)
-    .isEntitySet("ESKeyNav")
-    .at(1)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1");
-
-    // with navigation property(key) -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/PropertyString").at(0)
-    .at(0)
-    .isEntitySet("ESKeyNav")
-    .at(1)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(2)
-    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    // with navigation property(key) -> navigation property
-    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne")
-    .isEntitySet("ESKeyNav")
-    .at(1)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(2)
-    .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
-    // with navigation property(key) -> navigation property(key)
-    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)")
-    .isEntitySet("ESKeyNav")
-    .isType(EntityTypeProvider.nameETKeyNav)
-    .at(1)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(2)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1");
-
-    // with navigation property(key) -> navigation property -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne/PropertyString")
-    .at(0)
-    .isEntitySet("ESKeyNav")
-    .isType(EntityTypeProvider.nameETKeyNav)
-    .at(1)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(2)
-    .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
-    .isType(EntityTypeProvider.nameETKeyNav)
-    .at(3)
-    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    // with navigation property(key) -> navigation property(key) -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)/PropertyString")
-    .at(0)
-    .isEntitySet("ESKeyNav")
-    .isType(EntityTypeProvider.nameETKeyNav)
-    .at(1)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(2)
-    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(3)
-    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-  }
-
-  @Test
-  public void entitySet_Property() {
-    // with property
-    testRes.run("ESAllPrim(1)/PropertyString")
-    .at(0)
-    .isEntitySet("ESAllPrim")
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    // with complex property
-    testRes.run("ESCompAllPrim(1)/PropertyComp")
-    .at(0)
-    .isEntitySet("ESCompAllPrim")
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false);
-
-    // with two properties
-    testRes.run("ESCompAllPrim(1)/PropertyComp/PropertyString")
-    .at(0)
-    .isEntitySet("ESCompAllPrim")
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false)
-    .at(2)
-    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-  }
-
-  @Test
-  public void entitySet_TypeFilter() {
-    // filter
-    testRes.run("ESTwoPrim/olingo.odata.test1.ETBase")
-    .at(0)
-    .isEntitySet("ESTwoPrim")
-    .isType(EntityTypeProvider.nameETTwoPrim, true)
-    .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
-    .isTypeFilterOnEntry(null);
-
-    // filter before key predicate
-    testRes.run("ESTwoPrim/olingo.odata.test1.ETBase(PropertyInt16=1)")
-    .at(0)
-    .isEntitySet("ESTwoPrim")
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoPrim)
-    .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
-    .isTypeFilterOnEntry(null)
-    .at(0)
-    .isType(EntityTypeProvider.nameETTwoPrim, false)
-    .isKeyPredicate(0, "PropertyInt16", "1");
-
-    // filter before key predicate; property of sub type
-    testRes.run("ESTwoPrim/olingo.odata.test1.ETBase(PropertyInt16=1)/AdditionalPropertyString_5")
-    .at(0)
-    .isEntitySet("ESTwoPrim")
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoPrim)
-    .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
-    .isTypeFilterOnEntry(null)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isType(PropertyProvider.nameString)
-    .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false);
-
-    // filter after key predicate
-    testRes.run("ESTwoPrim(PropertyInt16=1)/olingo.odata.test1.ETBase")
-    .at(0)
-    .isEntitySet("ESTwoPrim")
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoPrim, false)
-    .isTypeFilterOnCollection(null)
-    .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
-    .isKeyPredicate(0, "PropertyInt16", "1");
-
-    // filter after key predicate; property of sub type
-    testRes.run("ESTwoPrim(PropertyInt16=1)/olingo.odata.test1.ETBase/AdditionalPropertyString_5")
-    .at(0)
-    .isEntitySet("ESTwoPrim")
-    .isUriPathInfoKind(UriResourceKind.entitySet)
-    .isType(EntityTypeProvider.nameETTwoPrim)
-    .isTypeFilterOnCollection(null)
-    .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .at(1)
-    .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false)
-    .isType(PropertyProvider.nameString);
-  }
-
-  @Test
-  public void unary() throws Exception {
-    testFilter.runOnETAllPrim("not PropertyBoolean").is("<not <PropertyBoolean>>");
-    testFilter.runOnETAllPrim("-PropertyInt16 eq PropertyInt16").is("<<- <PropertyInt16>> eq <PropertyInt16>>");
-  }
-
-  @Test
-  public void filterComplexMixedPriority() throws Exception {
-    testFilter.runOnETAllPrim("PropertyBoolean or true and false")
-        .is("<<PropertyBoolean> or <<true> and <false>>>");
-    testFilter.runOnETAllPrim("PropertyBoolean or true and PropertyInt64 eq PropertyByte")
-        .is("<<PropertyBoolean> or <<true> and <<PropertyInt64> eq <PropertyByte>>>>");
-    testFilter.runOnETAllPrim("PropertyBoolean or PropertyInt32 eq PropertyInt64 and true")
-        .is("<<PropertyBoolean> or <<<PropertyInt32> eq <PropertyInt64>> and <true>>>");
-    testFilter.runOnETAllPrim("PropertyBoolean or PropertyInt32 eq PropertyInt64 and PropertyByte eq PropertySByte")
-        .is("<<PropertyBoolean> or <<<PropertyInt32> eq <PropertyInt64>> "
-            + "and <<PropertyByte> eq <PropertySByte>>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyBoolean and true")
-        .is("<<<PropertyInt16> eq <PropertyInt32>> or <<PropertyBoolean> and <true>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyBoolean and PropertyByte eq PropertySByte")
-        .is("<<<PropertyInt16> eq <PropertyInt32>> "
-            + "or <<PropertyBoolean> and <<PropertyByte> eq <PropertySByte>>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 eq PropertyByte and PropertyBoolean")
-        .is("<<<PropertyInt16> eq <PropertyInt32>> "
-            + "or <<<PropertyInt64> eq <PropertyByte>> and <PropertyBoolean>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 eq PropertyByte "
-        + "and PropertySByte eq PropertyDecimal")
-        .is("<<<PropertyInt16> eq <PropertyInt32>> or <<<PropertyInt64> eq <PropertyByte>> "
-            + "and <<PropertySByte> eq <PropertyDecimal>>>>");
-  }
-
-  @Test
-  public void filterSimpleSameBinaryBinaryBinaryPriority() throws Exception {
-    testFilter.runOnETAllPrim("1 add 2 add 3 add 4 ge 0").isCompr("<<<< <1> add   <2>> add  <3>>  add <4>> ge <0>>");
-    testFilter.runOnETAllPrim("1 add 2 add 3 div 4 ge 0").isCompr("<<<  <1> add   <2>> add <<3>   div <4>>> ge <0>>");
-    testFilter.runOnETAllPrim("1 add 2 div 3 add 4 ge 0").isCompr("<<<  <1> add  <<2>  div  <3>>> add <4>> ge <0>>");
-    testFilter.runOnETAllPrim("1 add 2 div 3 div 4 ge 0").isCompr("<<   <1> add <<<2>  div  <3>>  div <4>>> ge <0>>");
-    testFilter.runOnETAllPrim("1 div 2 add 3 add 4 ge 0").isCompr("<<<< <1> div   <2>> add  <3>>  add <4>> ge <0>>");
-    testFilter.runOnETAllPrim("1 div 2 add 3 div 4 ge 0").isCompr("<<<  <1> div   <2>> add <<3>   div <4>>> ge <0>>");
-    testFilter.runOnETAllPrim("1 div 2 div 3 add 4 ge 0").isCompr("<<<< <1> div   <2>> div  <3>>  add <4>> ge <0>>");
-    testFilter.runOnETAllPrim("1 div 2 div 3 div 4 ge 0").isCompr("<<<< <1> div   <2>> div  <3>>  div <4>> ge <0>>");
-  }
-
-  @Test
-  public void functionImport_VarParameters() {
-    // no input
-    testRes.run("FINRTInt16()")
-    .isFunctionImport("FINRTInt16")
-    .isFunction("UFNRTInt16")
-    .isType(PropertyProvider.nameInt16);
-
-    // one input
-    testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
-    .isFunctionImport("FICRTETTwoKeyNavParam")
-    .isFunction("UFCRTETTwoKeyNavParam")
-    .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    // two input
-    testRes.run("FICRTStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
-    .isFunctionImport("FICRTStringTwoParam")
-    .isFunction("UFCRTStringTwoParam")
-    .isType(PropertyProvider.nameString);
-  }
-
-  @Test
-  public void functionImport_VarReturning() {
-    // returning primitive
-    testRes.run("FINRTInt16()")
-    .isFunctionImport("FINRTInt16")
-    .isFunction("UFNRTInt16")
-    .isType(PropertyProvider.nameInt16, false);
-
-    // returning collection of primitive
-    testRes.run("FICRTCollStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
-    .isFunctionImport("FICRTCollStringTwoParam")
-    .isFunction("UFCRTCollStringTwoParam")
-    .isType(PropertyProvider.nameString, true);
-
-    // returning single complex
-    testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)")
-    .isFunctionImport("FICRTCTAllPrimTwoParam")
-    .isFunction("UFCRTCTAllPrimTwoParam")
-    .isType(ComplexTypeProvider.nameCTAllPrim, false);
-
-    // returning collection of complex
-    testRes.run("FICRTCollCTTwoPrim()")
-    .isFunctionImport("FICRTCollCTTwoPrim")
-    .isFunction("UFCRTCollCTTwoPrim")
-    .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
-    // returning single entity
-    testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
-    .isFunctionImport("FICRTETTwoKeyNavParam")
-    .isFunction("UFCRTETTwoKeyNavParam")
-    .isType(EntityTypeProvider.nameETTwoKeyNav, false);
-
-    // returning collection of entity (aka entitySet)
-    testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)")
-    .isFunctionImport("FICRTCollESTwoKeyNavParam")
-    .isFunction("UFCRTCollETTwoKeyNavParam")
-    .isType(EntityTypeProvider.nameETTwoKeyNav, true);
-  }
-
-  @Test
-  public void functionImportChain() {
-    // test chain; returning single complex
-    testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)/PropertyInt16")
-    .at(0)
-    .isFunctionImport("FICRTCTAllPrimTwoParam")
-    .isFunction("UFCRTCTAllPrimTwoParam")
-    .isType(ComplexTypeProvider.nameCTAllPrim, false)
-    .isParameter(0, "ParameterString", "'ABC'")
-    .isParameter(1, "ParameterInt16", "1")
-    .at(1)
-    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    // test chains; returning single entity
-    testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/PropertyInt16")
-    .at(0)
-    .isFunctionImport("FICRTETTwoKeyNavParam")
-    .isFunction("UFCRTETTwoKeyNavParam")
-    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-    .isParameter(0, "ParameterInt16", "1")
-    .at(1)
-    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    // test chains; returning collection of entity (aka entitySet)
-    testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')")
-    .at(0)
-    .isFunctionImport("FICRTCollESTwoKeyNavParam")
-    .isFunction("UFCRTCollETTwoKeyNavParam")
-    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-    .isParameter(0, "ParameterInt16", "1")
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .isKeyPredicate(1, "PropertyString", "'ABC'");
-
-    // test chains; returning collection of entity (aka entitySet)
-    testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')/PropertyInt16")
-    .at(0)
-    .isFunctionImport("FICRTCollESTwoKeyNavParam")
-    .isFunction("UFCRTCollETTwoKeyNavParam")
-    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-    .isParameter(0, "ParameterInt16", "1")
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .isKeyPredicate(1, "PropertyString", "'ABC'")
-    .at(1)
-    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-  }
-
-  @Test
-  public void metaData() throws Exception {
-    // Parsing the fragment may be used if a uri has to be parsed on the consumer side.
-    // On the producer side this feature is currently not supported, so the context fragment
-    // part is only available as text.
-
-    testUri.run("$metadata")
-    .isKind(UriInfoKind.metadata);
-
-    testUri.run("$metadata", "$format=atom")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom");
-
-    // with context (client usage)
-
-    testUri.run("$metadata", null, "$ref")
-    .isKind(UriInfoKind.metadata)
-    .isFragmentText("$ref");
-
-    testUri.run("$metadata", "$format=atom", "$ref")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("$ref");
-
-    testUri.run("$metadata", "$format=atom", "Collection($ref)")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("Collection($ref)");
-
-    testUri.run("$metadata", "$format=atom", "Collection(Edm.EntityType)")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("Collection(Edm.EntityType)");
-
-    testUri.run("$metadata", "$format=atom", "Collection(Edm.ComplexType)")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("Collection(Edm.ComplexType)");
-
-    testUri.run("$metadata", "$format=atom", "SINav")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("SINav");
-
-    testUri.run("$metadata", "$format=atom", "SINav/PropertyInt16")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("SINav/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavOne")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("SINav/NavPropertyETKeyNavOne");
-
-    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavMany(1)")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("SINav/NavPropertyETKeyNavMany(1)");
-
-    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavOne/PropertyInt16")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("SINav/NavPropertyETKeyNavOne/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavMany(1)/PropertyInt16")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("SINav/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom", "SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom",
-        "SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
-        .isKind(UriInfoKind.metadata)
-        .isFormatText("atom")
-        .isFragmentText("SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom", "olingo.odata.test1.ETAllKey")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("olingo.odata.test1.ETAllKey");
-
-    testUri.run("$metadata", "$format=atom", "ESTwoPrim/$deletedEntity")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESTwoPrim/$deletedEntity");
-
-    testUri.run("$metadata", "$format=atom", "ESTwoPrim/$link")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESTwoPrim/$link");
-
-    testUri.run("$metadata", "$format=atom", "ESTwoPrim/$deletedLink")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESTwoPrim/$deletedLink");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/PropertyInt16")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavOne")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavMany(1)")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom",
-        "ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
-        .isKind(UriInfoKind.metadata)
-        .isFormatText("atom")
-        .isFragmentText("ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
-
-    testUri.run(
-        "$metadata", "$format=atom", "ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
-        .isKind(UriInfoKind.metadata)
-        .isFormatText("atom")
-        .isFragmentText("ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav(PropertyInt16,PropertyString)")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav(PropertyInt16,PropertyString)");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/$entity")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/$entity");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/$delta")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/$delta");
-
-    testUri.run("$metadata", "$format=atom", "ESKeyNav/(PropertyInt16,PropertyString)/$delta")
-    .isKind(UriInfoKind.metadata)
-    .isFormatText("atom")
-    .isFragmentText("ESKeyNav/(PropertyInt16,PropertyString)/$delta");
-
-  }
-
-  @Test
-  public void ref() throws Exception {
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/$ref");
-  }
-
-  @Test
-  public void singleton() {
-    // plain singleton
-    testRes.run("SINav")
-    .isSingleton("SINav")
-    .isType(EntityTypeProvider.nameETTwoKeyNav);
-  }
-
-  @Test
-  public void navigationProperty() {
-    // with navigation property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
-    .at(0).isEntitySet("ESKeyNav")
-    .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
-
-    // with navigation property -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
-    .at(0).isEntitySet("ESKeyNav")
-    .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-    .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    // with navigation property -> navigation property -> navigation property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
-    .at(0).isEntitySet("ESKeyNav")
-    .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-    .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
-    // with navigation property(key)
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')")
-    .at(0).isEntitySet("ESKeyNav")
-    .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .isKeyPredicate(1, "PropertyString", "'1'");
-
-    // with navigation property(key) -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/PropertyString")
-    .at(0).isEntitySet("ESKeyNav")
-    .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .isKeyPredicate(1, "PropertyString", "'1'")
-    .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    // with navigation property(key) -> navigation property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/NavPropertyETKeyNavOne")
-    .at(0).isEntitySet("ESKeyNav")
-    .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-    .isKeyPredicate(0, "PropertyInt16", "1")
-    .isKeyPredicate(1, "PropertyString", "'1'")
-    .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
-    // with navigation property(key) -> navigation property(key)
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
-        + "/NavPropertyETKeyNavMany(1)")
-        .at(0).isEntitySet("ESKeyNav")
-        .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'1'")
-        .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1");
-
-    // with navigation property(key) -> navigation property -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
-        + "/NavPropertyETKeyNavOne/PropertyString")
-        .at(0).isEntitySet("ESKeyNav")
-        .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'1'")
-        .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
-        .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    // with navigation property(key) -> navigation property(key) -> property
-    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
-        + "/NavPropertyETKeyNavMany(1)/PropertyString")
-        .at(0).isEntitySet("ESKeyNav")
-        .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'1'")
-        .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-  }
-
-  @Test
-  public void singleton_Property() {
-    // with property
-    testRes.run("SINav/PropertyInt16")
-    .at(0)
-    .isSingleton("SINav")
-    .isType(EntityTypeProvider.nameETTwoKeyNav)
-    .at(1)
-    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    // with complex property
-    testRes.run("SINav/PropertyComp")
-    .at(0)
-    .isSingleton("SINav")
-    .isType(EntityTypeProvider.nameETTwoKeyNav)
-    .at(1)
-    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false);
-
-    // with two properties
-    testRes.run("SINav/PropertyComp/PropertyInt16")
-    .at(0)
-    .isSingleton("SINav")
-    .isType(EntityTypeProvider.nameETTwoKeyNav)
-    .at(1)
-    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
-    .at(2)
-    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-  }
-
-  @Test
-  public void value() throws Exception {
-    testUri.run("ESAllPrim(1)/PropertyString/$value");
-  }
-
-  @Test
-  public void memberStartingWithCastFailOnValidation1() throws Exception {
-    // on EntityType entry
-    testUri.runEx("ESTwoKeyNav(Property16=1,PropertyString='ABC')",
-        "$filter=olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate")
-        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-  }
-
-  @Test
-  public void memberStartingWithCastFailOnValidation2() throws Exception {
-    testUri.runEx("FICRTCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')",
-        "$filter=olingo.odata.test1.CTBase/AdditionalPropString")
-        .isExSemantic(UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE);
-  }
-
-  @Test
-  public void memberStartingWithCast() throws Exception {
-    // on EntityType collection
-    testFilter.runOnETTwoKeyNav("olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate eq null")
-    .left()
-    .isMember()
-    .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
-    .at(0).isType(PropertyProvider.nameDate);
-
-    // on Complex collection
-    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')",
-        "$filter=olingo.odata.test1.CTBase/AdditionalPropString eq null")
-        .goFilter().left().isMember()
-        .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
-        .at(0).isType(PropertyProvider.nameString);
-  }
-
-  @Test
-  public void complexTypeCastFollowingAsCollection() throws Exception {
-    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')/olingo.odata.test1.CTBase");
-  }
-
-  @Test
-  public void alias() throws Exception {
-    testFilter.runOnETAllPrim("PropertyInt16 eq @p1&@p1=1")
-        .is("<<PropertyInt16> eq <@p1>>");
-  }
-
-  @Test
-  public void lambda() throws Exception {
-    testFilter.runOnETTwoKeyNav("CollPropertyComp/all(l:true)")
-        .is("<CollPropertyComp/<ALL;<true>>>");
-
-    testFilter.runOnETTwoKeyNav("CollPropertyComp/all(x:x/PropertyInt16 eq 2)")
-        .is("<CollPropertyComp/<ALL;<<x/PropertyInt16> eq <2>>>>");
-
-    testFilter.runOnETTwoKeyNav("CollPropertyComp/any(l:true)")
-        .is("<CollPropertyComp/<ANY;<true>>>");
-    testFilter.runOnETTwoKeyNav("CollPropertyComp/any()")
-        .is("<CollPropertyComp/<ANY;>>");
-  }
-
-  @Test
-  public void customQueryOption() throws Exception {
-    testUri.run("ESTwoKeyNav", "custom")
-        .isCustomParameter(0, "custom", "");
-    testUri.run("ESTwoKeyNav", "custom=ABC")
-        .isCustomParameter(0, "custom", "ABC");
-  }
-
-  @Test
-  @Ignore("Geo types are not supported yet.")
-  public void geo() throws Exception {
-    testFilter.runOnETAllPrim("geo.distance(PropertySByte,PropertySByte)")
-        .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")
-        .isMethod(MethodKind.GEODISTANCE, 2);
-    testFilter.runOnETAllPrim("geo.length(PropertySByte)")
-        .is("<geo.length(<PropertySByte>)>")
-        .isMethod(MethodKind.GEOLENGTH, 1);
-    testFilter.runOnETAllPrim("geo.intersects(PropertySByte,PropertySByte)")
-        .is("<geo.intersects(<PropertySByte>,<PropertySByte>)>")
-        .isMethod(MethodKind.GEOINTERSECTS, 2);
-  }
-}


[45/51] [abbrv] olingo-odata4 git commit: OLINGO-853: Correcting the encoding of datetime properties correctly to be used in a URI

Posted by mi...@apache.org.
OLINGO-853: Correcting the encoding of datetime properties correctly to be used in a URI


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 03aa1d07d9b82e431d2b5949c4390aaf41aac6a3
Parents: 8537f3a
Author: Ramesh Reddy <ra...@jboss.org>
Authored: Thu Jan 21 13:13:37 2016 -0600
Committer: Ramesh Reddy <ra...@jboss.org>
Committed: Thu Jan 21 13:13:37 2016 -0600

----------------------------------------------------------------------
 .../server/core/responses/EntityResponse.java   | 43 ++++++++++++++++----
 .../olingo/server/example/TripPinDataModel.java |  4 +-
 2 files changed, 37 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/03aa1d07/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
index a687424..5bf86a3 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
@@ -24,13 +24,17 @@ import org.apache.olingo.commons.api.data.ContextURL;
 import org.apache.olingo.commons.api.data.Entity;
 import org.apache.olingo.commons.api.edm.EdmEntitySet;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmString;
 import org.apache.olingo.server.api.ODataApplicationException;
+import org.apache.olingo.server.api.ODataLibraryException;
 import org.apache.olingo.server.api.ODataResponse;
 import org.apache.olingo.server.api.ODataServerError;
-import org.apache.olingo.server.api.ODataLibraryException;
 import org.apache.olingo.server.api.ServiceMetadata;
 import org.apache.olingo.server.api.serializer.EntitySerializerOptions;
 import org.apache.olingo.server.api.serializer.ODataSerializer;
@@ -99,7 +103,12 @@ public class EntityResponse extends ServiceResponse {
     // exception
     assert (entity != null);
     
-    String locationHeader = buildLocation(this.baseURL, entity, entitySet.getName(), entitySet.getEntityType());
+    String locationHeader;
+    try {
+      locationHeader = buildLocation(this.baseURL, entity, entitySet.getName(), entitySet.getEntityType());
+    } catch (EdmPrimitiveTypeException e) {
+      throw new SerializerException(e.getMessage(), e, SerializerException.MessageKeys.WRONG_PRIMITIVE_VALUE);
+    }
 
     // Note that if media written just like Stream, but on entity URL
 
@@ -163,12 +172,20 @@ public class EntityResponse extends ServiceResponse {
     close();
   }  
   
-  public static String buildLocation(String baseURL, Entity entity, String enitySetName, EdmEntityType type) {
+  public static String buildLocation(String baseURL, Entity entity, String enitySetName, EdmEntityType type) 
+      throws EdmPrimitiveTypeException {
+    StringBuilder location = new StringBuilder();
+    location.append(baseURL).append("/").append(enitySetName);
+    location.append(buildKeySegmentsURI(entity, type));
+    return location.toString();
+  }
+
+  public static String buildKeySegmentsURI(Entity entity, EdmEntityType type)
+      throws EdmPrimitiveTypeException {
     StringBuilder location = new StringBuilder();
-    location.append(baseURL).append("/").append(enitySetName).append("(");
     int i = 0;
     boolean usename = type.getKeyPredicateNames().size() > 1;
-
+    location.append("(");
     for (String key : type.getKeyPredicateNames()) {
       if (i > 0) {
         location.append(",");
@@ -177,11 +194,19 @@ public class EntityResponse extends ServiceResponse {
       if (usename) {
         location.append(key).append("=");
       }
-      if (entity.getProperty(key).getType().equals("Edm.String")) {
-        location.append("'").append(entity.getProperty(key).getValue().toString()).append("'");
-      } else {
-        location.append(entity.getProperty(key).getValue().toString());
+      String propertyType = entity.getProperty(key).getType();
+      Object propertyValue = entity.getProperty(key).getValue();
+      
+      if(propertyType.startsWith("Edm.")) {
+        propertyType = propertyType.substring(4);
+      }
+      EdmPrimitiveTypeKind kind = EdmPrimitiveTypeKind.valueOf(propertyType);
+      String value =  EdmPrimitiveTypeFactory.getInstance(kind).valueToString(
+          propertyValue, true, 4000, 0, 0, true);
+      if (kind == EdmPrimitiveTypeKind.String) {
+          value = EdmString.getInstance().toUriLiteral(value);
       }
+      location.append(value);
     }
     location.append(")");
     return location.toString();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/03aa1d07/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
index 646e835..c58d9ce 100644
--- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
+++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
@@ -625,8 +625,10 @@ public class TripPinDataModel {
     } catch (URISyntaxException e) {
       throw new ODataApplicationException("Failed to create ID for entity", 500,
           Locale.getDefault());
+    } catch (EdmPrimitiveTypeException e) {
+      throw new ODataApplicationException("Failed to create ID for entity", 500,
+          Locale.getDefault());
     }
-
     set.getEntities().add(copy);
     return copy;
   }


[32/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] URI parser shall not ignore empty path segments

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
deleted file mode 100644
index a94026f..0000000
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
+++ /dev/null
@@ -1,5900 +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.server.core.uri.antlr;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ContentType;
-import org.apache.olingo.server.api.OData;
-import org.apache.olingo.server.api.edmx.EdmxReference;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriResourceKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.uri.parser.UriParserSemanticException.MessageKeys;
-import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
-import org.apache.olingo.server.core.uri.parser.search.SearchParserException;
-import org.apache.olingo.server.core.uri.testutil.FilterValidator;
-import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
-import org.apache.olingo.server.core.uri.validator.UriValidationException;
-import org.apache.olingo.server.tecsvc.provider.ActionProvider;
-import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
-import org.apache.olingo.server.tecsvc.provider.ContainerProvider;
-import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
-import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
-import org.apache.olingo.server.tecsvc.provider.EnumTypeProvider;
-import org.apache.olingo.server.tecsvc.provider.FunctionProvider;
-import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
-import org.apache.olingo.server.tecsvc.provider.TypeDefinitionProvider;
-import org.junit.Test;
-
-public class TestFullResourcePath {
-
-  private static final OData oData = OData.newInstance();
-  private static final Edm edm = oData.createServiceMetadata(
-      new EdmTechProvider(), Collections.<EdmxReference> emptyList()).getEdm();
-  private final TestUriValidator testUri;
-  private final FilterValidator testFilter;
-
-  public TestFullResourcePath() {
-    testUri = new TestUriValidator().setEdm(edm);
-    testFilter = new FilterValidator().setEdm(edm);
-  }
-
-  @Test
-  public void enumAndTypeDefAsKey() throws Exception {
-    testUri
-        .run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',PropertyDefString='abc')")
-        .goPath()
-        .at(0)
-        .isEntitySet("ESMixEnumDefCollComp")
-        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
-        .isKeyPredicate(1, "PropertyDefString", "'abc'");
-
-    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has Namespace1_Alias.ENString'String1'")
-        .is("<<PropertyEnumString> has <olingo.odata.test1.ENString<String1>>>");
-
-    testUri
-        .run("ESMixEnumDefCollComp(PropertyEnumString=Namespace1_Alias.ENString'String1',PropertyDefString='abc')")
-        .goPath()
-        .at(0)
-        .isEntitySet("ESMixEnumDefCollComp")
-        .isKeyPredicate(0, "PropertyEnumString", "Namespace1_Alias.ENString'String1'")
-        .isKeyPredicate(1, "PropertyDefString", "'abc'");
-  }
-
-  @Test
-  public void functionBound_varOverloading() throws Exception {
-    // on ESTwoKeyNav
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.function)
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    // with string parameter
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')").goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.function)
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    // with string parameter
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.function)
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-  }
-
-  @Test
-  public void runBfuncBnCpropCastRtEs() throws Exception {
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isComplex("PropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav");
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isComplex("PropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav")
-        .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isUriPathInfoKind(UriResourceKind.count);
-
-  }
-
-  @Test
-  public void runBfuncBnCpropCollRtEs() throws Exception {
-    testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isUriPathInfoKind(UriResourceKind.complexProperty)
-        .isComplex("CollPropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, true)
-        .n()
-        .isFunction("BFCCollCTPrimCompRTESAllPrim");
-
-    testUri
-        .run("ESKeyNav(PropertyInt16=1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isUriPathInfoKind(UriResourceKind.complexProperty)
-        .isComplex("CollPropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, true)
-        .n()
-        .isFunction("BFCCollCTPrimCompRTESAllPrim")
-        .isType(EntityTypeProvider.nameETAllPrim, true)
-        .n()
-        .isUriPathInfoKind(UriResourceKind.count);
-  }
-
-  @Test
-  public void runBfuncBnCpropRtEs() throws Exception {
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
-        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isUriPathInfoKind(UriResourceKind.complexProperty)
-        .isComplex("PropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isFunction("BFCCTPrimCompRTESTwoKeyNav");
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
-        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isUriPathInfoKind(UriResourceKind.complexProperty)
-        .isComplex("PropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isFunction("BFCCTPrimCompRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .n()
-        .isUriPathInfoKind(UriResourceKind.count);
-
-  }
-
-  @Test
-  public void runBfuncBnEntityRtEs() throws Exception {
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isFunction("BFCETTwoKeyNavRTESTwoKeyNav");
-  }
-
-  @Test
-  public void runBfuncBnEntityCastRtEs() throws Exception {
-    testUri
-        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-            + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
-
-    testUri
-        .run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='(''2'')')"
-            + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'(''2'')'")
-        .n()
-        .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
-  }
-
-  @Test
-  public void runBfuncBnEsCastRtEs() throws Exception {
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey");
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()"
-        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey")
-        .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
-    testUri.run("ESTwoKeyNav"
-        + "/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()"
-        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
-        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-  }
-
-  @Test
-  public void runBfuncBnEsRtCprop() throws Exception {
-    testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllPrim")
-        .n()
-        .isFunction("BFNESAllPrimRTCTAllPrim")
-        .isType(ComplexTypeProvider.nameCTAllPrim);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()/olingo.odata.test1.CTBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTCTTwoPrim")
-        .isType(ComplexTypeProvider.nameCTTwoPrim, false)
-        .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase);
-  }
-
-  @Test
-  public void runBfuncBnEsRtCpropColl() throws Exception {
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
-        .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
-        .isType(ComplexTypeProvider.nameCTTwoPrim, true)
-        .n()
-        .isUriPathInfoKind(UriResourceKind.count);
-  }
-
-  @Test
-  public void runBfuncBnEsRtEntityPpNp() throws Exception {
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
-        .n()
-        .isUriPathInfoKind(UriResourceKind.ref);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/NavPropertyETMediaOne/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNav")
-        .n()
-        .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
-        .n()
-        .isValue();
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
-        + "/NavPropertyETTwoKeyNavOne")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNavParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
-        + "/NavPropertyETTwoKeyNavOne/PropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNavParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isComplex("PropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
-        + "/NavPropertyETTwoKeyNavOne/PropertyComp/PropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNavParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isComplex("PropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp)
-        .n()
-        .isComplex("PropertyComp")
-        .isType(ComplexTypeProvider.nameCTAllPrim);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
-        + "/NavPropertyETTwoKeyNavOne/PropertyString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNavParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
-        + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/PropertyString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNavParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    testUri.runEx("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(WrongParameter='1')")
-        .isExSemantic(MessageKeys.UNKNOWN_PART);
-    testUri.runEx("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString=wrong)")
-        .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
-  }
-
-  @Test
-  public void runBfuncBnEsRtEntyPpNpCast() throws Exception {
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()"
-        + "/NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
-    testUri
-        .run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')"
-            + "/NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETTwoBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
-  }
-
-  @Test
-  public void runBfuncBnEsRtEntityPpCp() throws Exception {
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNav")
-        .n()
-        .isComplex("PropertyCompNav")
-        .isType(ComplexTypeProvider.nameCTNavFiveProp);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNav")
-        .n()
-        .isComplex("PropertyCompNav")
-        .isType(ComplexTypeProvider.nameCTNavFiveProp)
-        .n()
-        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNav")
-        .n()
-        .isComplex("PropertyCompNav")
-        .isType(ComplexTypeProvider.nameCTNavFiveProp)
-        .n()
-        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
-        .n()
-        .isValue();
-
-  }
-
-  @Test
-  public void runBfuncBnEsRtEntyPpCpCast() throws Exception {
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
-        + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNavParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .n()
-        .isComplex("PropertyCompTwoPrim")
-        .isType(ComplexTypeProvider.nameCTTwoPrim)
-        .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
-        + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
-        + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNavParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isComplex("PropertyCompTwoPrim")
-        .isType(ComplexTypeProvider.nameCTTwoPrim)
-        .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
-  }
-
-  @Test
-  public void runBfuncBnEsRtEntityPpSp() throws Exception {
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNav")
-        .n()
-        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESKeyNavRTETKeyNav")
-        .n()
-        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
-        .n()
-        .isValue();
-
-  }
-
-  @Test
-  public void runBfuncBnEsRtEs() throws Exception {
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='2')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isParameter(0, "ParameterString", "'2'")
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    testUri.run("ESKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='3')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isParameter(0, "ParameterString", "'3'")
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .n()
-        .isCount();
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'");
-
-  }
-
-  @Test
-  public void runBfuncBnEsRtEsBa() throws Exception {
-
-    testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComp"
-        + "/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()/olingo.odata.test1.BAESAllPrimRTETAllPrim")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isComplex("CollPropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp)
-        .n()
-        .isFunction("BFCCollCTPrimCompRTESAllPrim")
-        .n()
-        .isAction("BAESAllPrimRTETAllPrim");
-
-  }
-
-  @Test
-  public void runBfuncBnEsRtPrim() throws Exception {
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTString");
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTString")
-        .isType(PropertyProvider.nameString)
-        .n()
-        .isValue();
-  }
-
-  @Test
-  public void runbfuncBnEsRtPrimColl() throws Exception {
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTCollString")
-        .isType(PropertyProvider.nameString, true);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isFunction("BFCESTwoKeyNavRTCollString")
-        .isType(PropertyProvider.nameString, true)
-        .n()
-        .isCount();
-  }
-
-  @Test
-  public void runBfuncBnPpropCollRtEs() throws Exception {
-    testUri.run("ESKeyNav(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
-        .n()
-        .isFunction("BFCCollStringRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true);
-
-    testUri.run("ESKeyNav(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
-        .n()
-        .isFunction("BFCCollStringRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .n()
-        .isCount();
-  }
-
-  @Test
-  public void runBfuncBnPpropRtEs() throws Exception {
-
-    testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
-        .n()
-        .isFunction("BFCStringRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true);
-
-    testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
-        .n()
-        .isFunction("BFCStringRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .n()
-        .isCount();
-
-    testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
-        .n()
-        .isFunction("BFCStringRTESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .n()
-        .isRef();
-  }
-
-  @Test
-  public void runBfuncBnSingleRtEs() throws Exception {
-
-    testUri.run("SINav/olingo.odata.test1.BFCSINavRTESTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isSingleton("SINav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isFunction("BFCSINavRTESTwoKeyNav");
-  }
-
-  @Test
-  public void runBfuncBnSingleCastRtEs() throws Exception {
-    testUri.run("SINav/olingo.odata.test1.ETBaseTwoKeyNav/olingo.odata.test1.BFCETBaseTwoKeyNavRTESBaseTwoKey()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isSingleton("SINav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isFunction("BFCETBaseTwoKeyNavRTESBaseTwoKey");
-  }
-
-  @Test
-  public void runActionBound_on_EntityEntry() throws Exception {
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isAction("BAETTwoKeyNavRTETTwoKeyNav");
-
-    testUri.run("ESKeyNav(PropertyInt16=1)/olingo.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isAction("BAETTwoKeyNavRTETTwoKeyNav");
-  }
-
-  @Test
-  public void runActionBound_on_EntityCollection() throws Exception {
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .n()
-        .isAction("BAESTwoKeyNavRTESTwoKeyNav");
-  }
-
-  @Test
-  public void runFunctionBound_on_var_Types() throws Exception {
-
-    // on primitive
-    testUri.run("ESAllPrim(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()")
-        .goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETAllPrim, false)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.primitiveProperty)
-        .isType(PropertyProvider.nameString);
-
-    // on collection of primitive
-    testUri.run("ESCollAllPrim(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()")
-        .goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETCollAllPrim, false)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.primitiveProperty)
-        .isType(PropertyProvider.nameString);
-
-    // on complex
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
-        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
-        .goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.complexProperty)
-        .at(2)
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    // on collection of complex
-    testUri.run("ESKeyNav(1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
-        .goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .at(1)
-        .isType(ComplexTypeProvider.nameCTPrimComp, true)
-        .at(2)
-        .isUriPathInfoKind(UriResourceKind.function)
-        .isType(EntityTypeProvider.nameETAllPrim);
-
-    // on entity
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
-        + "/olingo.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
-        .goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .at(1)
-        .isUriPathInfoKind(UriResourceKind.function)
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-
-    // on collection of entity
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
-        .goPath()
-        .at(0)
-        .isUriPathInfoKind(UriResourceKind.entitySet)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-        .at(1).isUriPathInfoKind(UriResourceKind.function)
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
-  }
-
-  @Test
-  public void runActionBound_on_EntityCast() throws Exception {
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/olingo.odata.test1.BAETBaseTwoKeyNavRTETBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isAction("BAETBaseTwoKeyNavRTETBaseTwoKeyNav");
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
-        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav/olingo.odata.test1.BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
-        .n()
-        .isAction("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav");
-  }
-
-  @Test
-  public void crossjoin() throws Exception {
-    testUri.run("$crossjoin(ESKeyNav)")
-        .isKind(UriInfoKind.crossjoin)
-        .isCrossJoinEntityList(Arrays.asList("ESKeyNav"));
-
-    testUri.run("$crossjoin(ESKeyNav,ESTwoKeyNav)")
-        .isKind(UriInfoKind.crossjoin)
-        .isCrossJoinEntityList(Arrays.asList("ESKeyNav", "ESTwoKeyNav"));
-  }
-
-  @Test
-  public void crossjoinFilter() throws Exception {
-    testUri.run("$crossjoin(ESTwoPrim,ESMixPrimCollComp)",
-        "$filter=ESTwoPrim/PropertyString eq ESMixPrimCollComp/PropertyComp/PropertyString")
-        .goFilter()
-        .isBinary(BinaryOperatorKind.EQ)
-        .is("<<ESTwoPrim/PropertyString> eq <ESMixPrimCollComp/PropertyComp/PropertyString>>");
-  }
-
-  @Test
-  public void crossjoinError() throws Exception {
-    testUri.runEx("$crossjoin").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    testUri.runEx("$crossjoin/error").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
-    testUri.runEx("$crossjoin()").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    testUri.runEx("$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
-    testUri.runEx("$crossjoin(ESKeyNav)/$ref")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
-  }
-
-  @Test
-  public void runEntityId() throws Exception {
-    testUri.run("$entity", "$id=ESKeyNav(1)")
-        .isKind(UriInfoKind.entityId)
-        .isIdText("ESKeyNav(1)");
-    testUri.run("$entity/olingo.odata.test1.ETKeyNav", "$id=ESKeyNav(1)")
-        .isKind(UriInfoKind.entityId)
-        .isEntityType(EntityTypeProvider.nameETKeyNav)
-        .isIdText("ESKeyNav(1)");
-  }
-
-  @Test
-  public void runEsName() throws Exception {
-    testUri.run("ESAllPrim")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllPrim")
-        .isType(EntityTypeProvider.nameETAllPrim, true);
-
-    testUri.run("ESAllPrim/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllPrim")
-        .isType(EntityTypeProvider.nameETAllPrim, true)
-        .n()
-        .isCount();
-  }
-
-  @Test
-  public void esNameError() {
-
-    testUri.runEx("ESAllPrim/$count/$ref").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
-    testUri.runEx("ESAllPrim/$ref/$count").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
-    testUri.runEx("ESAllPrim/$ref/invalid").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
-    testUri.runEx("ESAllPrim/$count/invalid").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
-    testUri.runEx("ESAllPrim/PropertyString").isExSemantic(MessageKeys.PROPERTY_AFTER_COLLECTION);
-    testUri.runEx("ESAllPrim(1)/whatever").isExSemantic(MessageKeys.PROPERTY_NOT_IN_TYPE);
-    testUri.runEx("ESAllPrim('1')").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
-    testUri.runEx("ESAllPrim(PropertyInt16)").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    testUri.runEx("ESAllPrim(PropertyInt16=)").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    testUri.runEx("ESAllPrim(PropertyInt16=1,Invalid='1')").isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
-
-    testUri.runEx("ESBase/olingo.odata.test1.ETBase/PropertyInt16")
-        .isExSemantic(MessageKeys.PROPERTY_AFTER_COLLECTION);
-
-    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETBaseTwoKeyTwoPrim"
-        + "/olingo.odata.test1.ETTwoBaseTwoKeyTwoPrim")
-        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-
-    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETBaseTwoKeyTwoPrim(1)/olingo.odata.test1.ETAllKey")
-        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-
-    testUri.runEx("ETBaseTwoKeyTwoPrim(1)/olingo.odata.test1.ETBaseTwoKeyTwoPrim('1')/olingo.odata.test1.ETAllKey")
-        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-
-    testUri.runEx("ETBaseTwoKeyTwoPrim(1)/olingo.odata.test1.ETBaseTwoKeyTwoPrim"
-        + "/olingo.odata.test1.ETTwoBaseTwoKeyTwoPrim")
-        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-
-    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETBaseTwoKeyTwoPrim"
-        + "/olingo.odata.test1.ETTwoBaseTwoKeyTwoPrim(1)")
-        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-
-    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETAllKey").isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-    testUri.runEx("ETBaseTwoKeyTwoPrim()").isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-    testUri.runEx("ESAllNullable(1)/CollPropertyString/$value").isExSemantic(MessageKeys.ONLY_FOR_TYPED_PARTS);
-
-    testUri.runEx("ETMixPrimCollComp(1)/ComplexProperty/$value").isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
-  }
-
-  @Test
-  public void resourcePathWithApostrophe() throws Exception {
-    testUri.runEx("ESAllPrim'").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    testUri.runEx("ESAllPrim'InvalidStuff").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    testFilter.runOnETKeyNavEx("PropertyInt16' eq 0").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
-    testFilter.runOnETKeyNavEx("PropertyInt16 eq' 0").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
-    testFilter.runOnETKeyNavEx("PropertyInt16 eq 0'")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
-    testFilter.runOnETKeyNavEx("PropertyInt16 eq 'dsd''")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-  }
-
-  @Test
-  public void runFunctionsWithKeyPredicates() throws Exception {
-    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
-        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .isParameter(1, "ParameterInt16", "1");
-
-    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16=0)")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
-        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .isParameter(1, "ParameterInt16", "1")
-        .isKeyPredicate(0, "PropertyInt16", "0");
-
-    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(0)")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
-        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .isParameter(1, "ParameterInt16", "1")
-        .isKeyPredicate(0, "PropertyInt16", "0");
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16 eq 0)")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-
-    // PropertyInt32 does not exist
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=0)")
-        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)"
-        + "(PropertyInt16=0,PropertyInt16=1)")
-        .isExValidation(UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY);
-
-    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
-        .isFunction("UFCRTCollCTTwoPrimTwoParam")
-        .isParameter(0, "ParameterString", "'1'")
-        .isParameter(1, "ParameterInt16", "1");
-
-    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16=1)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(1)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=1)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=1,PropertyInt16=2)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollESTwoKeyNavParam")
-        .isFunction("UFCRTCollETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1");
-
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='1')")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollESTwoKeyNavParam")
-        .isFunction("UFCRTCollETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'1'");
-
-    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16 eq 1)")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-
-    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1)")
-        .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
-
-    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyInt32=1,PropertyString='1')")
-        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-
-    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)()")
-        .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
-
-    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyInt32=1)")
-        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-
-    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,Unkown=1)")
-        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-
-    testUri.run("FICRTCollString()")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollString")
-        .isFunction("UFCRTCollString");
-
-    testUri.run("FICRTString()")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTString")
-        .isFunction("UFCRTString");
-
-    testUri.runEx("FICRTCollString()(0)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
-    testUri.runEx("FICRTString()(0)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-  }
-
-  @Test
-  public void runNonComposableFunctions() throws Exception {
-    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
-        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isParameter(1, "ParameterString", "'1'");
-
-    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')(0)")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
-        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isParameter(1, "ParameterString", "'1'");
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')(0)/PropertyInt16")
-        .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skip=1")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$top=1")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')",
-        "$filter=PropertyInt16 eq 1")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skip=1")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$count=true")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skiptoken=5")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
-    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$search=test")
-        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
-    testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()")
-        .isKind(UriInfoKind.resource)
-        .goPath().first()
-        .isEntitySet("ESAllPrim")
-        .at(1)
-        .isFunction("BFNESAllPrimRTCTAllPrim");
-
-    testUri.runEx("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()"
-        + "/PropertyString")
-        .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
-  }
-
-  @Test
-  public void runEsNameCast() throws Exception {
-    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim, true)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
-
-    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(-32768)/olingo.odata.test1.ETTwoBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim, false)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
-        .isKeyPredicate(0, "PropertyInt16", "-32768")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
-
-    testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase(-32768)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim, false)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
-        .isKeyPredicate(0, "PropertyInt16", "-32768");
-
-    testUri.run("ESTwoPrim/Namespace1_Alias.ETTwoBase(-32768)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim, false)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
-        .isKeyPredicate(0, "PropertyInt16", "-32768");
-
-  }
-
-  @Test
-  public void runEsNamePpSpCast() throws Exception {
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/PropertyComp/PropertyInt16")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isComplex("PropertyComp")
-        .n()
-        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-  }
-
-  @Test
-  public void runEsNameKey() throws Exception {
-    testUri.run("ESCollAllPrim(1)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESCollAllPrim");
-
-    testUri.run("ESCollAllPrim(PropertyInt16=1)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESCollAllPrim");
-
-    testUri.run("ESFourKeyAlias(PropertyInt16=1,KeyAlias1=2,KeyAlias2='3',KeyAlias3='4')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESFourKeyAlias")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "KeyAlias1", "2")
-        .isKeyPredicate(2, "KeyAlias2", "'3'")
-        .isKeyPredicate(3, "KeyAlias3", "'4'");
-
-    testUri.runEx("ESTwoPrim('wrong')").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
-    testUri.runEx("ESTwoPrim(PropertyInt16='wrong')").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
-  }
-
-  @Test
-  public void runEsNameParaKeys() throws Exception {
-    testUri.run("ESAllKey(PropertyString='O''Neil',PropertyBoolean=true,PropertyByte=255,"
-        + "PropertySByte=-128,PropertyInt16=-32768,PropertyInt32=-2147483648,"
-        + "PropertyInt64=-9223372036854775808,PropertyDecimal=1,PropertyDate=2013-09-25,"
-        + "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00,"
-        + "PropertyDuration=duration'P50903316DT2H25M4S',"
-        + "PropertyGuid=12345678-1234-1234-1234-123456789012,"
-        + "PropertyTimeOfDay=12:34:55)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllKey")
-        .isKeyPredicate(0, "PropertyString", "'O''Neil'")
-        .isKeyPredicate(1, "PropertyBoolean", "true")
-        .isKeyPredicate(2, "PropertyByte", "255")
-        .isKeyPredicate(3, "PropertySByte", "-128")
-        .isKeyPredicate(4, "PropertyInt16", "-32768")
-        .isKeyPredicate(5, "PropertyInt32", "-2147483648")
-        .isKeyPredicate(6, "PropertyInt64", "-9223372036854775808")
-        .isKeyPredicate(7, "PropertyDecimal", "1")
-        .isKeyPredicate(8, "PropertyDate", "2013-09-25")
-        .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
-        .isKeyPredicate(10, "PropertyDuration", "duration'P50903316DT2H25M4S'")
-        .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
-        .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55");
-  }
-
-  @Test
-  public void runEsNameKeyCast() throws Exception {
-    testUri.run("ESTwoPrim(1)/olingo.odata.test1.ETBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBase);
-
-    testUri.run("ESTwoPrim(1)/olingo.odata.test1.ETTwoBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
-
-    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(1)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
-
-    testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase(1)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
-
-    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
-
-    testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoPrim")
-        .isType(EntityTypeProvider.nameETTwoPrim)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
-
-    // Keys cannot be specified twice.
-    testUri.runEx("ESTwoPrim(1)/olingo.odata.test1.ETBase(1)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-    testUri.runEx("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase(1)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
-    testUri.runEx("ESBase/olingo.odata.test1.ETTwoPrim(1)").isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
-  }
-
-  @Test
-  public void runEsNameParaKeysCast() throws Exception {
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
-    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'");
-  }
-
-  @Test
-  public void run_EsNamePpCp() throws Exception {
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isComplex("PropertyComp");
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComp/PropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isComplex("PropertyComp")
-        .n()
-        .isComplex("PropertyComp");
-
-    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
-        + "PropertyDefString='key1')/PropertyEnumString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESMixEnumDefCollComp")
-        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
-        .isKeyPredicate(1, "PropertyDefString", "'key1'")
-        .n()
-        .isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false);
-
-    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
-        + "PropertyDefString='key1')/PropertyDefString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESMixEnumDefCollComp")
-        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
-        .isKeyPredicate(1, "PropertyDefString", "'key1'")
-        .n()
-        .isPrimitiveProperty("PropertyDefString", TypeDefinitionProvider.nameTDString, false);
-  }
-
-  @Test
-  public void runEsNamePpCpColl() throws Exception {
-    testUri.run("ESMixPrimCollComp(5)/CollPropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESMixPrimCollComp")
-        .isKeyPredicate(0, "PropertyInt16", "5")
-        .n()
-        .isComplex("CollPropertyComp")
-        .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isComplex("CollPropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, true);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComp/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isComplex("CollPropertyComp")
-        .isType(ComplexTypeProvider.nameCTPrimComp, true)
-        .n()
-        .isCount();
-
-    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
-        + "PropertyDefString='key1')/CollPropertyEnumString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESMixEnumDefCollComp")
-        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
-        .isKeyPredicate(1, "PropertyDefString", "'key1'")
-        .n()
-        .isPrimitiveProperty("CollPropertyEnumString", EnumTypeProvider.nameENString, true);
-
-    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
-        + "PropertyDefString='key1')/CollPropertyDefString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESMixEnumDefCollComp")
-        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
-        .isKeyPredicate(1, "PropertyDefString", "'key1'")
-        .n()
-        .isPrimitiveProperty("CollPropertyDefString", TypeDefinitionProvider.nameTDString, true);
-  }
-
-  @Test
-  public void runEsNamePpCpCast() throws Exception {
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav/PropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isComplex("PropertyComp");
-
-    testUri
-        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-            + "/PropertyComp/PropertyComp")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isComplex("PropertyComp")
-        .n()
-        .isComplex("PropertyComp");
-
-    testUri
-        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-            + "/PropertyCompTwoPrim/olingo.odata.test1.CTBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isComplex("PropertyCompTwoPrim")
-        .isType(ComplexTypeProvider.nameCTTwoPrim)
-        .isTypeFilter(ComplexTypeProvider.nameCTBase);
-
-    testUri
-        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-            + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isComplex("PropertyCompTwoPrim")
-        .isType(ComplexTypeProvider.nameCTTwoPrim)
-        .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
-  }
-
-  @Test
-  public void runNsNamePpNp() throws Exception {
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2");
-
-    testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETKeyNavMany(PropertyInt16=2)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2");
-
-    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyInt16")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .n()
-        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyCompNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .n()
-        .isComplex("PropertyCompNav");
-
-    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/NavPropertyETKeyNavOne")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
-        + "/NavPropertyETKeyNavMany(4)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "4");
-
-    testUri.run("ESKeyNav(1)/PropertyCompNav/NavPropertyETTwoKeyNavOne")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isComplex("PropertyCompNav")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='(3)')"
-        + "/PropertyComp/PropertyComp/PropertyInt16")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'(3)'")
-        .n()
-        .isComplex("PropertyComp")
-        .n()
-        .isComplex("PropertyComp")
-        .n()
-        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETMediaMany(2)/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETMediaMany", EntityTypeProvider.nameETMedia, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .n()
-        .isValue();
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
-        + "/NavPropertyETKeyNavOne/NavPropertyETMediaOne/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
-        .n()
-        .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
-        .n()
-        .isValue();
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
-        + "/NavPropertyETKeyNavOne/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
-        .n()
-        .isRef();
-  }
-
-  @Test
-  public void runEsNamePpNpCast() throws Exception {
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/NavPropertyETKeyNavMany")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/NavPropertyETKeyNavMany(3)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "3");
-
-    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETTwoBaseTwoKeyNav(PropertyInt16=3,PropertyString='4')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESTwoKeyNav")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "3")
-        .isKeyPredicate(1, "PropertyString", "'4'")
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
-        + "/NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')"
-        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav/NavPropertyETBaseTwoKeyNavMany")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "4")
-        .isKeyPredicate(1, "PropertyString", "'5'")
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
-        .n()
-        .isNavProperty("NavPropertyETBaseTwoKeyNavMany", EntityTypeProvider.nameETBaseTwoKeyNav, true);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/"
-        + "NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')/"
-        + "NavPropertyETKeyNavMany")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "4")
-        .isKeyPredicate(1, "PropertyString", "'5'")
-        .n()
-        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
-  }
-
-  @Test
-  public void runEsNamePpNpRc() throws Exception {
-    // checks for using referential constraints to fill missing keys
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany('2')").goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
-        .isKeyPredicate(1, "PropertyString", "'2'");
-
-    testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETTwoKeyNavMany(PropertyString='2')").goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
-        .isKeyPredicate(1, "PropertyString", "'2'");
-
-  }
-
-  @Test
-  public void runEsNamePpSp() throws Exception {
-    testUri.run("ESAllPrim(1)/PropertyByte")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllPrim")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false);
-
-    testUri.run("ESAllPrim(1)/PropertyByte/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllPrim")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false)
-        .n()
-        .isValue();
-
-    testUri.run("ESMixPrimCollComp(1)/PropertyComp/PropertyString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESMixPrimCollComp")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isComplex("PropertyComp")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-  }
-
-  @Test
-  public void runEsNamePpSpColl() throws Exception {
-    testUri.run("ESCollAllPrim(1)/CollPropertyString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESCollAllPrim")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
-
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
-        .n()
-        .isCount();
-
-  }
-
-  @Test
-  public void runEsNameRef() throws Exception {
-    testUri.run("ESAllPrim/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllPrim")
-        .n()
-        .isRef();
-
-    testUri.run("ESAllPrim(-32768)/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESAllPrim")
-        .isKeyPredicate(0, "PropertyInt16", "-32768")
-        .n()
-        .isRef();
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
-        .n()
-        .isRef();
-    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isEntitySet("ESKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .n()
-        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isRef();
-  }
-
-  @Test
-  public void runFunctionImpBf() throws Exception {
-
-    testUri.run("FICRTString()/olingo.odata.test1.BFCStringRTESTwoKeyNav()");
-  }
-
-  @Test
-  public void runFunctionImpCastBf() throws Exception {
-
-    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav"
-        + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTETTwoKeyNavParam")
-        .isFunction("UFCRTETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .n()
-        .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
-
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
-        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
-        + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTCollESTwoKeyNavParam")
-        .isFunction("UFCRTCollETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
-
-    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString=null)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
-        .isFunction("UFCRTCollCTTwoPrimTwoParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isParameter(1, "ParameterString", null);
-  }
-
-  @Test
-  public void runFunctionImpEntity() throws Exception {
-
-    testUri.run("FICRTETKeyNav()")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTETKeyNav")
-        .isFunction("UFCRTETKeyNav")
-        .isType(EntityTypeProvider.nameETKeyNav);
-
-    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1");
-
-    testUri.run("FICRTESMedia(ParameterInt16=1)/$value")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTESMedia")
-        .isFunction("UFCRTETMedia")
-        .n()
-        .isValue();
-
-    testUri.run("FICRTETKeyNav()/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTETKeyNav")
-        .isFunction("UFCRTETKeyNav")
-        .n()
-        .isRef();
-    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/$ref")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTETTwoKeyNavParam")
-        .isFunction("UFCRTETTwoKeyNavParam")
-        .n()
-        .isRef();
-
-    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTETTwoKeyNavParam")
-        .isFunction("UFCRTETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
-    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTETTwoKeyNavParam")
-        .isFunction("UFCRTETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
-        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTCollESTwoKeyNavParam")
-        .isFunction("UFCRTCollETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .isKeyPredicate(0, "PropertyInt16", "2")
-        .isKeyPredicate(1, "PropertyString", "'3'");
-  }
-
-  @Test
-  public void runFunctionImpEs() throws Exception {
-    testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
-        .isFunction("UFCRTESMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isParameter(1, "ParameterString", "'2'")
-        .isType(EntityTypeProvider.nameETMixPrimCollComp);
-
-    testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
-        .isFunction("UFCRTESMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isParameter(1, "ParameterString", "'2'")
-        .isType(EntityTypeProvider.nameETMixPrimCollComp);
-
-    testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
-        .isFunction("UFCRTESMixPrimCollCompTwoParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isParameter(1, "ParameterString", "'2'")
-        .isType(EntityTypeProvider.nameETMixPrimCollComp)
-        .n()
-        .isCount();
-  }
-
-  @Test
-  public void runFunctionImpError() {
-    testUri.runEx("FICRTCollCTTwoPrimTwoParam")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    testUri.runEx("FICRTCollCTTwoPrimTwoParam()").isExSemantic(MessageKeys.FUNCTION_NOT_FOUND);
-    testUri.runEx("FICRTCollCTTwoPrimTwoParam(invalidParam=2)").isExSemantic(MessageKeys.FUNCTION_NOT_FOUND);
-  }
-
-  @Test
-  public void runFunctionImpEsAlias() throws Exception {
-
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=@parameterAlias)", "@parameterAlias=1");
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=@parameterAlias)/$count", "@parameterAlias=1");
-    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=@invalidAlias)", "@validAlias=1")
-        .isExValidation(UriValidationException.MessageKeys.MISSING_PARAMETER);
-  }
-
-  @Test
-  public void runFunctionImpEsCast() throws Exception {
-
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
-        .isKind(UriInfoKind.resource).goPath()
-        .first()
-        .isFunctionImport("FICRTCollESTwoKeyNavParam")
-        .isFunction("UFCRTCollETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "1")
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav);
-
-    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav/$count")


<TRUNCATED>

[17/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] ExpressionParser improvements

Posted by mi...@apache.org.
[OLINGO-834] ExpressionParser improvements


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 8919d3ef1198f19b3a2fbc1c8a05e8d39013fcd5
Parents: a809165
Author: Christian Holzer <c....@sap.com>
Authored: Tue Dec 22 17:07:51 2015 +0100
Committer: Christian Holzer <c....@sap.com>
Committed: Tue Dec 22 17:07:51 2015 +0100

----------------------------------------------------------------------
 .../tecsvc/client/FilterSystemQueryITCase.java  |  37 ++-
 .../tecsvc/client/OrderBySystemQueryITCase.java |   3 +
 .../core/uri/parser/ExpressionParser.java       | 309 +++++++++++++------
 .../server/core/uri/parser/FilterParser.java    |   4 +-
 .../olingo/server/core/uri/parser/Parser.java   |   6 +-
 .../uri/parser/UriParserSemanticException.java  |   4 +-
 .../server/core/uri/parser/UriTokenizer.java    |  23 +-
 .../server-core-exceptions-i18n.properties      |   1 +
 .../core/uri/antlr/TestFullResourcePath.java    |  58 ++--
 9 files changed, 291 insertions(+), 154 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
index 4ecca7c..ca6eb21 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/FilterSystemQueryITCase.java
@@ -35,8 +35,11 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 
+// TODO
+@Ignore
 public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   private static final String ES_COMP_ALL_PRIM = "ESCompAllPrim";
@@ -223,18 +226,18 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   public void methodCallsWithNull() {
     // One representative of "stringFuntion" "residue class"
     ODataRetrieveResponse<ClientEntitySet> result =
-        sendRequest(ES_ALL_PRIM, "endswith(PropertyString, null) eq null"); // null eq null => true
+        sendRequest(ES_ALL_PRIM, "endswith(PropertyString,null) eq null"); // null eq null => true
     assertEquals(3, result.getBody().getEntities().size());
 
     // One representative of "stringifiedValueFunction" "residue class"
-    result = sendRequest(ES_ALL_PRIM, "substring(PropertyString, null) eq null"); // null eq null => true
+    result = sendRequest(ES_ALL_PRIM, "substring(PropertyString,null) eq null"); // null eq null => true
     assertEquals(3, result.getBody().getEntities().size());
 
     // Substring
     result = sendRequest(ES_ALL_PRIM, "hour(null) eq null"); // null eq null => true
     assertEquals(3, result.getBody().getEntities().size());
 
-    result = sendRequest(ES_ALL_PRIM, "substring(PropertyString, 0, null) eq null"); // null eq null => true
+    result = sendRequest(ES_ALL_PRIM, "substring(PropertyString,0,null) eq null"); // null eq null => true
     assertEquals(3, result.getBody().getEntities().size());
   }
 
@@ -244,13 +247,13 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
     // -1 should be treated as 0
     ODataRetrieveResponse<ClientEntitySet> response =
-        sendRequest(ES_ALL_PRIM, "substring(PropertyString, -1, 1) eq 'F'");
+        sendRequest(ES_ALL_PRIM, "substring(PropertyString,-1,1) eq 'F'");
     assertEquals(1, response.getBody().getEntities().size());
     assertShortOrInt(32767, response.getBody().getEntities().get(0).getProperty("PropertyInt16")
           .getPrimitiveValue().toValue());
 
     // -1 should be treated as 0, Same values substring(PropertyString, 0, 0) returns the empty String
-    response = sendRequest(ES_ALL_PRIM, "substring(PropertyString, 0, -1) eq ''");
+    response = sendRequest(ES_ALL_PRIM, "substring(PropertyString,0,-1) eq ''");
     assertEquals(3, response.getBody().getEntities().size());
   }
 
@@ -354,7 +357,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   @Test
   public void notOperator() {
-    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "not (PropertyInt16 eq 1)");
+    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "not(PropertyInt16 eq 1)");
     assertEquals(2, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -368,7 +371,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   @Test
   public void unaryMinusOperator() {
-    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "PropertyInt16 gt -2 add - -3");
+    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "PropertyInt16 gt -2 add --3");
     assertEquals(2, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -382,7 +385,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   @Test
   public void unaryMinusOperatorDecimal() {
-    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "PropertyInt16 gt -2.0 add - -3.0");
+    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_TWO_KEY_NAV, "PropertyInt16 gt -2.0 add --3.0");
     assertEquals(2, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -415,7 +418,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void substringStartAndEndGiven() {
     ODataRetrieveResponse<ClientEntitySet> result =
-        sendRequest(ES_ALL_PRIM, "substring(PropertyString, length('First') add 1, 8) eq ('Resource')");
+        sendRequest(ES_ALL_PRIM, "substring(PropertyString,length('First') add 1,8) eq ('Resource')");
 
     assertEquals(1, result.getBody().getEntities().size());
 
@@ -426,7 +429,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void substringStartGiven() {
     ODataRetrieveResponse<ClientEntitySet> result =
-        sendRequest(ES_TWO_KEY_NAV, "substring(PropertyComp/PropertyComp/PropertyString, 6) eq 'Value'");
+        sendRequest(ES_TWO_KEY_NAV, "substring(PropertyComp/PropertyComp/PropertyString,6) eq 'Value'");
 
     assertEquals(4, result.getBody().getEntities().size());
 
@@ -450,7 +453,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void substringDouble() {
     fail(ES_ALL_PRIM,
-        "substring(PropertyString, length('First') add 1, 2.0 * 4) eq ('Resource')",
+        "substring(PropertyString,length('First') add 1,2.0 * 4) eq ('Resource')",
         HttpStatusCode.BAD_REQUEST);
   }
 
@@ -689,7 +692,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   @Test
   public void endsWith() {
-    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_ALL_PRIM, "endswith(PropertyString, 'values')");
+    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_ALL_PRIM, "endswith(PropertyString,'values')");
     assertEquals(2, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -702,7 +705,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void indexOf() {
     ODataRetrieveResponse<ClientEntitySet> result =
-        sendRequest(ES_ALL_PRIM, "indexof(PropertyString, 'positive') eq 17");
+        sendRequest(ES_ALL_PRIM, "indexof(PropertyString,'positive') eq 17");
     assertEquals(1, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -711,7 +714,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
 
   @Test
   public void startsWith() {
-    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_ALL_PRIM, "startswith(PropertyString, 'First')");
+    ODataRetrieveResponse<ClientEntitySet> result = sendRequest(ES_ALL_PRIM, "startswith(PropertyString,'First')");
     assertEquals(1, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -721,7 +724,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void toLower() {
     ODataRetrieveResponse<ClientEntitySet> result =
-        sendRequest(ES_ALL_PRIM, "contains(PropertyString, tolower('POSITIVE'))");
+        sendRequest(ES_ALL_PRIM, "contains(PropertyString,tolower('POSITIVE'))");
     assertEquals(1, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -731,7 +734,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void toUpper() {
     ODataRetrieveResponse<ClientEntitySet> result =
-        sendRequest(ES_ALL_PRIM, "contains(PropertyString, concat(toupper('f'), 'irst'))");
+        sendRequest(ES_ALL_PRIM, "contains(PropertyString,concat(toupper('f'),'irst'))");
     assertEquals(1, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);
@@ -741,7 +744,7 @@ public class FilterSystemQueryITCase extends AbstractParamTecSvcITCase {
   @Test
   public void trim() {
     ODataRetrieveResponse<ClientEntitySet> result =
-        sendRequest(ES_ALL_PRIM, "trim(substring(PropertyString, 0, 6)) eq 'First'");
+        sendRequest(ES_ALL_PRIM, "trim(substring(PropertyString,0,6)) eq 'First'");
     assertEquals(1, result.getBody().getEntities().size());
 
     ClientEntity clientEntity = result.getBody().getEntities().get(0);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
index 18db951..0e31b33 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/OrderBySystemQueryITCase.java
@@ -30,8 +30,11 @@ import org.apache.olingo.client.api.domain.ClientEntitySet;
 import org.apache.olingo.client.api.domain.ClientValuable;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 
+// TODO
+@Ignore
 public class OrderBySystemQueryITCase extends AbstractParamTecSvcITCase {
 
   private static final String ES_TWO_PRIM = "ESTwoPrim";

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
index 2f7fdb2..049880f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
@@ -47,6 +47,9 @@ import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmByte;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmSByte;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.UriParameter;
 import org.apache.olingo.server.api.uri.UriResourceFunction;
@@ -118,14 +121,6 @@ public class ExpressionParser {
     tokenToBinaryOperator = Collections.unmodifiableMap(temp);
   }
 
-  private static final Map<TokenKind, UnaryOperatorKind> tokenToUnaryOperator;
-  static {
-    Map<TokenKind, UnaryOperatorKind> temp = new HashMap<TokenKind, UnaryOperatorKind>();
-    temp.put(TokenKind.MINUS, UnaryOperatorKind.MINUS);
-    temp.put(TokenKind.NotOperator, UnaryOperatorKind.NOT);
-    tokenToUnaryOperator = Collections.unmodifiableMap(temp);
-  }
-
   // 'cast' and 'isof' are handled specially.
   private static final Map<TokenKind, MethodKind> tokenToMethod;
   static {
@@ -246,23 +241,53 @@ public class ExpressionParser {
     return left;
   }
 
-  // TODO: The 'isof' method has relational precedence and should appear here.
   private Expression parseExprRel() throws UriParserException, UriValidationException {
-    Expression left = parseExprAdd();
-    TokenKind operatorTokenKind = ParserHelper.next(tokenizer,
-        TokenKind.GreaterThanOperator, TokenKind.GreaterThanOrEqualsOperator,
-        TokenKind.LessThanOperator, TokenKind.LessThanOrEqualsOperator);
-    // Null for everything other than GT or GE or LT or LE
-    while (operatorTokenKind != null) {
-      final Expression right = parseExprAdd();
-      checkRelationTypes(left, right);
-      left = new BinaryImpl(left, tokenToBinaryOperator.get(operatorTokenKind), right,
-          odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean));
-      operatorTokenKind = ParserHelper.next(tokenizer,
+    if(tokenizer.next(TokenKind.IsofMethod)) {
+      // The isof method is a terminal. So no further operators are allowed
+      return parseIsOfMethod(TokenKind.IsofMethod);
+    } else {
+      Expression left = parseExprAdd();
+      TokenKind operatorTokenKind = ParserHelper.next(tokenizer,
           TokenKind.GreaterThanOperator, TokenKind.GreaterThanOrEqualsOperator,
           TokenKind.LessThanOperator, TokenKind.LessThanOrEqualsOperator);
+      // Null for everything other than GT or GE or LT or LE
+      while (operatorTokenKind != null) {
+        final Expression right = parseExprAdd();
+        checkRelationTypes(left, right);
+        left = new BinaryImpl(left, tokenToBinaryOperator.get(operatorTokenKind), right,
+            odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean));
+        operatorTokenKind = ParserHelper.next(tokenizer,
+            TokenKind.GreaterThanOperator, TokenKind.GreaterThanOrEqualsOperator,
+            TokenKind.LessThanOperator, TokenKind.LessThanOrEqualsOperator);
+      }
+      return left;
+    }
+  }
+
+  private Expression parseIsOfMethod(final TokenKind lastToken) throws UriParserException, UriValidationException {
+    if(lastToken == TokenKind.IsofMethod) {
+      // The TokenKind 'IsOfMethod' consumes also the opening parenthesis 
+
+      // The first parameter could be an expression or a type literal
+      final List<Expression> parameters = new ArrayList<Expression>();
+      parameters.add(parseExpression());
+      if(!(parameters.get(0) instanceof TypeLiteral)) {
+        // The first parameter is not a type literal, so there must be a second parameter
+        ParserHelper.requireNext(tokenizer, TokenKind.COMMA);
+        parameters.add(parseExpression());
+        
+        // The second parameter must be a type literal
+        if(!(parameters.get(1) instanceof TypeLiteral)) {
+          throw new UriParserSemanticException("Type literal extected", 
+              UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER);
+        }
+      }
+      
+      ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+      return new MethodImpl(MethodKind.ISOF, parameters);
+    } else {
+      throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
     }
-    return left;
   }
 
   private Expression parseExprAdd() throws UriParserException, UriValidationException {
@@ -302,44 +327,50 @@ public class ExpressionParser {
     return left;
   }
 
-  // TODO: The 'cast' method has unary precedence and should appear here.
   private Expression parseExprUnary() throws UriParserException, UriValidationException {
-    // Negative numbers start with a minus indistinguishable from an unary minus operator.
-    // So we read numbers (and primitive values starting with numbers) right here.
-    // TODO: Find a better idea how to solve this problem.
-    final TokenKind numberTokenKind = ParserHelper.next(tokenizer,
-        TokenKind.DoubleValue, TokenKind.DecimalValue, TokenKind.GuidValue,
-        TokenKind.DateTimeOffsetValue, TokenKind.DateValue, TokenKind.TimeOfDayValue,
-        TokenKind.IntegerValue);
-    if (numberTokenKind != null) {
-      final EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(numberTokenKind);
-      final EdmPrimitiveType type = primitiveTypeKind == null ?
-          // Null handling
-          null :
-          odata.createPrimitiveTypeInstance(primitiveTypeKind);
-      return new LiteralImpl(tokenizer.getText(), type);
-    }
-    Expression left = null;
-    TokenKind operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.MINUS, TokenKind.NotOperator);
-    // Null for everything other than - or NOT
-    while (operatorTokenKind != null) {
+    final TokenKind operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.MINUS, TokenKind.NotOperator, 
+                                                                     TokenKind.CastMethod);
+    
+    if(operatorTokenKind == TokenKind.MINUS) {
       final Expression expression = parseExprPrimary();
-      if (operatorTokenKind == TokenKind.NotOperator) {
-        checkType(expression, EdmPrimitiveTypeKind.Boolean);
-      } else {
-        checkType(expression,
-            EdmPrimitiveTypeKind.Int16, EdmPrimitiveTypeKind.Int32, EdmPrimitiveTypeKind.Int64,
-            EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte,
-            EdmPrimitiveTypeKind.Decimal, EdmPrimitiveTypeKind.Single, EdmPrimitiveTypeKind.Double,
-            EdmPrimitiveTypeKind.Duration);
-      }
-      left = new UnaryImpl(tokenToUnaryOperator.get(operatorTokenKind), expression, getType(expression));
-      operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.MINUS, TokenKind.NotOperator);
+      checkType(expression,
+          EdmPrimitiveTypeKind.Int16, EdmPrimitiveTypeKind.Int32, EdmPrimitiveTypeKind.Int64,
+          EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte,
+          EdmPrimitiveTypeKind.Decimal, EdmPrimitiveTypeKind.Single, EdmPrimitiveTypeKind.Double,
+          EdmPrimitiveTypeKind.Duration);
+      return new UnaryImpl(UnaryOperatorKind.MINUS, expression, getType(expression));
+    } else if(operatorTokenKind == TokenKind.NotOperator) {
+      final Expression expression = parseExprPrimary();
+      checkType(expression, EdmPrimitiveTypeKind.Boolean);
+      return new UnaryImpl(UnaryOperatorKind.NOT, expression, getType(expression));
+    } else if(operatorTokenKind == TokenKind.CastMethod) {
+      return parseCastMethod(operatorTokenKind);
+    } else {
+      final Expression expression = parseExprPrimary();
+      return expression;
     }
-    if (left == null) {
-      left = parseExprPrimary();
+  }
+
+  private Expression parseCastMethod(final TokenKind lastToken) throws UriParserException, UriValidationException {
+    // The TokenKind 'CastMethod' consumes also the opening parenthesis 
+    if(lastToken == TokenKind.CastMethod) {
+      final List<Expression> parameters = new ArrayList<Expression>();
+      parameters.add(parseExpression());
+      
+      if(!(parameters.get(0) instanceof TypeLiteral)) {
+        ParserHelper.requireNext(tokenizer, TokenKind.COMMA);
+        parameters.add(parseExpression());
+        if(!(parameters.get(1) instanceof TypeLiteral)) {
+          throw new UriParserSemanticException("Type literal extected", 
+              UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER);
+        }
+      }
+      
+      ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+      return new MethodImpl(MethodKind.CAST, parameters);
+    } else {
+      throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
     }
-    return left;
   }
 
   private Expression parseExprPrimary() throws UriParserException, UriValidationException {
@@ -380,25 +411,12 @@ public class ExpressionParser {
 
     final TokenKind nextPrimitive = ParserHelper.nextPrimitiveValue(tokenizer);
     if (nextPrimitive != null) {
-      final String primitiveValueLiteral = tokenizer.getText();
-      if (nextPrimitive == TokenKind.EnumValue) {
-        return createEnumExpression(primitiveValueLiteral);
-      } else {
-        final EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(nextPrimitive);
-        final EdmPrimitiveType type = primitiveTypeKind == null ?
-            // Null handling
-            null :
-            odata.createPrimitiveTypeInstance(primitiveTypeKind);
-        return new LiteralImpl(primitiveValueLiteral, type);
-      }
+      return parsePrimitive(nextPrimitive);
     }
 
-    // The method token text includes the opening parenthesis so that method calls can be recognized unambiguously.
-    // OData identifiers have to be considered after that.
     final TokenKind nextMethod = nextMethod();
     if (nextMethod != null) {
-      MethodKind methodKind = tokenToMethod.get(nextMethod);
-      return new MethodImpl(methodKind, parseMethodParameters(methodKind));
+      return parseMethod(nextMethod);
     }
 
     if (tokenizer.next(TokenKind.QualifiedName)) {
@@ -412,6 +430,57 @@ public class ExpressionParser {
     throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
   }
 
+  private Expression parseMethod(final TokenKind nextMethod) throws UriParserException, UriValidationException {
+    // The method token text includes the opening parenthesis so that method calls can be recognized unambiguously.
+    // OData identifiers have to be considered after that.
+    
+    final MethodKind methodKind = tokenToMethod.get(nextMethod);
+    return new MethodImpl(methodKind, parseMethodParameters(methodKind));
+  }
+
+  private Expression parsePrimitive(TokenKind nextPrimitive) throws UriParserException {
+    final String primitiveValueLiteral = tokenizer.getText();
+    if (nextPrimitive == TokenKind.EnumValue) {
+      return createEnumExpression(primitiveValueLiteral);
+    } else {
+      EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(nextPrimitive);
+      
+      if(primitiveTypeKind == EdmPrimitiveTypeKind.Int64) {
+        primitiveTypeKind = determineIntegerType(primitiveValueLiteral);
+      }
+      
+      final EdmPrimitiveType type = primitiveTypeKind == null ?
+          // Null handling
+          null :
+          odata.createPrimitiveTypeInstance(primitiveTypeKind);
+      return new LiteralImpl(primitiveValueLiteral, type);
+    }
+  }
+
+  private EdmPrimitiveTypeKind determineIntegerType(final String intValueAsString) throws UriParserSyntaxException {
+    EdmPrimitiveTypeKind typeKind = null;
+    try {
+      final long value = Long.parseLong(intValueAsString);
+      if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) {
+        typeKind = EdmPrimitiveTypeKind.SByte;
+      } else if (value >= 0 && value <= 255) {
+        typeKind = EdmPrimitiveTypeKind.Byte;
+      } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {
+        typeKind = EdmPrimitiveTypeKind.Int16;
+      } else if (value >= Integer.MIN_VALUE && value <= Integer.MAX_VALUE) {
+        typeKind = EdmPrimitiveTypeKind.Int32;
+      } else {
+        typeKind = EdmPrimitiveTypeKind.Int64;
+      }
+    } catch (NumberFormatException e) {
+      // This should never happen. Because the tokenizer has figured out that the literal is an integer
+      throw new UriParserSyntaxException(intValueAsString + " is not an integer", 
+          UriParserSyntaxException.MessageKeys.SYNTAX);
+    }
+
+    return typeKind;
+  }
+
   private List<Expression> parseMethodParameters(final MethodKind methodKind)
       throws UriParserException, UriValidationException {
     List<Expression> parameters = new ArrayList<Expression>();
@@ -545,40 +614,60 @@ public class ExpressionParser {
     if (lastTokenKind == TokenKind.ROOT) {
       parseDollarRoot(uriInfo);
     } else if (lastTokenKind == TokenKind.IT) {
-      parseDollarIt(uriInfo);
-    } else if (lastTokenKind == TokenKind.ODataIdentifier) {
-      parseFirstMemberODataIdentifier(uriInfo);
+      parseDollarIt(uriInfo, referringType);
     } else if (lastTokenKind == TokenKind.QualifiedName) {
       // Special handling for leading type casts and type literals
       final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
-      EdmStructuredType structuredType = edm.getEntityType(fullQualifiedName);
-      if (structuredType == null) {
-        structuredType = edm.getComplexType(fullQualifiedName);
+      EdmType filterType = edm.getEntityType(fullQualifiedName);
+      if (filterType == null) {
+        filterType = edm.getComplexType(fullQualifiedName);
       }
-
-      if (structuredType != null) {
+      
+      if(filterType == null) {
+        filterType = getEdmType(fullQualifiedName);
+      }
+      
+      if(filterType == null) {
+        filterType = edm.getEnumType(fullQualifiedName);
+      }
+      
+      if(filterType == null) {
+        filterType = edm.getTypeDefinition(fullQualifiedName);
+      }
+      
+      if (filterType != null) {
         if (tokenizer.next(TokenKind.SLASH)) {
           // Leading type cast
-          checkStructuredTypeFilter(referringType, structuredType);
-          startTypeFilter = structuredType;
+          checkStructuredTypeFilter(referringType, filterType);
+          startTypeFilter = filterType;
 
           final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
-          parseMemberExpression(tokenKind, uriInfo, new UriResourceStartingTypeFilterImpl(structuredType, false),
+          parseMemberExpression(tokenKind, uriInfo, new UriResourceStartingTypeFilterImpl(filterType, false), 
               false);
         } else {
           // Type literal
-          checkStructuredTypeFilter(referringType, structuredType);
-          return new TypeLiteralImpl(structuredType);
+          return new TypeLiteralImpl(filterType);
         }
       } else {
-        // Must be bound or unbound function. // TODO: Is unbound function allowed?
+        // Must be bound or unbound function. 
         parseFunction(fullQualifiedName, uriInfo, referringType, true);
       }
+    } else if (lastTokenKind == TokenKind.ODataIdentifier) {
+      parseFirstMemberODataIdentifier(uriInfo);
     }
-
+    
     return new MemberImpl(uriInfo, startTypeFilter);
   }
 
+  private EdmType getEdmType(final FullQualifiedName fullQualifiedName) {
+    if(!fullQualifiedName.getNamespace().equals(EdmPrimitiveType.EDM_NAMESPACE)) {
+      return null;
+    }
+    
+    final EdmPrimitiveTypeKind primitiveTypeKind = EdmPrimitiveTypeKind.valueOfFQN(fullQualifiedName);
+    return primitiveTypeKind == null ? null : EdmPrimitiveTypeFactory.getInstance(primitiveTypeKind);
+  }
+
   private void parseDollarRoot(UriInfoImpl uriInfo) throws UriParserException, UriValidationException {
     UriResourceRootImpl rootResource = new UriResourceRootImpl(referringType, true);
     uriInfo.addResourcePart(rootResource);
@@ -605,9 +694,9 @@ public class ExpressionParser {
     parseSingleNavigationExpr(uriInfo, resource);
   }
 
-  private void parseDollarIt(UriInfoImpl uriInfo) throws UriParserException, UriValidationException {
-    UriResourceItImpl itResource = new UriResourceItImpl(referringType,
-        referringType instanceof EdmEntityType); // TODO: Determine isCollection.
+  private void parseDollarIt(UriInfoImpl uriInfo, EdmType referringType) 
+      throws UriParserException, UriValidationException {
+    UriResourceItImpl itResource = new UriResourceItImpl(referringType, false);
     uriInfo.addResourcePart(itResource);
     if (tokenizer.next(TokenKind.SLASH)) {
       final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
@@ -670,6 +759,19 @@ public class ExpressionParser {
       if (edmEntityType != null) {
         if (allowTypeFilter) {
           setTypeFilter(lastResource, edmEntityType);
+          
+          if(tokenizer.next(TokenKind.SLASH)) {
+            final TokenKind nextTokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, 
+                                                                         TokenKind.ODataIdentifier);
+            if(nextTokenKind == TokenKind.ODataIdentifier) {
+              parsePropertyPathExpr(uriInfo, lastResource);
+            } else if(nextTokenKind == TokenKind.QualifiedName) {
+              parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
+            } else {
+              throw new UriParserSyntaxException("Extected OData Identifier or Full Qualified Name", 
+                  UriParserSyntaxException.MessageKeys.SYNTAX);
+            }
+          }
         } else {
           throw new UriParserSemanticException("Type filters are not chainable.",
               UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
@@ -686,7 +788,7 @@ public class ExpressionParser {
     }
   }
 
-  private void setTypeFilter(UriResourcePartTyped lastResource, final EdmEntityType entityTypeFilter)
+  private void setTypeFilter(UriResourcePartTyped lastResource, final EdmStructuredType entityTypeFilter)
       throws UriParserException {
     checkStructuredTypeFilter(lastResource.getType(), entityTypeFilter);
     if (lastResource instanceof UriResourceTypedImpl) {
@@ -798,10 +900,10 @@ public class ExpressionParser {
     if (tokenizer.next(TokenKind.SLASH)) {
       if (tokenizer.next(TokenKind.QualifiedName)) {
         final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
-        final EdmEntityType edmEntityType = edm.getEntityType(fullQualifiedName);
+        final EdmComplexType edmComplexType = edm.getComplexType(fullQualifiedName);
 
-        if (edmEntityType != null) {
-          setTypeFilter(lastResource, edmEntityType);
+        if (edmComplexType != null) {
+          setTypeFilter(lastResource, edmComplexType);
           if (tokenizer.next(TokenKind.SLASH)) {
             parseComplexPathRestExpr(uriInfo, lastResource);
           }
@@ -893,9 +995,9 @@ public class ExpressionParser {
     if (function.isComposable()) {
       if (edmType instanceof EdmEntityType ) {
         if (isCollection) {
-          parseCollectionNavigationExpr(uriInfo, null); // TODO: Get navigation property.
+          parseCollectionNavigationExpr(uriInfo, functionResource); 
         } else {
-          parseSingleNavigationExpr(uriInfo, null); // TODO: Get navigation property.
+          parseSingleNavigationExpr(uriInfo, functionResource);
         }
       } else if (edmType instanceof EdmComplexType) {
         if (isCollection) {
@@ -1035,12 +1137,21 @@ public class ExpressionParser {
     if (leftType == null || rightType == null || leftType.equals(rightType)) {
       return;
     }
+    
+    // Numeric promotion for Edm.Byte and Edm.SByte
+    if((leftType instanceof EdmByte || leftType instanceof EdmSByte) 
+        && (rightType instanceof EdmByte || rightType instanceof EdmSByte)) {
+      return;
+    }
+    
     if (leftType.getKind() != EdmTypeKind.PRIMITIVE
         || rightType.getKind() != EdmTypeKind.PRIMITIVE
         || !(((EdmPrimitiveType) leftType).isCompatible((EdmPrimitiveType) rightType)
-        || ((EdmPrimitiveType) rightType).isCompatible((EdmPrimitiveType) leftType))) {
+        || ((EdmPrimitiveType) rightType).isCompatible((EdmPrimitiveType) leftType)))
+        {
       throw new UriParserSemanticException("Incompatible types.",
-          UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, ""); // TODO: better message
+          UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE, leftType.getFullQualifiedName().toString(), 
+                                                                       rightType.getFullQualifiedName().toString());
     }
   }
 
@@ -1053,7 +1164,7 @@ public class ExpressionParser {
     }
     return type;
   }
-
+  
   private boolean isEnumType(final Expression expression) throws UriParserException {
     final EdmType expressionType = getType(expression);
     return expressionType == null
@@ -1132,9 +1243,9 @@ public class ExpressionParser {
         UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, ""); // TODO: better message
   }
 
-  private void checkStructuredTypeFilter(final EdmType type, final EdmStructuredType filterType)
+  private void checkStructuredTypeFilter(final EdmType type, final EdmType filterType)
       throws UriParserException {
-    if (!filterType.compatibleTo(type)) {
+    if (!(filterType instanceof EdmStructuredType && ((EdmStructuredType)filterType).compatibleTo(type))) {
       throw new UriParserSemanticException("Incompatible type filter.",
           UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER,
           filterType.getFullQualifiedName().getFullQualifiedNameAsString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
index a3376e0..e2767a1 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
@@ -21,7 +21,7 @@ package org.apache.olingo.server.core.uri.parser;
 import java.util.Collection;
 
 import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.queryoption.FilterOption;
 import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
@@ -38,7 +38,7 @@ public class FilterParser {
     this.odata = odata;
   }
 
-  public FilterOption parse(UriTokenizer tokenizer, final EdmStructuredType referencedType,
+  public FilterOption parse(UriTokenizer tokenizer, final EdmType referencedType,
       final Collection<String> crossjoinEntitySetNames)
       throws UriParserException, UriValidationException {
     final Expression filterExpression = new ExpressionParser(edm, odata)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
index 118c649..47efda5 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
@@ -191,10 +191,8 @@ public class Parser {
         SystemQueryOption systemOption = null;
         if (optionName.equals(SystemQueryOptionKind.FILTER.toString())) {
           UriTokenizer filterTokenizer = new UriTokenizer(optionValue);
-          systemOption = new FilterParser(edm, odata).parse(filterTokenizer,
-              context.contextTypes.peek() instanceof EdmStructuredType ?
-                  (EdmStructuredType) context.contextTypes.peek() :
-                  null,
+          // The Referring type could also be a primitive type not only a structured type
+          systemOption = new FilterParser(edm, odata).parse(filterTokenizer, context.contextTypes.peek(),
                   context.contextUriInfo.getEntitySetNames());
           checkOptionEOF(filterTokenizer, optionName, optionValue);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
index 9135dd8..cc31e34 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
@@ -83,7 +83,9 @@ public class UriParserSemanticException extends UriParserException {
     /** parameter: complex parameter value */
     COMPLEX_PARAMETER_IN_RESOURCE_PATH, 
     /** parameter: function import name */
-    FUNCTION_IMPORT_NOT_ALLOWED;
+    FUNCTION_IMPORT_NOT_ALLOWED, 
+    /** parameters: left type, right type */
+    TYPES_NOT_COMPATIBLE;
     
     @Override
     public String getKey() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
index 37f1b76..f505a21 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
@@ -219,7 +219,7 @@ public class UriTokenizer {
       found = nextCharacter('+');
       break;
     case MINUS:
-      found = nextCharacter('-');
+      found = nextMinus();
       break;
     case NULL:
       found = nextConstant("null");
@@ -444,6 +444,27 @@ public class UriTokenizer {
     return found;
   }
 
+  private boolean nextMinus() {
+    if(parseString.startsWith("-", index)) {
+      final int lastGoodIndex = index;
+      
+      if(nextDoubleValue()) {
+        index = lastGoodIndex;
+        return false;
+      } else if(nextDecimalValue()) {
+        index = lastGoodIndex;
+        return false;
+      } else if(nextIntegerValue(true)) {
+        index = lastGoodIndex;
+        return false;
+      } else {
+        index++;
+        return true;
+      }
+    }
+    return false;
+  }
+
   /**
    * Moves past the given string constant if found; otherwise leaves the index unchanged.
    * @return whether the constant has been found at the current index

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties b/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
index 3de8814..0b43f70 100644
--- a/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
+++ b/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
@@ -85,6 +85,7 @@ UriParserSemanticException.NOT_IMPLEMENTED=%1$s is not implemented!
 UriParserSemanticException.NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT=Namespace is not allowed for Entity Sets, Singeltons, Action Imports and Function Imports. Found '%1$s'.
 UriParserSemanticException.COMPLEX_PARAMETER_IN_RESOURCE_PATH=Complex parameters must not appear in resource path segments. Found: '%1$s'.
 UriParserSemanticException.FUNCTION_IMPORT_NOT_ALLOWED=Function Imports are not allowed in $filter or $orderby. Found: '%1$s'.
+UriParserSemanticException.TYPES_NOT_COMPATIBLE=Types are not compatible. Left type: '%1$s', right type: '%1$s'.
 
 UriValidationException.UNSUPPORTED_QUERY_OPTION=The query option '%1$s' is not supported.
 UriValidationException.UNSUPPORTED_URI_KIND=The URI kind '%1$s' is not supported.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8919d3ef/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
index ec9cc22..c27c960 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
@@ -33,6 +33,7 @@ import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.core.Encoder;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmString;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.edmx.EdmxReference;
 import org.apache.olingo.server.api.uri.UriInfoKind;
@@ -3231,7 +3232,6 @@ public class TestFullResourcePath {
 
   // TODO
   @Test
-  @Ignore
   public void filter() throws Exception {
 
     testFilter.runOnETTwoKeyNav("PropertyString")
@@ -3334,21 +3334,22 @@ public class TestFullResourcePath {
     //     .isExSemantic(MessageKeys.UNKNOWN_TYPE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/invalid")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
-    testFilter.runOnETTwoKeyNavEx("concat('a','b')/invalid").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETTwoKeyNavEx("concat('a','b')/invalid")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/concat('a','b')")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+        .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyInt16 eq '1'")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+        .isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyComp/PropertyDate eq 1")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+        .isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyComp/PropertyString eq 1")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+        .isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyInt64 eq 1")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOnETTwoKeyNavEx("NavPropertyETKeyNavMany/PropertyInt16 gt 42")
-        .isExSemantic(MessageKeys.PROPERTY_AFTER_COLLECTION);
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
     testFilter.runOnETTwoKeyNavEx("NavPropertyETKeyNavMany/NavPropertyETTwoKeyNavOne eq null")
-        .isExSemantic(MessageKeys.PROPERTY_AFTER_COLLECTION);
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
 
     testFilter.runOnETAllPrim("PropertySByte eq PropertySByte")
         .is("<<PropertySByte> eq <PropertySByte>>")
@@ -3758,12 +3759,13 @@ public class TestFullResourcePath {
         .root().right()
         .isType(PropertyProvider.nameDecimal);
 
+    // Numeric promotion: Double is considered the widest type
     testFilter.runOnETAllPrim("PropertyDecimal sub NaN")
-        .right().isLiteral("NaN").isType(PropertyProvider.nameDecimal);
+        .right().isLiteral("NaN").isType(PropertyProvider.nameDouble);
     testFilter.runOnETAllPrim("PropertyDecimal sub -INF")
-        .right().isLiteral("-INF").isType(PropertyProvider.nameDecimal);
+        .right().isLiteral("-INF").isType(PropertyProvider.nameDouble);
     testFilter.runOnETAllPrim("PropertyDecimal sub INF")
-        .right().isLiteral("INF").isType(PropertyProvider.nameDecimal);
+        .right().isLiteral("INF").isType(PropertyProvider.nameDouble);
   }
 
   // TODO
@@ -4078,9 +4080,7 @@ public class TestFullResourcePath {
         .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
   }
 
-  // TODO: $it on primitive types?
   @Test
-  @Ignore
   public void methods() throws Exception {
     testFilter.runOnETKeyNav("indexof(PropertyString,'47') eq 5")
         .is("<<indexof(<PropertyString>,<'47'>)> eq <5>>")
@@ -4482,7 +4482,7 @@ public class TestFullResourcePath {
         .root().left()
         .goPath()
         .first().isUriPathInfoKind(UriResourceKind.it)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
         .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
     testFilter.runOnCTTwoPrim("$it/PropertyString eq 'SomeString'")
@@ -4529,7 +4529,7 @@ public class TestFullResourcePath {
         .goParameter(0)
         .goPath()
         .first().isUriPathInfoKind(UriResourceKind.it)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
         .n().isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
 
     testFilter.runOnETTwoKeyNav("endswith(PropertyComp/PropertyComp/PropertyString,'dorf')")
@@ -4646,7 +4646,6 @@ public class TestFullResourcePath {
 
   // TODO: Implement cast method.
   @Test
-  @Ignore
   public void castMethod() throws Exception {
     testFilter.runOnETKeyNav("cast(olingo.odata.test1.ETBaseTwoKeyNav)")
         .is("<cast(<olingo.odata.test1.ETBaseTwoKeyNav>)>")
@@ -4795,13 +4794,14 @@ public class TestFullResourcePath {
 
     testFilter.runOnETKeyNavEx("cast(NavPropertyETKeyPrimNavOne,olingo.odata.test1.ETKeyNav)")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
-    testFilter.runOnETKeyNav("any()")
-        .isMember().goPath().first().isUriPathInfoKind(UriResourceKind.lambdaAny);
+    // TODO Is that case makes not really sense, each any / all lambda expr must 
+    // containing at least one lambdaVariableExpr 
+//    testFilter.runOnETKeyNav("any()")
+//        .isMember().goPath().first().isUriPathInfoKind(UriResourceKind.lambdaAny);
   }
 
   // TODO: Check whether lambda expressions really are allowed on complex collections.
   @Test
-  @Ignore
   public void lambdaFunctions() throws Exception {
     testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyString eq 'SomeString')")
         .is("<NavPropertyETTwoKeyNavMany/<ANY;<<d/PropertyString> eq <'SomeString'>>>>")
@@ -4846,9 +4846,9 @@ public class TestFullResourcePath {
         .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
 
     testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyInt16 eq 1 or "
-        + "d/any(e:e/CollPropertyString eq 'SomeString'))")
-        .is("<NavPropertyETTwoKeyNavMany/<ANY;<<<d/PropertyInt16> eq <1>> or "
-            + "<d/<ANY;<<e/CollPropertyString> eq <'SomeString'>>>>>>>")
+        + "d/CollPropertyString/any(e:e eq 'SomeString'))")
+        .is("<NavPropertyETTwoKeyNavMany/<ANY;<<<d/PropertyInt16> eq <1>>" 
+            + " or <d/CollPropertyString/<ANY;<<e> eq <'SomeString'>>>>>>>")
         .root().goPath()
         .first().isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
         .n().isUriPathInfoKind(UriResourceKind.lambdaAny)
@@ -4866,12 +4866,13 @@ public class TestFullResourcePath {
         .goPath()
         .first().isUriPathInfoKind(UriResourceKind.lambdaVariable)
         .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .n().isUriPathInfoKind(UriResourceKind.lambdaAny)
+        .n().isUriPathInfoKind(UriResourceKind.primitiveProperty)
+        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+        .at(2).isUriPathInfoKind(UriResourceKind.lambdaAny)        
         .goLambdaExpression()
         .root().left().goPath()
         .first().isUriPathInfoKind(UriResourceKind.lambdaVariable)
-        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        .n().isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+        .isType(EdmString.getInstance().getFullQualifiedName(), false);
 
     testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyInt16 eq 1 or "
         + "d/CollPropertyString/any(e:e eq 'SomeString'))")
@@ -4934,12 +4935,10 @@ public class TestFullResourcePath {
         .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
     testFilter.runOnETKeyNavEx("any(d:d/PropertyInt16 eq 1)")
-        .isExSemantic(MessageKeys.PROPERTY_NOT_IN_TYPE);
+        .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
   }
 
-  // TODO: Implement isof method.
   @Test
-  @Ignore
   public void isOfMethod() throws Exception {
     testFilter.runOnETKeyNav("isof(olingo.odata.test1.ETTwoKeyNav)")
         .is("<isof(<olingo.odata.test1.ETTwoKeyNav>)>")
@@ -4962,7 +4961,7 @@ public class TestFullResourcePath {
         .left().isMethod(MethodKind.ISOF, 1)
         .goParameter(0).isTypedLiteral(EntityTypeProvider.nameETBaseTwoKeyNav);
 
-    testFilter.runOnETKeyNav("isof(NavPropertyETKeyNavOne, olingo.odata.test1.ETKeyNav) eq true")
+    testFilter.runOnETKeyNav("isof(NavPropertyETKeyNavOne,olingo.odata.test1.ETKeyNav) eq true")
         .is("<<isof(<NavPropertyETKeyNavOne>,<olingo.odata.test1.ETKeyNav>)> eq <true>>")
         .root().isBinary(BinaryOperatorKind.EQ)
         .left().isMethod(MethodKind.ISOF, 2)
@@ -5865,7 +5864,6 @@ public class TestFullResourcePath {
 
   // TODO: Better type determination for literal numbers.
   @Test
-  @Ignore
   public void filterLiteralTypes() throws Exception {
     testFilter.runOnETAllPrim("-1000 eq 42")
         .isBinary(BinaryOperatorKind.EQ)


[51/51] [abbrv] olingo-odata4 git commit: [OLINGO-832] Minor change for PoC demo

Posted by mi...@apache.org.
[OLINGO-832] Minor change for PoC demo


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 44e1b02633380e7262ab8985de5c455ee615073c
Parents: c02215e
Author: Michael Bolz <mi...@sap.com>
Authored: Mon Jan 25 14:43:24 2016 +0100
Committer: Michael Bolz <mi...@sap.com>
Committed: Mon Jan 25 14:43:24 2016 +0100

----------------------------------------------------------------------
 .../processor/TechnicalEntityProcessor.java     | 32 +++++++++++++++++---
 1 file changed, 27 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/44e1b026/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
index f4c81c1..dc7f0b7 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
@@ -567,12 +567,11 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
       @Override
       public Entity next() {
         Entity next = entityIterator.next();
-        replacePrimitiveProperty(next, "PropertyString", generateData(28192));
-//        next.getProperties().remove(1);
+//        replacePrimitiveProperty(next, "PropertyString", generateData(28192));
+        replacePrimitiveProperty(next, "PropertyString", generateData(request));
 //        next.addProperty(new Property(null, "PropertyString", ValueType.PRIMITIVE, generateData(28192)));
-        try {
-          TimeUnit.MILLISECONDS.sleep(2500);
-        } catch (InterruptedException e) { }
+
+        sleep(request, 2500);
         return next;
       }
 
@@ -594,6 +593,29 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
         }
       }
 
+      private void sleep(ODataRequest request, int defaultTimeMs) {
+        String sleepTimeMs = request.getHeader("StreamSleep");
+        if(sleepTimeMs != null) {
+          try {
+            defaultTimeMs = Integer.parseInt(sleepTimeMs);
+          } catch (NumberFormatException e) { }
+        }
+        try {
+          TimeUnit.MILLISECONDS.sleep(defaultTimeMs);
+        } catch (InterruptedException e) { }
+
+      }
+
+      private String generateData(ODataRequest request) {
+        String streamHeader = request.getHeader("StreamData");
+        if(streamHeader != null) {
+          try {
+            return generateData(Integer.parseInt(streamHeader));
+          } catch (NumberFormatException e) { }
+        }
+        return generateData(28192);
+      }
+
       private String generateData(final int len) {
         Random random = new Random();
         StringBuilder b = new StringBuilder(len);


[41/51] [abbrv] olingo-odata4 git commit: [OLINGO-852] reduced usage of Serializable and org.apache.commons.lang3 in commons

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java
index 111ae22..47d642d 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java
@@ -18,22 +18,14 @@
  */
 package org.apache.olingo.commons.api.edm.provider;
 
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 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;
-
 /**
  * Super type of all CsdlEdmItems
  */
-public abstract class CsdlAbstractEdmItem implements Serializable {
-
-  private static final long serialVersionUID = 241190986363884784L;
+public abstract class CsdlAbstractEdmItem {
 
   /**
    * Gets one by name.
@@ -63,19 +55,4 @@ public abstract class CsdlAbstractEdmItem implements Serializable {
     }
     return result;
   }
-
-  @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/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java
index ac35691..9f62401 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java
@@ -25,8 +25,6 @@ import java.util.List;
  */
 public class CsdlAction extends CsdlOperation {
 
-  private static final long serialVersionUID = 211295197043448841L;
-
   @Override
   public CsdlAction setName(final String name) {
     this.name = name;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java
index d4df8f4..71a97b9 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java
@@ -27,8 +27,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlActionImport extends CsdlOperationImport {
 
-  private static final long serialVersionUID = 9186148718228340987L;
-
   private FullQualifiedName action;
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
index e5d1ddb..eb551aa 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.provider.annotation.CsdlExpression;
  */
 public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = -7137313445729486860L;
-
   private String term;
 
   private String qualifier;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java
index 7f65f52..2480dac 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java
@@ -26,8 +26,6 @@ import java.util.List;
  */
 public class CsdlAnnotations extends CsdlAbstractEdmItem implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = 8283036066408166150L;
-
   private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
 
   private String target;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
index 67d8f5a..2a748f4 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = -7011724617956042182L;
-
   /**
    * The Name.
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java
index 979a898..19840a2 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java
@@ -27,8 +27,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlComplexType extends CsdlStructuralType {
 
-  private static final long serialVersionUID = 1089771609327713928L;
-
   @Override
   public CsdlComplexType setName(final String name) {
     this.name = name;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java
index 5358f6e..2839510 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = 5384682515007129458L;
-
   private String name;
 
   private FullQualifiedName extendsContainer;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
index a8d17b2..41380c5 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
@@ -27,8 +27,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlEntitySet extends CsdlBindingTarget {
 
-  private static final long serialVersionUID = 5291570018480936643L;
-
   // Default for EntitySets is true
   private boolean includeInServiceDocument = true;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java
index 17fb822..af34ef2 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java
@@ -27,8 +27,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlEntityType extends CsdlStructuralType {
 
-  private static final long serialVersionUID = -1564752618679704024L;
-
   private List<CsdlPropertyRef> key;
 
   private boolean hasStream = false;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java
index bb79b62..61078c4 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java
@@ -26,8 +26,6 @@ import java.util.List;
  */
 public class CsdlEnumMember extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = 5618984420582832094L;
-
   private String name;
 
   private String value;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java
index ca15607..282e9c2 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = -718032622783883403L;
-
   private String name;
 
   private boolean isFlags;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java
index b7364d9..91c2d60 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java
@@ -25,8 +25,6 @@ import java.util.List;
  */
 public class CsdlFunction extends CsdlOperation {
 
-  private static final long serialVersionUID = 673858921468578957L;
-
   private boolean isComposable = false;
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java
index 1b4e56d..bcab45d 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java
@@ -27,8 +27,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlFunctionImport extends CsdlOperationImport {
 
-  private static final long serialVersionUID = 8479762299534736719L;
-
   private FullQualifiedName function;
 
   // Default include in service document is false for function imports

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java
index 741d754..eab18fe 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlNavigationProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = -788021920718310799L;
-
   private String name;
 
   private FullQualifiedName type;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java
index 9169ae4..bab72d8 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java
@@ -23,8 +23,6 @@ package org.apache.olingo.commons.api.edm.provider;
  */
 public class CsdlNavigationPropertyBinding extends CsdlAbstractEdmItem {
 
-  private static final long serialVersionUID = 770380971233808502L;
-
   private String path;
 
   private String target;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java
index 3b5b746..1a326dd 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java
@@ -23,8 +23,6 @@ package org.apache.olingo.commons.api.edm.provider;
  */
 public class CsdlOnDelete extends CsdlAbstractEdmItem {
 
-  private static final long serialVersionUID = -7130889202653716784L;
-
   private CsdlOnDeleteAction action = CsdlOnDeleteAction.None;
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java
index bbd5477..e127e4c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java
@@ -26,8 +26,6 @@ import java.util.List;
  */
 public abstract class CsdlOperation extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = -3842411084067064086L;
-
   /**
    * The Name.
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java
index 4e92bd1..f5ac360 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java
@@ -26,8 +26,6 @@ import java.util.List;
  */
 public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = -8928186067970681061L;
-
   /**
    * The Name.
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java
index 089acc3..e090b3f 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java
@@ -29,8 +29,6 @@ import org.apache.olingo.commons.api.edm.geo.SRID;
  */
 public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = -7360900923880732015L;
-
   private String name;
 
   private String type;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java
index 1127bde..3878417 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java
@@ -29,8 +29,6 @@ import org.apache.olingo.commons.api.edm.geo.SRID;
  */
 public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = -4224390853690843450L;
-
   private String name;
 
   private String type;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java
index c020850..e609e94 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java
@@ -23,8 +23,6 @@ package org.apache.olingo.commons.api.edm.provider;
  */
 public class CsdlPropertyRef extends CsdlAbstractEdmItem implements CsdlNamed {
 
-  private static final long serialVersionUID = 9082892362895660037L;
-
   private String name;
 
   private String alias;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java
index ab9fa6b..8f77650 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java
@@ -26,8 +26,6 @@ import java.util.List;
  */
 public class CsdlReferentialConstraint extends CsdlAbstractEdmItem implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = -7467707499798840075L;
-
   private String property;
 
   private String referencedProperty;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java
index 7d1b02d..eb94acc 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java
@@ -26,8 +26,6 @@ import org.apache.olingo.commons.api.edm.geo.SRID;
  */
 public class CsdlReturnType extends CsdlAbstractEdmItem {
 
-  private static final long serialVersionUID = 4816954124986010965L;
-
   private String type;
 
   private boolean isCollection;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java
index d601005..93067ad 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java
@@ -26,8 +26,6 @@ import java.util.List;
  */
 public class CsdlSchema extends CsdlAbstractEdmItem implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = -1527213201328056750L;
-
   private String namespace;
 
   private String alias;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
index 091f61d..235b240 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
@@ -27,8 +27,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public class CsdlSingleton extends CsdlBindingTarget {
 
-  private static final long serialVersionUID = -3997943079062565895L;
-
   @Override
   public CsdlSingleton setName(final String name) {
     this.name = name;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java
index 1ae4898..d291f48 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
  */
 public abstract class CsdlStructuralType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = 8662852373514258646L;
-
   /**
    * The Name.
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java
index 517c190..e140a50 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.geo.SRID;
  */
 public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = 3843929000407818103L;
-
   private String name;
 
   private String type;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java
index 62b4ac7..2a3ca81 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java
@@ -29,8 +29,6 @@ import org.apache.olingo.commons.api.edm.geo.SRID;
  */
 public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
 
-  private static final long serialVersionUID = 3718980071229613048L;
-
   private String name;
 
   private FullQualifiedName underlyingType;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java
index ed9b31f..1a9935a 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java
@@ -22,7 +22,6 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
  * Represents an annotation path
  */
 public class CsdlAnnotationPath extends CsdlDynamicExpression {
-  private static final long serialVersionUID = 1588336268773032932L;
 
   private String value;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java
index 2c637a5..8bfb596 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java
@@ -24,8 +24,7 @@ import java.util.List;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 
-public class CsdlApply extends CsdlDynamicExpression implements CsdlAnnotatable{
-  private static final long serialVersionUID = 3555689860643577136L;
+public class CsdlApply extends CsdlDynamicExpression implements CsdlAnnotatable {
 
   private String function;
   private List<CsdlExpression> parameters = new ArrayList<CsdlExpression>();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
index 6edbb3d..d3b650c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
@@ -30,7 +30,6 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  * Casts the value obtained from its single child expression to the specified type
  */
 public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable {
-  private static final long serialVersionUID = 7664148202663405946L;
 
   private String type;
   private Integer maxLength;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java
index d1dd9c0..285508b 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java
@@ -27,7 +27,6 @@ import java.util.List;
  * by each of the child expressions.
  */
 public class CsdlCollection extends CsdlDynamicExpression {
-  private static final long serialVersionUID = 3792880963089015493L;
 
   private List<CsdlExpression> items = new ArrayList<CsdlExpression>();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java
index c860598..e8090e0 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java
@@ -18,11 +18,8 @@
  */
 package org.apache.olingo.commons.api.edm.provider.annotation;
 
-
 public class CsdlConstantExpression extends CsdlExpression {
 
-  private static final long serialVersionUID = 5618680702707972904L;
-
   private final ConstantExpressionType type;
   private String value;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
index c298f01..3cbffdc 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
@@ -22,8 +22,6 @@ import java.util.Collection;
 
 public abstract class CsdlDynamicExpression extends CsdlExpression {
 
-  private static final long serialVersionUID = 179628476369962030L;
-  
   /**
    * Returns true if the expression is a logical expression
    * @return true if the expression is a logical expression

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java
index 795e69b..1256690 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java
@@ -22,8 +22,6 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 
 public abstract class CsdlExpression extends CsdlAbstractEdmItem {
 
-  private static final long serialVersionUID = 4731101778893577444L;
-
   /**
    * Return true if the expression is constant
    * @return true if the expression is constant

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java
index b010fb7..fa191b3 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java
@@ -29,8 +29,6 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  */
 public class CsdlIf extends CsdlDynamicExpression implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = -8571383625077590656L;
-
   private CsdlExpression guard;
   private CsdlExpression _then;
   private CsdlExpression _else;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java
index 4236e1a..5785f6b 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java
@@ -31,8 +31,6 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  */
 public class CsdlIsOf extends CsdlDynamicExpression implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = -893355856129761174L;
-
   private String type;
   private Integer maxLength;
   private Integer precision;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java
index dfbd09e..2c31698 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java
@@ -27,9 +27,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  * The edm:LabeledElement expression assigns a name to a child expression. The value of the child expression can
  * then be reused elsewhere with an edm:LabeledElementReference (See {@link CsdlLabeledElementReference}) expression.
  */
-public class CsdlLabeledElement extends CsdlDynamicExpression implements CsdlAnnotatable{
-
-  private static final long serialVersionUID = -5885321101447070204L;
+public class CsdlLabeledElement extends CsdlDynamicExpression implements CsdlAnnotatable {
 
   private String name;
   private CsdlExpression value;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java
index c8ce8e9..b9b9483 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java
@@ -23,7 +23,6 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
  * edm:LabeledElement (see {@link CsdlLabeledElement}) expression.
  */
 public class CsdlLabeledElementReference extends CsdlDynamicExpression {
-  private static final long serialVersionUID = -4793707024628773226L;
 
   private String value;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java
index 3fcf6a2..bbf50f4 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java
@@ -26,8 +26,6 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 
 public class CsdlLogicalOrComparisonExpression extends CsdlDynamicExpression implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = -8268617065621508270L;
-
   private final LogicalOrComparisonExpressionType type;
   private CsdlExpression left;
   private CsdlExpression right;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java
index a5ee684..f600c0a 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java
@@ -23,7 +23,6 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
  * built-in abstract type Edm.NavigationPropertyPath
  */
 public class CsdlNavigationPropertyPath extends CsdlDynamicExpression {
-  private static final long serialVersionUID = -8047231485537503181L;
   
   private String value;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java
index 5350f2e..b7c85d7 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java
@@ -29,8 +29,6 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  */
 public class CsdlNull extends CsdlDynamicExpression implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = 3696395405429914435L;
-
   private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java
index 244aa72..4d1d2e1 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java
@@ -24,7 +24,6 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
  *  navigation properties of structured types, and properties of structured types.
  */
 public class CsdlPath extends CsdlDynamicExpression {
-  private static final long serialVersionUID = 6458406537881061846L;
   
   private String value;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java
index 9a8689b..f1d562f 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java
@@ -23,7 +23,6 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
  * abstract type Edm.PropertyPath.
  */
 public class CsdlPropertyPath extends CsdlDynamicExpression {
-  private static final long serialVersionUID = -8182384289259575448L;
 
   private String value;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
index 1aec97e..4ee4b79 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
@@ -25,15 +25,12 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 
-
 /**
  * The edm:PropertyValue element supplies a value to a property on the type instantiated by an 
  * edm:Record expression (See {@link org.apache.olingo.commons.api.edm.annotation.EdmRecord}). 
  * The value is obtained by evaluating an expression.
  */
-public class CsdlPropertyValue extends CsdlAbstractEdmItem implements CsdlAnnotatable{
-
-  private static final long serialVersionUID = -6671376680245613990L;
+public class CsdlPropertyValue extends CsdlAbstractEdmItem implements CsdlAnnotatable {
 
   private String property;
   private CsdlExpression value;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java
index da9271d..772e97e 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java
@@ -30,7 +30,6 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  */
 public class CsdlRecord extends CsdlDynamicExpression implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = 8557849619469577884L;
   private String type;
   private List<CsdlPropertyValue> propertyValues = new ArrayList<CsdlPropertyValue>();
   private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java
index 1d2dc7b..a08a279 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java
@@ -28,9 +28,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  * The edm:UrlRef expression enables a value to be obtained by sending a GET request to the value of
  * the UrlRef expression.
  */
-public class CsdlUrlRef extends CsdlDynamicExpression implements CsdlAnnotatable{
+public class CsdlUrlRef extends CsdlDynamicExpression implements CsdlAnnotatable {
 
-  private static final long serialVersionUID = 3781479172952387841L;
   private CsdlExpression value;
   private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
index dd0d025..b712f9f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
@@ -25,7 +25,6 @@ import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.geo.Geospatial;
 import org.apache.olingo.commons.api.edm.geo.Geospatial.Dimension;
@@ -89,15 +88,15 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode)
           throws EdmPrimitiveTypeException {
 
-    final String[] pointCoo = StringUtils.split(point, ' ');
-    if (pointCoo == null || pointCoo.length != 2) {
+    final List<String> pointCoo = split(point, ' ');
+    if (pointCoo == null || pointCoo.size() != 2) {
       throw new EdmPrimitiveTypeException("The literal '" + point + "' has illegal content.");
     }
 
     final Point result = new Point(this.dimension, srid);
-    result.setX(EdmDouble.getInstance().valueOfString(pointCoo[0],
+    result.setX(EdmDouble.getInstance().valueOfString(pointCoo.get(0),
         isNullable, maxLength, precision, scale, isUnicode, Double.class));
-    result.setY(EdmDouble.getInstance().valueOfString(pointCoo[1],
+    result.setY(EdmDouble.getInstance().valueOfString(pointCoo.get(1),
         isNullable, maxLength, precision, scale, isUnicode, Double.class));
 
     return result;
@@ -118,7 +117,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
     final Matcher matcher = getMatcher(PATTERN, value);
 
     final List<Point> points = new ArrayList<Point>();
-    for (String pointCoo : StringUtils.split(matcher.group(4), ',')) {
+    for (final String pointCoo : split(matcher.group(4), ',')) {
       points.add(newPoint(null, pointCoo.substring(1, pointCoo.length() - 1),
           isNullable, maxLength, precision, scale, isUnicode));
     }
@@ -131,7 +130,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
           throws EdmPrimitiveTypeException {
 
     final List<Point> points = new ArrayList<Point>();
-    for (String pointCoo : StringUtils.split(lineString, ',')) {
+    for (final String pointCoo : split(lineString, ',')) {
       points.add(newPoint(null, pointCoo, isNullable, maxLength, precision, scale, isUnicode));
     }
 
@@ -162,7 +161,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
         lineString = lineString.substring(1);
       }
       if (lineString.endsWith(")")) {
-        lineString = StringUtils.substringBeforeLast(lineString, ")");
+        lineString = lineString.substring(0, lineString.length() - 1);
       }
 
       lineStrings.add(newLineString(null, lineString, isNullable, maxLength, precision, scale, isUnicode));
@@ -178,11 +177,11 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
     final String[] first = polygon.split("\\),\\(");
 
     final List<Point> interior = new ArrayList<Point>();
-    for (String pointCoo : StringUtils.split(first[0].substring(1, first[0].length()), ',')) {
+    for (final String pointCoo : split(first[0].substring(1, first[0].length()), ',')) {
       interior.add(newPoint(null, pointCoo, isNullable, maxLength, precision, scale, isUnicode));
     }
     final List<Point> exterior = new ArrayList<Point>();
-    for (String pointCoo : StringUtils.split(first[1].substring(0, first[1].length() - 1), ',')) {
+    for (final String pointCoo : split(first[1].substring(0, first[1].length() - 1), ',')) {
       exterior.add(newPoint(null, pointCoo, isNullable, maxLength, precision, scale, isUnicode));
     }
 
@@ -204,15 +203,16 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
     final Matcher matcher = getMatcher(PATTERN, value);
 
     final List<Polygon> polygons = new ArrayList<Polygon>();
-    for (String coo : matcher.group(4).contains(")),((")
-        ? matcher.group(4).split("\\)\\),\\(\\(") : new String[] { matcher.group(4) }) {
+    for (String coo : matcher.group(4).contains(")),((") ?
+        matcher.group(4).split("\\)\\),\\(\\(") :
+        new String[] { matcher.group(4) }) {
 
       String polygon = coo;
       if (polygon.startsWith("((")) {
         polygon = polygon.substring(1);
       }
       if (polygon.endsWith("))")) {
-        polygon = StringUtils.substringBeforeLast(polygon, ")");
+        polygon = polygon.substring(0, polygon.length() - 1);
       }
       if (polygon.charAt(0) != '(') {
         polygon = "(" + polygon;
@@ -242,7 +242,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
 
     case MULTIPOINT:
       final List<Point> points = new ArrayList<Point>();
-      for (String pointCoo : StringUtils.split(matcher.group(4), ',')) {
+      for (final String pointCoo : split(matcher.group(4), ',')) {
         points.add(newPoint(null, pointCoo.substring(1, pointCoo.length() - 1),
             isNullable, maxLength, precision, scale, isUnicode));
       }
@@ -257,7 +257,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
 
     case MULTILINESTRING:
       final List<LineString> lineStrings = new ArrayList<LineString>();
-      for (String coo : StringUtils.split(matcher.group(4), ',')) {
+      for (final String coo : split(matcher.group(4), ',')) {
         lineStrings.add(newLineString(null, coo.substring(1, coo.length() - 1),
             isNullable, maxLength, precision, scale, isUnicode));
       }
@@ -272,7 +272,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
 
     case MULTIPOLYGON:
       final List<Polygon> polygons = new ArrayList<Polygon>();
-      for (String coo : StringUtils.split(matcher.group(4), ',')) {
+      for (final String coo : split(matcher.group(4), ',')) {
         polygons.add(newPolygon(null, coo.substring(1, coo.length() - 1),
             isNullable, maxLength, precision, scale, isUnicode));
       }
@@ -530,4 +530,21 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
 
     return result.append(")'").toString();
   }
+
+  private List<String> split(final String input, final char separator) {
+    if (input == null) {
+      return null;
+    }
+    List<String> list = new ArrayList<String>();
+    int start = 0;
+    int end;
+    while ((end = input.indexOf(separator, start)) >= 0) {
+      list.add(input.substring(start, end));
+      start = end + 1;
+    }
+    if (start < input.length()) {
+      list.add(input.substring(start));
+    }
+    return list;
+  }
 }


[16/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] Set new 4.2.0-SNAPSHOT version

Posted by mi...@apache.org.
[OLINGO-841] Set new 4.2.0-SNAPSHOT version


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 0d6f4821f2b0445a20f5944be9bc40917b897edb
Parents: 0242519
Author: Christian Amend <ch...@sap.com>
Authored: Mon Dec 21 12:55:05 2015 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Dec 21 12:55:05 2015 +0100

----------------------------------------------------------------------
 dist/android-lib/pom.xml                              | 2 +-
 dist/client-lib/pom.xml                               | 2 +-
 dist/javadoc/pom.xml                                  | 2 +-
 dist/pom.xml                                          | 2 +-
 dist/server-lib/pom.xml                               | 2 +-
 ext/client-android/pom.xml                            | 2 +-
 ext/client-proxy/pom.xml                              | 2 +-
 ext/karaf/karaf-features/pom.xml                      | 2 +-
 ext/karaf/karaf-fit/pom.xml                           | 2 +-
 ext/karaf/pom.xml                                     | 2 +-
 ext/pojogen-maven-plugin/pom.xml                      | 2 +-
 ext/pom.xml                                           | 2 +-
 fit/pom.xml                                           | 2 +-
 lib/client-api/pom.xml                                | 2 +-
 lib/client-core/pom.xml                               | 2 +-
 lib/commons-api/pom.xml                               | 2 +-
 lib/commons-core/pom.xml                              | 2 +-
 lib/pom.xml                                           | 2 +-
 lib/server-api/pom.xml                                | 2 +-
 lib/server-core-ext/pom.xml                           | 2 +-
 lib/server-core/pom.xml                               | 2 +-
 lib/server-tecsvc/pom.xml                             | 2 +-
 lib/server-test/pom.xml                               | 2 +-
 pom.xml                                               | 2 +-
 samples/client/pom.xml                                | 2 +-
 samples/osgi/server/pom.xml                           | 2 +-
 samples/pom.xml                                       | 2 +-
 samples/server/pom.xml                                | 2 +-
 samples/tutorials/p0_all/pom.xml                      | 4 ++--
 samples/tutorials/p10_media/pom.xml                   | 4 ++--
 samples/tutorials/p11_batch/pom.xml                   | 4 ++--
 samples/tutorials/p12_deep_insert/pom.xml             | 4 ++--
 samples/tutorials/p12_deep_insert_preparation/pom.xml | 4 ++--
 samples/tutorials/p1_read/pom.xml                     | 4 ++--
 samples/tutorials/p2_readep/pom.xml                   | 4 ++--
 samples/tutorials/p3_write/pom.xml                    | 4 ++--
 samples/tutorials/p4_navigation/pom.xml               | 4 ++--
 samples/tutorials/p5_queryoptions-tcs/pom.xml         | 4 ++--
 samples/tutorials/p6_queryoptions-es/pom.xml          | 4 ++--
 samples/tutorials/p7_queryoptions-o/pom.xml           | 4 ++--
 samples/tutorials/p8_queryoptions-f/pom.xml           | 4 ++--
 samples/tutorials/p9_action/pom.xml                   | 4 ++--
 samples/tutorials/p9_action_preparation/pom.xml       | 4 ++--
 samples/tutorials/pom.xml                             | 2 +-
 44 files changed, 59 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/dist/android-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/android-lib/pom.xml b/dist/android-lib/pom.xml
index 80b16b3..eedbd24 100644
--- a/dist/android-lib/pom.xml
+++ b/dist/android-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/dist/client-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/client-lib/pom.xml b/dist/client-lib/pom.xml
index 8e04bbb..058588c 100644
--- a/dist/client-lib/pom.xml
+++ b/dist/client-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/dist/javadoc/pom.xml b/dist/javadoc/pom.xml
index afb6c7b..ca5fee2 100644
--- a/dist/javadoc/pom.xml
+++ b/dist/javadoc/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/dist/pom.xml
----------------------------------------------------------------------
diff --git a/dist/pom.xml b/dist/pom.xml
index 92bea67..957a82c 100644
--- a/dist/pom.xml
+++ b/dist/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/dist/server-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/server-lib/pom.xml b/dist/server-lib/pom.xml
index 27889e2..7e30780 100644
--- a/dist/server-lib/pom.xml
+++ b/dist/server-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/ext/client-android/pom.xml
----------------------------------------------------------------------
diff --git a/ext/client-android/pom.xml b/ext/client-android/pom.xml
index f2f19af..d83c1bf 100644
--- a/ext/client-android/pom.xml
+++ b/ext/client-android/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/ext/client-proxy/pom.xml
----------------------------------------------------------------------
diff --git a/ext/client-proxy/pom.xml b/ext/client-proxy/pom.xml
index 4bb4160..e821580 100644
--- a/ext/client-proxy/pom.xml
+++ b/ext/client-proxy/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/ext/karaf/karaf-features/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-features/pom.xml b/ext/karaf/karaf-features/pom.xml
index d92dd28..f96de5f 100644
--- a/ext/karaf/karaf-features/pom.xml
+++ b/ext/karaf/karaf-features/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-karaf</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
     <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/ext/karaf/karaf-fit/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-fit/pom.xml b/ext/karaf/karaf-fit/pom.xml
index 05cce87..7e66a14 100644
--- a/ext/karaf/karaf-fit/pom.xml
+++ b/ext/karaf/karaf-fit/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-karaf</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
   <dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/ext/karaf/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/pom.xml b/ext/karaf/pom.xml
index 97a22da..c5fbec5 100644
--- a/ext/karaf/pom.xml
+++ b/ext/karaf/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/ext/pojogen-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/pom.xml b/ext/pojogen-maven-plugin/pom.xml
index 3a5781e..8efdf78 100644
--- a/ext/pojogen-maven-plugin/pom.xml
+++ b/ext/pojogen-maven-plugin/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/ext/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pom.xml b/ext/pom.xml
index 6f77ed6..b586126 100644
--- a/ext/pom.xml
+++ b/ext/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/fit/pom.xml
----------------------------------------------------------------------
diff --git a/fit/pom.xml b/fit/pom.xml
index e9130e8..516c5f5 100644
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/client-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-api/pom.xml b/lib/client-api/pom.xml
index d4c2c7d..64a3793 100644
--- a/lib/client-api/pom.xml
+++ b/lib/client-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/client-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/pom.xml b/lib/client-core/pom.xml
index f41ddf3..a9c7f7a 100644
--- a/lib/client-core/pom.xml
+++ b/lib/client-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/commons-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-api/pom.xml b/lib/commons-api/pom.xml
index 4b666bc..dabf9c8 100644
--- a/lib/commons-api/pom.xml
+++ b/lib/commons-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/commons-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-core/pom.xml b/lib/commons-core/pom.xml
index 01a7c13..2c069f9 100644
--- a/lib/commons-core/pom.xml
+++ b/lib/commons-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/pom.xml
----------------------------------------------------------------------
diff --git a/lib/pom.xml b/lib/pom.xml
index f19e4c3..0b8d2eb 100644
--- a/lib/pom.xml
+++ b/lib/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/server-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-api/pom.xml b/lib/server-api/pom.xml
index 41c8244..805ceb8 100644
--- a/lib/server-api/pom.xml
+++ b/lib/server-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/server-core-ext/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/pom.xml b/lib/server-core-ext/pom.xml
index 9b066cb..e15dc1a 100644
--- a/lib/server-core-ext/pom.xml
+++ b/lib/server-core-ext/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
   <dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/server-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml
index fd9f52c..8b18338 100644
--- a/lib/server-core/pom.xml
+++ b/lib/server-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/server-tecsvc/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/pom.xml b/lib/server-tecsvc/pom.xml
index f2b7df2..694f704 100644
--- a/lib/server-tecsvc/pom.xml
+++ b/lib/server-tecsvc/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/lib/server-test/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-test/pom.xml b/lib/server-test/pom.xml
index ff2411c..7def3ef 100644
--- a/lib/server-test/pom.xml
+++ b/lib/server-test/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cf58a9f..66b5ffc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
 
   <groupId>org.apache.olingo</groupId>
   <artifactId>odata-parent</artifactId>
-  <version>4.1.0</version>
+  <version>4.2.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Olingo-OData</name>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/client/pom.xml b/samples/client/pom.xml
index c4b7eaf..0ab63b6 100644
--- a/samples/client/pom.xml
+++ b/samples/client/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/osgi/server/pom.xml
----------------------------------------------------------------------
diff --git a/samples/osgi/server/pom.xml b/samples/osgi/server/pom.xml
index a82a6fe..612734f 100644
--- a/samples/osgi/server/pom.xml
+++ b/samples/osgi/server/pom.xml
@@ -30,7 +30,7 @@ under the License.
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>../..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/pom.xml
----------------------------------------------------------------------
diff --git a/samples/pom.xml b/samples/pom.xml
index d0e3ade..5c9e3d0 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/server/pom.xml
----------------------------------------------------------------------
diff --git a/samples/server/pom.xml b/samples/server/pom.xml
index 79fe9dc..5d80014 100644
--- a/samples/server/pom.xml
+++ b/samples/server/pom.xml
@@ -30,7 +30,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>odata-samples</artifactId>
-		<version>4.1.0</version>
+		<version>4.2.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p0_all/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p0_all/pom.xml b/samples/tutorials/p0_all/pom.xml
index 10968d5..1826b81 100644
--- a/samples/tutorials/p0_all/pom.xml
+++ b/samples/tutorials/p0_all/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId} Webapp</name>
 
@@ -35,7 +35,7 @@
 
     <properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p10_media/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p10_media/pom.xml b/samples/tutorials/p10_media/pom.xml
index 7ed3a23..a93c015 100644
--- a/samples/tutorials/p10_media/pom.xml
+++ b/samples/tutorials/p10_media/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Media</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p11_batch/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p11_batch/pom.xml b/samples/tutorials/p11_batch/pom.xml
index d788697..b98b541 100644
--- a/samples/tutorials/p11_batch/pom.xml
+++ b/samples/tutorials/p11_batch/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Batch</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p12_deep_insert/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p12_deep_insert/pom.xml b/samples/tutorials/p12_deep_insert/pom.xml
index 89221c6..c2fbf0e 100644
--- a/samples/tutorials/p12_deep_insert/pom.xml
+++ b/samples/tutorials/p12_deep_insert/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-DeepInsert</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p12_deep_insert_preparation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p12_deep_insert_preparation/pom.xml b/samples/tutorials/p12_deep_insert_preparation/pom.xml
index 0e4fcd5..895cf80 100644
--- a/samples/tutorials/p12_deep_insert_preparation/pom.xml
+++ b/samples/tutorials/p12_deep_insert_preparation/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-DeepInsertPreparation</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p1_read/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p1_read/pom.xml b/samples/tutorials/p1_read/pom.xml
index 4b80777..9b73a16 100755
--- a/samples/tutorials/p1_read/pom.xml
+++ b/samples/tutorials/p1_read/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
 	<artifactId>DemoService-Read</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p2_readep/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p2_readep/pom.xml b/samples/tutorials/p2_readep/pom.xml
index e3a392f..73bfa9d 100755
--- a/samples/tutorials/p2_readep/pom.xml
+++ b/samples/tutorials/p2_readep/pom.xml
@@ -9,7 +9,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-ReadEp</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -19,7 +19,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p3_write/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p3_write/pom.xml b/samples/tutorials/p3_write/pom.xml
index 4da371e..5c1d59e 100755
--- a/samples/tutorials/p3_write/pom.xml
+++ b/samples/tutorials/p3_write/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Write</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p4_navigation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p4_navigation/pom.xml b/samples/tutorials/p4_navigation/pom.xml
index 9a9919e..7812b4c 100755
--- a/samples/tutorials/p4_navigation/pom.xml
+++ b/samples/tutorials/p4_navigation/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
   <artifactId>DemoService-Navigation</artifactId>
   <packaging>war</packaging>
-  <version>4.1.0</version>
+  <version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p5_queryoptions-tcs/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p5_queryoptions-tcs/pom.xml b/samples/tutorials/p5_queryoptions-tcs/pom.xml
index 40c671b..c9853e0 100755
--- a/samples/tutorials/p5_queryoptions-tcs/pom.xml
+++ b/samples/tutorials/p5_queryoptions-tcs/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-TCS</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p6_queryoptions-es/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p6_queryoptions-es/pom.xml b/samples/tutorials/p6_queryoptions-es/pom.xml
index 6ddc3ee..54faaf6 100755
--- a/samples/tutorials/p6_queryoptions-es/pom.xml
+++ b/samples/tutorials/p6_queryoptions-es/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
   <artifactId>DemoService-QueryOptions-ES</artifactId>
   <packaging>war</packaging>
-  <version>4.1.0</version>
+  <version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p7_queryoptions-o/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p7_queryoptions-o/pom.xml b/samples/tutorials/p7_queryoptions-o/pom.xml
index 4fc8048..d6f1d79 100644
--- a/samples/tutorials/p7_queryoptions-o/pom.xml
+++ b/samples/tutorials/p7_queryoptions-o/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-O</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p8_queryoptions-f/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p8_queryoptions-f/pom.xml b/samples/tutorials/p8_queryoptions-f/pom.xml
index 476c213..9d93247 100644
--- a/samples/tutorials/p8_queryoptions-f/pom.xml
+++ b/samples/tutorials/p8_queryoptions-f/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-F</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId} Webapp</name>
 
@@ -35,7 +35,7 @@
 
     <properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p9_action/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p9_action/pom.xml b/samples/tutorials/p9_action/pom.xml
index fa441f9..bed3f3b 100644
--- a/samples/tutorials/p9_action/pom.xml
+++ b/samples/tutorials/p9_action/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Action</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/p9_action_preparation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p9_action_preparation/pom.xml b/samples/tutorials/p9_action_preparation/pom.xml
index ba631db..40bcc61 100644
--- a/samples/tutorials/p9_action_preparation/pom.xml
+++ b/samples/tutorials/p9_action_preparation/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-ActionPreparation</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0</version>
+	<version>4.2.0-SNAPSHOT</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0</odata.version>
+		<odata.version>4.2.0-SNAPSHOT</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d6f4821/samples/tutorials/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/pom.xml b/samples/tutorials/pom.xml
index 5187f78..b3a2c96 100644
--- a/samples/tutorials/pom.xml
+++ b/samples/tutorials/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0</version>
+    <version>4.2.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 


[26/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] Fix fit maven pom

Posted by mi...@apache.org.
[OLINGO-834] Fix fit maven pom


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 40be3e4a29e72bf5c224c5003a87de25e5ef8d24
Parents: 26080f4
Author: Christian Amend <ch...@sap.com>
Authored: Thu Jan 7 16:16:12 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Thu Jan 7 16:16:12 2016 +0100

----------------------------------------------------------------------
 fit/pom.xml | 7 -------
 1 file changed, 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40be3e4a/fit/pom.xml
----------------------------------------------------------------------
diff --git a/fit/pom.xml b/fit/pom.xml
index 516c5f5..34eff39 100644
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@ -208,13 +208,6 @@
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
         <version>2.8</version>
         <executions>


[24/51] [abbrv] olingo-odata4 git commit: Merge branch 'master' into OLINGO-834_Filter_Parser

Posted by mi...@apache.org.
Merge branch 'master' into OLINGO-834_Filter_Parser

Conflicts:
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
	lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
	lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 010642c506d593c83cfb136cd9f5ddb815bf8ba7
Parents: 8925274 0d6f482
Author: Christian Amend <ch...@sap.com>
Authored: Thu Jan 7 14:27:27 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Thu Jan 7 14:27:27 2016 +0100

----------------------------------------------------------------------
 dist/android-lib/pom.xml                        |   2 +-
 dist/client-lib/pom.xml                         |   2 +-
 dist/javadoc/pom.xml                            |   2 +-
 dist/pom.xml                                    |   2 +-
 dist/server-lib/pom.xml                         |   2 +-
 ext/client-android/pom.xml                      |   2 +-
 ext/client-proxy/pom.xml                        |   2 +-
 ext/karaf/karaf-features/pom.xml                |   2 +-
 ext/karaf/karaf-fit/pom.xml                     |   2 +-
 ext/karaf/pom.xml                               |   2 +-
 ext/pojogen-maven-plugin/pom.xml                |   2 +-
 ext/pom.xml                                     |   2 +-
 fit/pom.xml                                     |   2 +-
 lib/client-api/pom.xml                          |   2 +-
 lib/client-core/pom.xml                         |   2 +-
 .../olingo/client/core/uri/URIBuilderImpl.java  |   4 +-
 .../olingo/client/core/uri/URIBuilderTest.java  |  15 +-
 lib/commons-api/pom.xml                         |   2 +-
 lib/commons-core/pom.xml                        |   2 +-
 lib/pom.xml                                     |   2 +-
 lib/server-api/pom.xml                          |   2 +-
 .../apache/olingo/server/api/HttpHeaders.java   |   4 +-
 .../org/apache/olingo/server/api/OData.java     |   6 +-
 .../server/api/ODataApplicationException.java   |   4 +-
 .../olingo/server/api/ODataHttpHandler.java     |   4 +-
 .../server/api/ODataLibraryException.java       |   4 +-
 .../apache/olingo/server/api/ODataRequest.java  |   6 +-
 .../apache/olingo/server/api/ODataResponse.java |   5 +-
 .../olingo/server/api/ODataServerError.java     |   4 +-
 .../olingo/server/api/ServiceMetadata.java      |   4 +-
 .../olingo/server/api/batch/BatchFacade.java    | 106 +++++-----
 .../olingo/server/api/batch/package-info.java   |   4 +-
 .../server/api/debug/DebugInformation.java      |  16 +-
 .../server/api/debug/DebugResponseHelper.java   |   4 +-
 .../olingo/server/api/debug/DebugSupport.java   |   9 +-
 .../server/api/debug/DefaultDebugSupport.java   |   8 +-
 .../server/api/debug/RuntimeMeasurement.java    |  12 +-
 .../olingo/server/api/debug/package-info.java   |   4 +-
 .../api/deserializer/DeserializerException.java |   4 +-
 .../api/deserializer/DeserializerResult.java    |   4 +-
 .../deserializer/FixedFormatDeserializer.java   |  12 +-
 .../api/deserializer/ODataDeserializer.java     |  10 +-
 .../batch/BatchDeserializerException.java       |  14 +-
 .../api/deserializer/batch/BatchOptions.java    |   8 +-
 .../deserializer/batch/BatchRequestPart.java    |   4 +-
 .../deserializer/batch/ODataResponsePart.java   |   8 +-
 .../api/deserializer/batch/package-info.java    |   4 +-
 .../server/api/deserializer/package-info.java   |   4 +-
 .../server/api/etag/CustomETagSupport.java      |   4 +-
 .../olingo/server/api/etag/ETagHelper.java      |  22 +-
 .../server/api/etag/PreconditionException.java  |   4 +-
 .../api/etag/ServiceMetadataETagSupport.java    |   6 +-
 .../olingo/server/api/etag/package-info.java    |   4 +-
 .../apache/olingo/server/api/package-info.java  |   4 +-
 .../olingo/server/api/prefer/Preferences.java   |  13 +-
 .../server/api/prefer/PreferencesApplied.java   |  16 +-
 .../olingo/server/api/prefer/package-info.java  |   4 +-
 .../ActionComplexCollectionProcessor.java       |   4 +-
 .../api/processor/ActionComplexProcessor.java   |   4 +-
 .../ActionEntityCollectionProcessor.java        |   4 +-
 .../api/processor/ActionEntityProcessor.java    |   4 +-
 .../ActionPrimitiveCollectionProcessor.java     |   4 +-
 .../api/processor/ActionPrimitiveProcessor.java |   4 +-
 .../api/processor/ActionVoidProcessor.java      |   4 +-
 .../server/api/processor/BatchProcessor.java    |   4 +-
 .../processor/ComplexCollectionProcessor.java   |   4 +-
 .../server/api/processor/ComplexProcessor.java  |   4 +-
 .../CountComplexCollectionProcessor.java        |   4 +-
 .../CountEntityCollectionProcessor.java         |   4 +-
 .../CountPrimitiveCollectionProcessor.java      |   4 +-
 .../server/api/processor/DefaultProcessor.java  |   4 +-
 .../server/api/processor/DeltaProcessor.java    |  30 +--
 .../processor/EntityCollectionProcessor.java    |   4 +-
 .../server/api/processor/EntityProcessor.java   |   6 +-
 .../server/api/processor/ErrorProcessor.java    |   6 +-
 .../api/processor/MediaEntityProcessor.java     |   4 +-
 .../server/api/processor/MetadataProcessor.java |   4 +-
 .../processor/PrimitiveCollectionProcessor.java |   4 +-
 .../api/processor/PrimitiveProcessor.java       |   6 +-
 .../api/processor/PrimitiveValueProcessor.java  |   6 +-
 .../olingo/server/api/processor/Processor.java  |   4 +-
 .../processor/ReferenceCollectionProcessor.java |   4 +-
 .../api/processor/ReferenceProcessor.java       |   4 +-
 .../api/processor/ServiceDocumentProcessor.java |   4 +-
 .../server/api/processor/package-info.java      |   5 +-
 .../serializer/BatchSerializerException.java    |   7 +-
 .../serializer/ComplexSerializerOptions.java    |  10 +-
 .../serializer/CustomContentTypeSupport.java    |   4 +-
 .../EntityCollectionSerializerOptions.java      |   8 +-
 .../api/serializer/EntitySerializerOptions.java |   8 +-
 .../api/serializer/FixedFormatSerializer.java   |   6 +-
 .../server/api/serializer/ODataSerializer.java  |  52 ++---
 .../serializer/PrimitiveSerializerOptions.java  |  10 +-
 .../PrimitiveValueSerializerOptions.java        |   4 +-
 .../ReferenceCollectionSerializerOptions.java   |  12 +-
 .../serializer/ReferenceSerializerOptions.java  |   4 +-
 .../api/serializer/RepresentationType.java      |   4 +-
 .../api/serializer/SerializerException.java     |   4 +-
 .../server/api/serializer/SerializerResult.java |   4 +-
 .../server/api/serializer/package-info.java     |   4 +-
 .../apache/olingo/server/api/uri/UriHelper.java |  10 +-
 .../apache/olingo/server/api/uri/UriInfo.java   |   6 +-
 .../olingo/server/api/uri/UriInfoAll.java       |   6 +-
 .../olingo/server/api/uri/UriInfoBatch.java     |   6 +-
 .../olingo/server/api/uri/UriInfoCrossjoin.java |   8 +-
 .../olingo/server/api/uri/UriInfoEntityId.java  |   4 +-
 .../olingo/server/api/uri/UriInfoKind.java      |   4 +-
 .../olingo/server/api/uri/UriInfoMetadata.java  |   4 +-
 .../olingo/server/api/uri/UriInfoResource.java  |   4 +-
 .../olingo/server/api/uri/UriInfoService.java   |   6 +-
 .../olingo/server/api/uri/UriParameter.java     |   4 +-
 .../olingo/server/api/uri/UriResource.java      |   4 +-
 .../server/api/uri/UriResourceAction.java       |   4 +-
 .../api/uri/UriResourceComplexProperty.java     |   4 +-
 .../olingo/server/api/uri/UriResourceCount.java |   6 +-
 .../server/api/uri/UriResourceEntitySet.java    |   4 +-
 .../server/api/uri/UriResourceFunction.java     |   4 +-
 .../olingo/server/api/uri/UriResourceIt.java    |   4 +-
 .../olingo/server/api/uri/UriResourceKind.java  |   4 +-
 .../server/api/uri/UriResourceLambdaAll.java    |   4 +-
 .../server/api/uri/UriResourceLambdaAny.java    |   4 +-
 .../api/uri/UriResourceLambdaVariable.java      |   4 +-
 .../server/api/uri/UriResourceNavigation.java   |   4 +-
 .../server/api/uri/UriResourcePartTyped.java    |   6 +-
 .../api/uri/UriResourcePrimitiveProperty.java   |   6 +-
 .../server/api/uri/UriResourceProperty.java     |   4 +-
 .../olingo/server/api/uri/UriResourceRef.java   |   6 +-
 .../olingo/server/api/uri/UriResourceRoot.java  |   6 +-
 .../server/api/uri/UriResourceSingleton.java    |   4 +-
 .../olingo/server/api/uri/UriResourceValue.java |   6 +-
 .../olingo/server/api/uri/package-info.java     |   6 +-
 .../api/uri/queryoption/AliasQueryOption.java   |   4 +-
 .../server/api/uri/queryoption/CountOption.java |   4 +-
 .../api/uri/queryoption/CustomQueryOption.java  |   6 +-
 .../server/api/uri/queryoption/ExpandItem.java  |   4 +-
 .../api/uri/queryoption/ExpandOption.java       |   4 +-
 .../api/uri/queryoption/FilterOption.java       |   4 +-
 .../api/uri/queryoption/FormatOption.java       |   4 +-
 .../server/api/uri/queryoption/IdOption.java    |   4 +-
 .../api/uri/queryoption/LevelsExpandOption.java |   4 +-
 .../server/api/uri/queryoption/OrderByItem.java |   4 +-
 .../api/uri/queryoption/OrderByOption.java      |   4 +-
 .../server/api/uri/queryoption/QueryOption.java |   4 +-
 .../api/uri/queryoption/SearchOption.java       |   4 +-
 .../server/api/uri/queryoption/SelectItem.java  |   4 +-
 .../api/uri/queryoption/SelectOption.java       |   4 +-
 .../server/api/uri/queryoption/SkipOption.java  |   4 +-
 .../api/uri/queryoption/SkipTokenOption.java    |   4 +-
 .../api/uri/queryoption/SystemQueryOption.java  |   4 +-
 .../uri/queryoption/SystemQueryOptionKind.java  |   4 +-
 .../server/api/uri/queryoption/TopOption.java   |   4 +-
 .../api/uri/queryoption/expression/Alias.java   |   4 +-
 .../api/uri/queryoption/expression/Binary.java  |   4 +-
 .../expression/BinaryOperatorKind.java          |   4 +-
 .../uri/queryoption/expression/Enumeration.java |   4 +-
 .../uri/queryoption/expression/Expression.java  |   6 +-
 .../expression/ExpressionVisitException.java    |   4 +-
 .../expression/ExpressionVisitor.java           |   4 +-
 .../uri/queryoption/expression/LambdaRef.java   |   4 +-
 .../api/uri/queryoption/expression/Literal.java |  10 +-
 .../api/uri/queryoption/expression/Member.java  |   4 +-
 .../api/uri/queryoption/expression/Method.java  |   4 +-
 .../uri/queryoption/expression/MethodKind.java  |   4 +-
 .../uri/queryoption/expression/TypeLiteral.java |   4 +-
 .../api/uri/queryoption/expression/Unary.java   |   4 +-
 .../expression/UnaryOperatorKind.java           |   4 +-
 .../expression/VisitableExpression.java         |   4 +-
 .../queryoption/expression/package-info.java    |   4 +-
 .../api/uri/queryoption/package-info.java       |   4 +-
 .../uri/queryoption/search/SearchBinary.java    |   4 +-
 .../search/SearchBinaryOperatorKind.java        |   4 +-
 .../queryoption/search/SearchExpression.java    |  18 +-
 .../api/uri/queryoption/search/SearchTerm.java  |   4 +-
 .../api/uri/queryoption/search/SearchUnary.java |   5 +-
 .../search/SearchUnaryOperatorKind.java         |   4 +-
 .../uri/queryoption/search/package-info.java    |   4 +-
 .../olingo/server/api/ODataRequestTest.java     |   4 +-
 .../server/api/TranslatedExceptionsTest.java    |   4 +-
 .../api/prefer/PreferencesAppliedTest.java      |  22 +-
 lib/server-core-ext/pom.xml                     |   2 +-
 lib/server-core/pom.xml                         |   2 +-
 .../olingo/server/core/ContentNegotiator.java   |  18 +-
 .../server/core/ContentNegotiatorException.java |   4 +-
 .../server/core/DefaultRedirectProcessor.java   |   4 +-
 .../olingo/server/core/ODataDispatcher.java     | 132 ++++++------
 .../server/core/ODataExceptionHelper.java       |  14 +-
 .../apache/olingo/server/core/ODataHandler.java |  18 +-
 .../server/core/ODataHandlerException.java      |   6 +-
 .../server/core/ODataHttpHandlerImpl.java       |   8 +-
 .../apache/olingo/server/core/ODataImpl.java    |  10 +-
 .../olingo/server/core/RedirectProcessor.java   |   4 +-
 .../olingo/server/core/ServiceMetadataImpl.java |   8 +-
 .../core/batchhandler/BatchFacadeImpl.java      |   8 +-
 .../server/core/batchhandler/BatchHandler.java  |   4 +-
 .../core/batchhandler/BatchPartHandler.java     |   6 +-
 .../BatchReferenceRewriter.java                 |   4 +-
 .../core/debug/DebugResponseHelperImpl.java     | 118 +++++------
 .../olingo/server/core/debug/DebugTab.java      |   5 +-
 .../olingo/server/core/debug/DebugTabBody.java  |  12 +-
 .../server/core/debug/DebugTabRequest.java      |  28 +--
 .../server/core/debug/DebugTabResponse.java     |  14 +-
 .../server/core/debug/DebugTabRuntime.java      |  34 +--
 .../server/core/debug/DebugTabServer.java       |  14 +-
 .../server/core/debug/DebugTabStacktrace.java   |  24 +--
 .../olingo/server/core/debug/DebugTabUri.java   |  49 +++--
 .../core/debug/ExpressionJsonVisitor.java       |  12 +-
 .../server/core/debug/ServerCoreDebugger.java   |  12 +-
 .../deserializer/DeserializerResultImpl.java    |   4 +-
 .../FixedFormatDeserializerImpl.java            |  10 +-
 .../core/deserializer/batch/BatchBodyPart.java  |   8 +-
 .../deserializer/batch/BatchChangeSetPart.java  |   4 +-
 .../deserializer/batch/BatchLineReader.java     |  44 ++--
 .../core/deserializer/batch/BatchParser.java    |  10 +-
 .../deserializer/batch/BatchParserCommon.java   |  14 +-
 .../core/deserializer/batch/BatchPart.java      |   4 +-
 .../deserializer/batch/BatchQueryOperation.java |   4 +-
 .../batch/BatchRequestTransformator.java        |  20 +-
 .../batch/BatchTransformatorCommon.java         |   8 +-
 .../server/core/deserializer/batch/Header.java  |   4 +-
 .../core/deserializer/batch/HeaderField.java    |   4 +-
 .../batch/HttpRequestStatusLine.java            |   6 +-
 .../server/core/deserializer/batch/Line.java    |   4 +-
 .../deserializer/helper/ExpandTreeBuilder.java  |   4 +-
 .../helper/ExpandTreeBuilderImpl.java           |   4 +-
 .../json/ODataJsonDeserializer.java             | 113 +++++-----
 .../deserializer/xml/ODataXmlDeserializer.java  |  34 +--
 .../olingo/server/core/etag/ETagHelperImpl.java |   8 +-
 .../server/core/etag/ETagInformation.java       |   4 +-
 .../olingo/server/core/etag/ETagParser.java     |  22 +-
 .../core/etag/PreconditionsValidator.java       |  14 +-
 .../olingo/server/core/prefer/PreferParser.java |  40 ++--
 .../server/core/prefer/PreferencesImpl.java     |  13 +-
 .../serializer/AbstractODataSerializer.java     |   7 +-
 .../serializer/AsyncResponseSerializer.java     |  18 +-
 .../serializer/BatchResponseSerializer.java     |  45 ++--
 .../serializer/FixedFormatSerializerImpl.java   |   6 +-
 .../core/serializer/SerializerResultImpl.java   |   4 +-
 .../serializer/json/ODataErrorSerializer.java   |   4 +-
 .../serializer/json/ODataJsonSerializer.java    |  94 ++++-----
 .../json/ServiceDocumentJsonSerializer.java     |  12 +-
 .../serializer/utils/CircleStreamBuffer.java    |   4 +-
 .../serializer/utils/ContentTypeHelper.java     |  16 +-
 .../serializer/utils/ContextURLBuilder.java     |  22 +-
 .../core/serializer/utils/ContextURLHelper.java |  17 +-
 .../serializer/utils/ExpandSelectHelper.java    |   4 +-
 .../xml/MetadataDocumentXmlSerializer.java      |  38 ++--
 .../core/serializer/xml/ODataXmlSerializer.java |  27 +--
 .../xml/ServiceDocumentXmlSerializer.java       |  12 +-
 .../olingo/server/core/uri/UriHelperImpl.java   |   8 +-
 .../olingo/server/core/uri/UriInfoImpl.java     |   4 +-
 .../server/core/uri/UriParameterImpl.java       |   4 +-
 .../server/core/uri/UriResourceActionImpl.java  |   8 +-
 .../uri/UriResourceComplexPropertyImpl.java     |   4 +-
 .../server/core/uri/UriResourceCountImpl.java   |   4 +-
 .../core/uri/UriResourceEntitySetImpl.java      |   6 +-
 .../core/uri/UriResourceFunctionImpl.java       |   6 +-
 .../olingo/server/core/uri/UriResourceImpl.java |   4 +-
 .../server/core/uri/UriResourceItImpl.java      |   4 +-
 .../core/uri/UriResourceLambdaAllImpl.java      |   4 +-
 .../core/uri/UriResourceLambdaAnyImpl.java      |   4 +-
 .../core/uri/UriResourceLambdaVarImpl.java      |   4 +-
 .../uri/UriResourceNavigationPropertyImpl.java  |   4 +-
 .../uri/UriResourcePrimitivePropertyImpl.java   |   4 +-
 .../server/core/uri/UriResourceRefImpl.java     |   4 +-
 .../server/core/uri/UriResourceRootImpl.java    |   4 +-
 .../core/uri/UriResourceSingletonImpl.java      |   4 +-
 .../uri/UriResourceStartingTypeFilterImpl.java  |   4 +-
 .../server/core/uri/UriResourceTypedImpl.java   |   5 +-
 .../server/core/uri/UriResourceValueImpl.java   |   4 +-
 .../core/uri/UriResourceWithKeysImpl.java       |   4 +-
 .../uri/parser/CheckFullContextListener.java    |  60 ++++++
 .../olingo/server/core/uri/parser/Parser.java   |   4 +-
 .../olingo/server/core/uri/parser/RawUri.java   |  46 +++++
 .../server/core/uri/parser/UriDecoder.java      |   4 +-
 .../core/uri/parser/UriParserException.java     |   4 +-
 .../uri/parser/UriParserSemanticException.java  |   8 +-
 .../uri/parser/UriParserSyntaxException.java    |   6 +-
 .../uri/parser/search/SearchBinaryImpl.java     |   7 +-
 .../uri/parser/search/SearchExpressionImpl.java |   4 +-
 .../core/uri/parser/search/SearchParser.java    |  60 +++---
 .../parser/search/SearchParserException.java    |   6 +-
 .../uri/parser/search/SearchQueryToken.java     |   9 +-
 .../core/uri/parser/search/SearchTermImpl.java  |   6 +-
 .../core/uri/parser/search/SearchTokenizer.java | 129 ++++++------
 .../parser/search/SearchTokenizerException.java |   6 +-
 .../core/uri/parser/search/SearchUnaryImpl.java |   6 +-
 .../uri/queryoption/AliasQueryOptionImpl.java   |   4 +-
 .../core/uri/queryoption/CountOptionImpl.java   |   4 +-
 .../uri/queryoption/CustomQueryOptionImpl.java  |   4 +-
 .../core/uri/queryoption/ExpandItemImpl.java    |   8 +-
 .../core/uri/queryoption/ExpandOptionImpl.java  |   4 +-
 .../core/uri/queryoption/FilterOptionImpl.java  |   4 +-
 .../core/uri/queryoption/FormatOptionImpl.java  |   4 +-
 .../core/uri/queryoption/IdOptionImpl.java      |   4 +-
 .../core/uri/queryoption/LevelsOptionImpl.java  |   4 +-
 .../core/uri/queryoption/OrderByItemImpl.java   |   4 +-
 .../core/uri/queryoption/OrderByOptionImpl.java |   4 +-
 .../core/uri/queryoption/QueryOptionImpl.java   |   4 +-
 .../core/uri/queryoption/SearchOptionImpl.java  |   6 +-
 .../core/uri/queryoption/SelectItemImpl.java    |   4 +-
 .../core/uri/queryoption/SelectOptionImpl.java  |   4 +-
 .../core/uri/queryoption/SkipOptionImpl.java    |   4 +-
 .../uri/queryoption/SkipTokenOptionImpl.java    |   4 +-
 .../uri/queryoption/SystemQueryOptionImpl.java  |   4 +-
 .../core/uri/queryoption/TopOptionImpl.java     |   4 +-
 .../uri/queryoption/expression/AliasImpl.java   |   4 +-
 .../uri/queryoption/expression/BinaryImpl.java  |   4 +-
 .../queryoption/expression/EnumerationImpl.java |   4 +-
 .../queryoption/expression/ExpressionImpl.java  |  25 +++
 .../queryoption/expression/LambdaRefImpl.java   |   4 +-
 .../uri/queryoption/expression/LiteralImpl.java |   4 +-
 .../uri/queryoption/expression/MemberImpl.java  |   4 +-
 .../uri/queryoption/expression/MethodImpl.java  |   4 +-
 .../queryoption/expression/TypeLiteralImpl.java |   4 +-
 .../uri/queryoption/expression/UnaryImpl.java   |   4 +-
 .../uri/validator/UriValidationException.java   |   7 +-
 .../server/core/uri/validator/UriValidator.java | 161 ++++++++-------
 .../server/core/ContentNegotiatorTest.java      |   8 +-
 .../olingo/server/core/ExceptionHelperTest.java |   6 +-
 .../server/core/ODataHttpHandlerImplTest.java   |   6 +-
 .../olingo/server/core/ODataImplTest.java       |   4 +-
 .../core/TranslatedExceptionSubclassesTest.java |   4 +-
 .../batchhandler/MockedBatchHandlerTest.java    |   4 +-
 .../server/core/debug/AbstractDebugTabTest.java |   8 +-
 .../server/core/debug/DebugTabBodyTest.java     |   4 +-
 .../server/core/debug/DebugTabRequestTest.java  |   4 +-
 .../server/core/debug/DebugTabResponseTest.java |   4 +-
 .../server/core/debug/DebugTabServerTest.java   |   6 +-
 .../core/debug/ServerCoreDebuggerTest.java      |   6 +-
 .../FixedFormatDeserializerTest.java            |   4 +-
 .../deserializer/batch/BatchLineReaderTest.java |   4 +-
 .../batch/BatchParserCommonTest.java            |   4 +-
 .../batch/BatchRequestParserTest.java           |  16 +-
 .../core/deserializer/batch/HeaderTest.java     |   4 +-
 .../batch/HttpRequestStatusLineTest.java        |   4 +-
 .../json/ODataJsonDeserializerBasicTest.java    |   4 +-
 .../olingo/server/core/etag/ETagHelperTest.java |   4 +-
 .../olingo/server/core/etag/ETagParserTest.java |   4 +-
 .../server/core/prefer/PreferencesTest.java     |   8 +-
 .../serializer/AsyncResponseSerializerTest.java |  18 +-
 .../serializer/BatchResponseSerializerTest.java |  20 +-
 .../serializer/FixedFormatSerializerTest.java   |   4 +-
 .../json/ServerErrorSerializerTest.java         |   8 +-
 .../utils/CircleStreamBufferTest.java           |   5 +-
 .../serializer/utils/ContextURLBuilderTest.java |   4 +-
 .../xml/MetadataDocumentXmlSerializerTest.java  | 205 ++++++++++---------
 .../xml/ServerErrorXmlSerializerTest.java       |  18 +-
 .../xml/ServiceDocumentXmlSerializerTest.java   |  24 +--
 .../search/SearchParserAndTokenizerTest.java    |  88 ++++----
 .../uri/parser/search/SearchParserTest.java     |  17 +-
 .../uri/parser/search/SearchTokenizerTest.java  | 112 +++++-----
 lib/server-tecsvc/pom.xml                       |   2 +-
 lib/server-test/pom.xml                         |   2 +-
 pom.xml                                         |   2 +-
 samples/client/pom.xml                          |   2 +-
 samples/osgi/server/pom.xml                     |   2 +-
 samples/pom.xml                                 |   2 +-
 samples/server/pom.xml                          |   2 +-
 samples/tutorials/p0_all/pom.xml                |   4 +-
 samples/tutorials/p10_media/pom.xml             |   4 +-
 samples/tutorials/p11_batch/pom.xml             |   4 +-
 samples/tutorials/p12_deep_insert/pom.xml       |   4 +-
 .../p12_deep_insert_preparation/pom.xml         |   4 +-
 samples/tutorials/p1_read/pom.xml               |   4 +-
 samples/tutorials/p2_readep/pom.xml             |   4 +-
 samples/tutorials/p3_write/pom.xml              |   4 +-
 samples/tutorials/p4_navigation/pom.xml         |   4 +-
 samples/tutorials/p5_queryoptions-tcs/pom.xml   |   4 +-
 samples/tutorials/p6_queryoptions-es/pom.xml    |   4 +-
 samples/tutorials/p7_queryoptions-o/pom.xml     |   4 +-
 samples/tutorials/p8_queryoptions-f/pom.xml     |   4 +-
 samples/tutorials/p9_action/pom.xml             |   4 +-
 samples/tutorials/p9_action_preparation/pom.xml |   4 +-
 samples/tutorials/pom.xml                       |   2 +-
 374 files changed, 2042 insertions(+), 1851 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
index 3bc5ad0,f1bd75e..b2917f4
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java
@@@ -108,11 -107,11 +108,11 @@@ public class UriHelperImpl implements U
      oDataPath = oDataPath.startsWith("/") ? oDataPath : "/" + oDataPath;
  
      try {
 -      final List<UriResource> uriResourceParts = new Parser().parseUri(oDataPath, null, null, edm)
 -          .getUriResourceParts();
 +      final List<UriResource> uriResourceParts =
 +          new Parser(edm, new ODataImpl()).parseUri(oDataPath, null, null).getUriResourceParts();
        if (uriResourceParts.size() == 1 && uriResourceParts.get(0).getKind() == UriResourceKind.entitySet) {
          final UriResourceEntitySet entityUriResource = (UriResourceEntitySet) uriResourceParts.get(0);
-         
+ 
          return entityUriResource;
        }
  

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
index 7784062,42361e0..433ebb5
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
@@@ -49,9 -46,15 +49,9 @@@ public class UriResourceFunctionImpl ex
    public List<UriParameter> getParameters() {
      return parameters == null ?
          Collections.<UriParameter> emptyList() :
-         Collections.unmodifiableList(parameters);
+           Collections.unmodifiableList(parameters);
    }
  
 -  public UriResourceFunctionImpl setParameters(final List<UriParameter> parameters) {
 -    isParameterListFilled = true;
 -    this.parameters = parameters;
 -    return this;
 -  }
 -
    @Override
    public EdmFunction getFunction() {
      return function;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
index 9930a7e,cdfa013..d44b9e6
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
@@@ -40,10 -40,16 +40,11 @@@ public abstract class UriResourceTypedI
      return this;
    }
  
+   @Override
    public String getSegmentValue(final boolean includeFilters) {
 -    if (includeFilters) {
 -      if (typeFilter != null) {
 -        return getSegmentValue() + "/" + typeFilter.getFullQualifiedName().toString();
 -      } else {
 -        return getSegmentValue();
 -      }
 -    }
 -    return getSegmentValue();
 +    return includeFilters && typeFilter != null ?
 +        getSegmentValue() + "/" + typeFilter.getFullQualifiedName().getFullQualifiedNameAsString() :
 +        getSegmentValue();
    }
  
    @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
index cc31e34,33dd321..8f5aa67
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
@@@ -79,14 -79,12 +79,14 @@@ public class UriParserSemanticExceptio
      /** parameter: not implemented part */
      NOT_IMPLEMENTED,
      /** parameter: namespace **/
-     NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT, 
+     NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT,
      /** parameter: complex parameter value */
-     COMPLEX_PARAMETER_IN_RESOURCE_PATH, 
+     COMPLEX_PARAMETER_IN_RESOURCE_PATH,
      /** parameter: function import name */
 -    FUNCTION_IMPORT_NOT_ALLOWED;
 -
 +    FUNCTION_IMPORT_NOT_ALLOWED, 
 +    /** parameters: left type, right type */
 +    TYPES_NOT_COMPATIBLE;
 +    
      @Override
      public String getKey() {
        return name();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByItemImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
index 3ccd97a,9ffe696..149d1fc
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
@@@ -222,7 -223,14 +222,6 @@@ public class UriValidator 
  
    private RowIndexForUriType rowIndexForResourceKind(final UriInfo uriInfo) throws UriValidationException {
      RowIndexForUriType idx;
 -
 -    final int nonComposableFunctionIndex = getIndexOfLastNonComposableFunction(uriInfo);
 -    if (nonComposableFunctionIndex != -1 && (uriInfo.getUriResourceParts().size() - 1) > nonComposableFunctionIndex) {
 -      throw new UriValidationException("Non composable functions followed by further resource parts are not allowed",
 -          UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH,
 -          uriInfo.getUriResourceParts().get(nonComposableFunctionIndex + 1).getSegmentValue());
 -    }
--
      int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1;
      UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
  

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/010642c5/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
index f3e50a2,40c6200..9bb7d6f
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
@@@ -119,71 -119,71 +119,71 @@@ public class SearchParserAndTokenizerTe
     */
    @Test
    public void searchQueryPhraseAbnfTestcases() throws Exception {
-     //    <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
+     // <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
      assertQuery("\"blue green\"").resultsIn("'blue green'");
-     //    <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
+     // <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
      assertQuery("\"blue green\"").resultsIn("'blue green'");
-     //    <TestCase Name="5.1.7 Search - phrase with escaped double-quote" Rule="queryOptions">
-     //    <Input>$search="blue\"green"</Input>
+     // <TestCase Name="5.1.7 Search - phrase with escaped double-quote" Rule="queryOptions">
+     // <Input>$search="blue\"green"</Input>
      assertQuery("\"blue\\\"green\"").resultsIn("'blue\"green'");
  
-     //    <TestCase Name="5.1.7 Search - phrase with escaped backslash" Rule="queryOptions">
-     //    <Input>$search="blue\\green"</Input>
+     // <TestCase Name="5.1.7 Search - phrase with escaped backslash" Rule="queryOptions">
+     // <Input>$search="blue\\green"</Input>
      assertQuery("\"blue\\\\green\"").resultsIn("'blue\\green'");
-     //    <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="14">
+     // <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="14">
      assertQuery("\"blue\"green\"").resultsIn(SearchParserException.MessageKeys.TOKENIZER_EXCEPTION);
-     //    <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="16">
+     // <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="16">
      assertQuery("\"blue\"green\"").resultsIn(SearchParserException.MessageKeys.TOKENIZER_EXCEPTION);
  
-     //    <TestCase Name="5.1.7 Search - implicit AND" Rule="queryOptions">
-     //    <Input>$search=blue green</Input>
+     // <TestCase Name="5.1.7 Search - implicit AND" Rule="queryOptions">
+     // <Input>$search=blue green</Input>
      assertQuery("blue green").resultsIn("{'blue' AND 'green'}");
-     //    <TestCase Name="5.1.7 Search - implicit AND, encoced" Rule="queryOptions">
+     // <TestCase Name="5.1.7 Search - implicit AND, encoced" Rule="queryOptions">
      assertQuery("blue green").resultsIn("{'blue' AND 'green'}");
  
-     //    <TestCase Name="5.1.7 Search - AND" Rule="queryOptions">
-     //    <Input>$search=blue AND green</Input>
+     // <TestCase Name="5.1.7 Search - AND" Rule="queryOptions">
+     // <Input>$search=blue AND green</Input>
      assertQuery("blue AND green").resultsIn("{'blue' AND 'green'}");
  
-     //    <TestCase Name="5.1.7 Search - OR" Rule="queryOptions">
-     //    <Input>$search=blue OR green</Input>
+     // <TestCase Name="5.1.7 Search - OR" Rule="queryOptions">
+     // <Input>$search=blue OR green</Input>
      assertQuery("blue OR green").resultsIn("{'blue' OR 'green'}");
  
-     //    <TestCase Name="5.1.7 Search - NOT" Rule="queryOptions">
-     //    <Input>$search=blue NOT green</Input>
+     // <TestCase Name="5.1.7 Search - NOT" Rule="queryOptions">
+     // <Input>$search=blue NOT green</Input>
      assertQuery("blue NOT green").resultsIn("{'blue' AND {NOT 'green'}}");
  
-     //    <TestCase Name="5.1.7 Search - only NOT" Rule="queryOptions">
-     //    <Input>$search=NOT blue</Input>
+     // <TestCase Name="5.1.7 Search - only NOT" Rule="queryOptions">
+     // <Input>$search=NOT blue</Input>
      assertQuery("NOT blue").resultsIn("{NOT 'blue'}");
  
-     //    <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
-     //    <Input>$search=foo AND bar OR foo AND baz OR that AND bar OR that AND baz</Input>
+     // <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
+     // <Input>$search=foo AND bar OR foo AND baz OR that AND bar OR that AND baz</Input>
      assertQuery("foo AND bar OR foo AND baz OR that AND bar OR that AND baz")
 -    .resultsIn("{{{{'foo' AND 'bar'} OR {'foo' AND 'baz'}} OR {'that' AND 'bar'}} OR {'that' AND 'baz'}}");
 +        .resultsIn("{{{{'foo' AND 'bar'} OR {'foo' AND 'baz'}} OR {'that' AND 'bar'}} OR {'that' AND 'baz'}}");
  
-     //    <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
-     //    <Input>$search=(foo OR that) AND (bar OR baz)</Input>
+     // <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
+     // <Input>$search=(foo OR that) AND (bar OR baz)</Input>
      assertQuery("(foo OR that) AND (bar OR baz)").resultsIn("{{'foo' OR 'that'} AND {'bar' OR 'baz'}}");
  
-     //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-     //    <Input>$search=foo AND (bar OR baz)</Input>
+     // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+     // <Input>$search=foo AND (bar OR baz)</Input>
      assertQuery("foo AND (bar OR baz)").resultsIn("{'foo' AND {'bar' OR 'baz'}}");
  
-     //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-     //    <Input>$search=(foo AND bar) OR baz</Input>
+     // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+     // <Input>$search=(foo AND bar) OR baz</Input>
      assertQuery("(foo AND bar) OR baz").resultsIn("{{'foo' AND 'bar'} OR 'baz'}");
  
-     //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-     //    <Input>$search=(NOT foo) OR baz</Input>
+     // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+     // <Input>$search=(NOT foo) OR baz</Input>
      assertQuery("(NOT foo) OR baz").resultsIn("{{NOT 'foo'} OR 'baz'}");
  
-     //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-     //    <Input>$search=(NOT foo)</Input>
+     // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+     // <Input>$search=(NOT foo)</Input>
      assertQuery("(NOT foo)").resultsIn("{NOT 'foo'}");
  
-     //    <TestCase Name="5.1.7 Search - on entity set" Rule="odataUri">
-     //    <Input>http://serviceRoot/Products?$search=blue</Input>
+     // <TestCase Name="5.1.7 Search - on entity set" Rule="odataUri">
+     // <Input>http://serviceRoot/Products?$search=blue</Input>
      assertQuery("blue").resultsIn("'blue'");
  
      // below cases can not be tested here
@@@ -198,13 -198,19 +198,19 @@@
    }
  
    private static class Validator {
 -    private boolean log;
      private final String searchQuery;
  
-     private Validator(String searchQuery) {
+     private Validator(final String searchQuery) {
        this.searchQuery = searchQuery;
      }
  
-     private void resultsIn(SearchParserException.MessageKey key) throws SearchTokenizerException {
+     private static Validator init(final String searchQuery) {
+       return new Validator(searchQuery);
+     }
+ 
+     private void resultsIn(final SearchParserException.MessageKey key)
+         throws SearchTokenizerException {
++
        try {
          resultsIn(searchQuery);
        } catch (SearchParserException e) {


[25/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] Delete AntLR dependecies

Posted by mi...@apache.org.
[OLINGO-834] Delete AntLR dependecies


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 26080f420ac48ce8a3d60a6372226ee4f2f4aab8
Parents: 010642c
Author: Christian Amend <ch...@sap.com>
Authored: Thu Jan 7 15:00:17 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Thu Jan 7 15:00:17 2016 +0100

----------------------------------------------------------------------
 lib/server-core-ext/pom.xml                     |   4 -
 lib/server-core/pom.xml                         |  40 --
 .../olingo/server/core/uri/antlr/UriLexer.g4    | 424 ------------------
 .../olingo/server/core/uri/antlr/UriParser.g4   | 447 -------------------
 .../uri/parser/CheckFullContextListener.java    |  60 ---
 lib/server-test/pom.xml                         |   4 -
 pom.xml                                         |  14 -
 7 files changed, 993 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26080f42/lib/server-core-ext/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/pom.xml b/lib/server-core-ext/pom.xml
index e15dc1a..af286c0 100644
--- a/lib/server-core-ext/pom.xml
+++ b/lib/server-core-ext/pom.xml
@@ -50,10 +50,6 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.antlr</groupId>
-      <artifactId>antlr4-runtime</artifactId>
-    </dependency>
-    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>javax.servlet-api</artifactId>
       <version>3.0.1</version>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26080f42/lib/server-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml
index 8b18338..6e22690 100644
--- a/lib/server-core/pom.xml
+++ b/lib/server-core/pom.xml
@@ -46,10 +46,6 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.antlr</groupId>
-      <artifactId>antlr4-runtime</artifactId>
-    </dependency>
-    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <version>2.5</version>
@@ -85,42 +81,6 @@
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-            <configuration>
-              <sources>
-                <source>target/generated-sources/antlr4</source>
-              </sources>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.antlr</groupId>
-        <artifactId>antlr4-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>antlr4</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <!--<arguments><argument>-atn</argument></arguments> -->
-          <listener>true</listener>
-          <visitor>true</visitor>
-          <!--maven antlr plugin has trouble with grammer import if the grammerfiles
-            are not directly inside src/main/antlr4, hence we have to set the libDirectory -->
-          <libDirectory>src/main/antlr4/org/apache/olingo/server/core/uri/antlr</libDirectory>
-        </configuration>
-      </plugin>
-      <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
     		<version>${maven.bundle.plugin.version}</version>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26080f42/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4 b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4
deleted file mode 100644
index 7a54ab1..0000000
--- a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4
+++ /dev/null
@@ -1,424 +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.
- ******************************************************************************/
-lexer grammar UriLexer;
-
-//;==============================================================================
-// Mode "DEFAULT_MODE": Processes everything before the first '?' char.
-// On '?' the next mode "MODE_QUERY" is used.
-// The percent encoding rules are defined in RFC3986; ABNF rule "path-rootless" applies.
-//;==============================================================================
-QM              : '?'                 ->        pushMode(MODE_QUERY);               //first query parameter
-AMP             : '&'                 ->        pushMode(MODE_QUERY);               //more query parameters
-STRING          : '\''                -> more,  pushMode(MODE_STRING) ;              //reads up to next single '
-QUOTATION_MARK  : '\u0022'            -> more,  pushMode(MODE_JSON_STRING);         //reads up to next unescaped "
-SEARCH_INLINE   : '$search'           ->        pushMode(MODE_SYSTEM_QUERY_SEARCH); //
-FRAGMENT        : '#'                 ->        pushMode(MODE_FRAGMENT);            //
-STRING_JSON		: '"'				  -> more,  pushMode(MODE_JSON_STRING);			//reads up to next unescaped "
-
-GEOGRAPHY    : G E O G R A P H Y SQUOTE         -> pushMode(MODE_ODATA_GEO); //TODO make case insensitive
-GEOMETRY     : G E O M E T R Y   SQUOTE         -> pushMode(MODE_ODATA_GEO);
-
-//Letters for case insensitivity
-fragment A    : 'A'|'a';
-fragment B    : 'B'|'b';
-fragment D    : 'D'|'d';
-fragment E    : 'E'|'e';
-fragment F    : 'F'|'f';
-fragment G    : 'G'|'g';
-fragment H    : 'H'|'h';
-fragment I    : 'I'|'i';
-fragment L    : 'L'|'l';
-fragment M    : 'M'|'m';
-fragment N    : 'N'|'n';
-fragment O    : 'O'|'o';
-fragment P    : 'P'|'p';
-fragment R    : 'R'|'r';
-fragment S    : 'S'|'s';
-fragment T    : 'T'|'t';
-fragment U    : 'U'|'u';
-fragment Y    : 'Y'|'y';
-fragment Z    : 'Z'|'z';
-
-//special chars
-OPEN            : '(';
-CLOSE           : ')';
-COMMA           : ',';
-SLASH           : '/';
-POINT           : '.';
-AT              : '@';
-EQ              : '=' ;
-STAR            : '*';
-SEMI            : ';';
-COLON           : ':';
-
-EQ_sq           : '='           -> type(EQ);
-AMP_sq          : '&'           -> type(AMP), popMode;
-fragment WS     : ( ' ' | '\u0009' );
-WSP             : WS+;
-
-//JSON support 
-BEGIN_OBJECT    : WS* '{' WS*;
-END_OBJECT      : WS* '}' WS*;
-
-BEGIN_ARRAY     : WS* '[' WS*;
-END_ARRAY       : WS* ']' WS*;
-
-
-//alpha stuff
-fragment ALPHA                : 'a'..'z' | 'A'..'Z';
-fragment ALPHA_A_TO_F         : 'a'..'f' | 'A'..'F';
-fragment DIGIT                : '0'..'9';
-fragment DIGITS               : DIGIT+;
-fragment HEXDIG               : DIGIT | ALPHA_A_TO_F;
-fragment ODI_LEADINGCHARACTER : ALPHA | '_';            //TODO; add Unicode characters from the categories L or Nl
-fragment ODI_CHARACTER        : ALPHA | '_' | DIGIT;    //TODO; add Unicode characters from the categories L, Nl, Nd, Mn, Mc, Pc, or Cf
-
-//helper for date/time values
-fragment ONE_TO_NINE        : '1'..'9';
-fragment ZERO_TO_FIFTYNINE  : ('0'..'5') DIGIT;
-fragment FRACTIONALSECONDS  : DIGIT+;
-fragment SECOND             : ZERO_TO_FIFTYNINE;
-fragment MINUTE             : ZERO_TO_FIFTYNINE;
-fragment HOUR               : ('0' | '1') DIGIT | '2' ( '0'..'3');
-fragment DAY                : '0' '1'..'9' | ('1'|'2') DIGIT | '3' ('0'|'1');
-fragment MONTH              : '0' ONE_TO_NINE | '1' ( '0' | '1' | '2' );
-fragment YEAR               : ('-')? ( '0' DIGIT DIGIT DIGIT | ONE_TO_NINE DIGIT DIGIT DIGIT );
-
-//tags starting with $ 
-BATCH         : '$batch';
-ENTITY        : '$entity';
-METADATA      : '$metadata';
-
-ALL           : '$all';
-CROSSJOIN     : '$crossjoin';
-
-VALUE         : '$value';
-REF           : '$ref';
-COUNT         : '$count';
-
-//inlined query parameters ( e.g. $skip)
-TOP_I     : '$top'    -> type(TOP);
-SKIP_QO_I : '$skip'   -> type(SKIP_QO);
-FILTER_I  : '$filter' -> type(FILTER);
-ORDERBY_I : '$orderby'-> type(ORDERBY);
-SELECT_I  : '$select' -> type(SELECT);
-EXPAND_I  : '$expand' -> type(EXPAND);
-LEVELS_I  : '$levels' -> type(LEVELS);
-MAX: 'max';
-
-ROOT            : '$root/';
-
-//rest
-NULLVALUE     : 'null';
-
-TRUE          : 'true';
-FALSE         : 'false';
-BOOLEAN       :  T R U E |  F A L S E; 
-PLUS          : '+';
-
-MINUS         : '-';
-SIGN          : PLUS  | '-';
-INT           : SIGN? DIGITS;
-DECIMAL       : INT '.' DIGITS (('e'|'E') SIGN?  DIGITS)?;
-NANINFINITY   : 'NaN' | '-INF' | 'INF';
-//primary types
-BINARY                      : B I N A R Y SQUOTE (HEXDIG HEXDIG)* SQUOTE; 
-DATE                        : YEAR '-' MONTH '-' DAY;
-DATETIMEOFFSET              : YEAR '-' MONTH '-' DAY T HOUR ':' MINUTE ( ':' SECOND ( '.' FRACTIONALSECONDS )? )? ( Z | SIGN HOUR ':' MINUTE );
-fragment DUSECONDFRAG       : DIGITS ('.' DIGITS)? 'S';
-fragment DUTIMEFRAG         : 'T' (   
-                              ( DIGITS 'H' (DIGITS 'M')? DUSECONDFRAG?) 
-                              | (DIGITS 'M' DUSECONDFRAG?) 
-                              | DUSECONDFRAG
-                            )?;
-fragment DUDAYTIMEFRAG      : DIGITS 'D' DUTIMEFRAG? | DUTIMEFRAG;
-DURATION                    : D U R A T I O N SQUOTE '-'? 'P' DUDAYTIMEFRAG SQUOTE;
-TIMEOFDAY                   : HOUR ':' MINUTE ( ':' SECOND ( '.' FRACTIONALSECONDS )? )?;
-fragment GUIDVALUE          : HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG'-' 
-                              HEXDIG HEXDIG HEXDIG HEXDIG  '-' 
-                              HEXDIG HEXDIG HEXDIG HEXDIG  '-' 
-                              HEXDIG HEXDIG HEXDIG HEXDIG  '-' 
-                              HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG;
-GUID                        : GUIDVALUE;
-
-//expression tokens
-ASC             : 'asc'; 
-DESC            : 'desc';
-MUL             : 'mul';
-DIV             : 'div';
-MOD             : 'mod';
-HAS             : 'has';
-
-ADD             : 'add';
-SUB             : 'sub';
-
-ANY_LAMDA       : 'any';
-ALL_LAMDA       : 'all';
-
-GT              : 'gt';
-GE              : 'ge';
-LT              : 'lt';
-LE              : 'le';
-ISOF            : 'isof';
-
-EQ_ALPHA        : 'eq';
-NE              : 'ne';
-
-AND             : 'and';
-OR              : 'or';
-
-
-NOT             : 'not';
-
-
-IT  : '$it';
-ITSLASH  : '$it/';
-LEVELS : '$levels';
-
-CONTAINS_WORD             : 'contains(';
-STARTSWITH_WORD           : 'startswith(';
-ENDSWITH_WORD             : 'endswith(';
-LENGTH_WORD               : 'length(';
-INDEXOF_WORD              : 'indexof(';
-SUBSTRING_WORD            : 'substring(';
-TOLOWER_WORD              : 'tolower(';
-TOUPPER_WORD              : 'toupper(';
-TRIM_WORD                 : 'trim(';
-CONCAT_WORD               : 'concat(';
-YEAR_WORD                 : 'year(';
-MONTH_WORD                : 'month(';
-DAY_WORD                  : 'day(';
-HOUR_WORD                 : 'hour(';
-MINUTE_WORD               : 'minute(';
-SECOND_WORD               : 'second(';
-FRACTIONALSECONDS_WORD    : 'fractionalseconds(';
-TOTALSECONDS_WORD         : 'totalseconds(';
-DATE_WORD                 : 'date(';
-TIME_WORD                 : 'time(';
-TOTALOFFSETMINUTES_WORD   : 'totaloffsetminutes(';
-
-MINDATETIME_WORD          : 'mindatetime(';
-MAXDATETIME_WORD          : 'maxdatetime(';
-NOW_WORD                  : 'now(';
-
-ROUND_WORD                : 'round(';
-FLOOR_WORD                : 'floor(';
-CEILING_WORD              : 'ceiling(';
-
-GEO_DISTANCE_WORD         : 'geo.distance(';
-GEO_LENGTH_WORD           : 'geo.length(';
-GEO_INTERSECTS_WORD       : 'geo.intersects(';
-ISOF_WORD                 : 'isof(';
-CAST_WORD                 : 'cast(';
-
-COLLECTION_REF            : 'Collection($ref)';
-COLLECTION_ENTITY_TYPE    : 'Collection(Edm.EntityType)';
-COLLECTION_COMPLEX_TYPE   : 'Collection(Edm.ComplexType)';
-COLLECTION                : 'Collection(' -> type(COLLECTION);
-
-//used in fragment only
-DELETED_ENTITY            : '$deletedEntity';
-LINK                      : '$link';
-DELETED_LINK              : '$deletedLink';
-DELTA                     : '$delta';
-
-ODATAIDENTIFIER : ODI_LEADINGCHARACTER (ODI_CHARACTER)*;
-
-//handle characters that failed to match any other token
-ERROR_CHARACTER : .;
-
-//;==============================================================================
-// Mode "QUERY": Processes everything between the first '?' and the '#' char.
-// On '?' the next mode "FRAGMENT" is used.
-// The percent encoding rules are defined in RFC3986; ABNF rule "query" applies.
-mode MODE_QUERY;
-//;==============================================================================
-
-FRAGMENT_q          : '#'           -> type(FRAGMENT);
-FILTER              : '$filter'     ->                    pushMode(DEFAULT_MODE);
-ORDERBY             : '$orderby'    ->                    pushMode(DEFAULT_MODE);
-EXPAND              : '$expand'     ->                    pushMode(DEFAULT_MODE);
-SELECT              : '$select'     ->                    pushMode(DEFAULT_MODE);
-SKIP_QO             : '$skip'       ->                    pushMode(DEFAULT_MODE);
-SKIPTOKEN           : '$skiptoken'  ->                    pushMode(MODE_SYSTEM_QUERY_REST);
-TOP                 : '$top'        ->                    pushMode(DEFAULT_MODE);
-LEVELS_q            : '$levels'     -> type(LEVELS),      pushMode(DEFAULT_MODE);
-FORMAT              : '$format'     ->                    pushMode(MODE_SYSTEM_QUERY_PCHAR);
-COUNT_q             : '$count'      -> type(COUNT),       pushMode(DEFAULT_MODE);
-REF_q               : '$ref'        -> type(REF);
-VALUE_q             : '$value'      -> type(VALUE);
-ID                  : '$id'         ->                    pushMode(MODE_SYSTEM_QUERY_REST);
-SEARCH              : '$search'     ->                    pushMode(MODE_SYSTEM_QUERY_SEARCH);
-
-EQ_q          : '=' -> type(EQ);
-AMP_q         : '&' -> type(AMP);
-
-AT_Q          : '@' -> pushMode(DEFAULT_MODE);
-
-CUSTOMNAME    : ~[&=@$] ~[&=]* -> pushMode(MODE_SYSTEM_QUERY_REST);
-
-//handle characters that failed to match any other token
-ERROR_CHARACTER_q : .;
-
-//;==============================================================================
-mode MODE_SYSTEM_QUERY_PCHAR;
-//;==============================================================================
-
-AMP_sqp   : '&' -> type(AMP),       popMode;
-
-fragment ALPHA_sqp          : 'a'..'z'|'A'..'Z';
-fragment A_TO_F_sqp         : 'a'..'f'|'A'..'F';
-fragment DIGIT_sqp          : '0'..'9';
-fragment HEXDIG_sqp         : DIGIT_sqp | A_TO_F_sqp;
-fragment PCT_ENCODED_sqp    : '%' HEXDIG_sqp HEXDIG_sqp;
-fragment SUB_DELIMS_sqp     : '$' | /*'&' |*/ '\'' | EQ_sqp | OTHER_DELIMS_sqp;
-fragment OTHER_DELIMS_sqp   : '!' | '(' | ')' | '*' | '+' | ',' | ';';
-fragment UNRESERVED_sqp     : ALPHA_sqp | DIGIT_sqp | '-' |'.' | '_' | '~'; 
-fragment PCHAR              : UNRESERVED_sqp | PCT_ENCODED_sqp | SUB_DELIMS_sqp | ':' | '@'; 
-fragment PCHARSTART         : UNRESERVED_sqp | PCT_ENCODED_sqp | '$' | /*'&' |*/ '\'' | OTHER_DELIMS_sqp | ':' | '@'; 
-
-ATOM : [Aa][Tt][Oo][Mm];
-JSON : [Jj][Ss][Oo][Nn];
-XML  : [Xx][Mm][Ll];
-
-PCHARS : PCHARSTART PCHAR*;
-
-SLASH_sqp : '/' -> type(SLASH);
-EQ_sqp    : '=' -> type(EQ);
-FRAGMENT_sqp  : '#'     -> type(FRAGMENT),  pushMode(MODE_FRAGMENT);
-
-//handle characters that failed to match any other token
-ERROR_CHARACTER_sqp : .;
-
-//;==============================================================================
-mode MODE_FRAGMENT;
-// Read the remaining characters of a URI queryparameter up to an & or # 
-// character.
-//;==============================================================================
-
-REST_F          	: ~('\r'|'\n')* -> type(REST),  popMode;
-
-//;==============================================================================
-mode MODE_SYSTEM_QUERY_REST;
-// Read the remaining characters of a URI queryparameter up to an & or # 
-// character.
-//;==============================================================================
-
-AMP_sqr       			: '&'     -> type(AMP),       popMode;
-FRAGMENT_sqr  			: '#'     -> type(FRAGMENT),  popMode;
-
-EQ_sqr        		 	: '='     -> type(EQ);
-REST          		 	: ~[&#=] ~[&#]*;
-ERROR_CHARACTER_sqmr 	: .;
-
-//;==============================================================================
-mode MODE_SYSTEM_QUERY_SEARCH;
-//;==============================================================================
-
-NOT_sqc             	: 'NOT'   -> type(NOT);
-AND_sqc             	: 'AND'   -> type(AND);
-OR_sqc              	: 'OR'    -> type(OR);
-EQ_sqc              	: '='     -> type(EQ);
-
-fragment WS_sqc     	: ( ' ' | '\u0009');
-WSP_sqc             	: WS_sqc+ -> type(WSP);
-
-QUOTATION_MARK_sqc  	: '\u0022';
-
-SEARCHWORD          	: ('a'..'z'|'A'..'Z')+;
-SEARCHPHRASE        	: QUOTATION_MARK_sqc ~["]* QUOTATION_MARK_sqc;
-
-// Follow Set
-CLOSE_qs            	: ')' -> popMode, type(CLOSE);   
-SEMI_qs             	: ';' -> popMode, type(SEMI);   
-AMP_qs              	: '&' -> popMode, type(AMP);
-ERROR_CHARACTER_sqms	: .;
-
-//;==============================================================================
-mode MODE_STRING;
-// Reads the remaining characters up to an ' character.
-// Any "'" characters inside a string are expressed as double "''".
-//;==============================================================================
-
-STRING_s            	: ('\'\'' | ~[\u0027] )* '\'' -> type(STRING), popMode;
-ERROR_CHARACTER_sm		: EOF | .;
-
-//;==============================================================================
-mode MODE_JSON_STRING;
-// Reads the remaining characters up to an " character.
-// Any """ characters inside a string are escaped with "\".
-//;==============================================================================
-
-STRING_IN_JSON				: (ESCAPED_JSON_CHAR | ~["\\])* '"' -> popMode;
-fragment ESCAPED_JSON_CHAR	: '\\' (["\\/bfnrt] | UNICODE_CHAR);
-fragment UNICODE_CHAR 		: 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-fragment HEX_DIGIT			: [0-9a-fA-F];
-ERROR_CHARACTER_jsm			: EOF | .;
-
-//;==============================================================================
-mode MODE_ODATA_GEO;
-//;==============================================================================
-
-fragment C_  : 'c'|'C';
-fragment D_  : 'd'|'D';
-fragment E_  : 'e'|'E';
-fragment G_  : 'g'|'G';
-fragment H_  : 'h'|'H';
-fragment I_  : 'i'|'I';
-fragment L_  : 'l'|'L';
-fragment M_  : 'm'|'M';
-fragment N_  : 'n'|'N';
-fragment O_  : 'o'|'O';
-fragment P_  : 'p'|'P';
-fragment R_  : 'r'|'R';
-fragment S_  : 's'|'S';
-fragment T_  : 't'|'T';
-fragment U_  : 'u'|'U';
-fragment Y_  : 'y'|'Y';
-
-fragment SP_g   : ' ';                  //'\u0020'; // a simple space
-fragment WS_g   : ( ' ' | '\u0009' );
-
-OPEN_g          : '('   -> type(OPEN);
-CLOSE_g         : ')'   -> type(CLOSE);
-COMMA_g         : ','   -> type(COMMA);
-WSP_g           : WS_g+ -> type(WSP);
-POINT_g         : '.'   -> type(POINT);
-AT_g            : '@'   -> type(AT);
-SEMI_g          : ';'   -> type(SEMI);
-EQ_g            : '='   -> type(EQ);
-
-fragment DIGIT_g    : '0'..'9';
-fragment DIGITS_g   : DIGIT_g+;
-SIGN_g              : ('+' | '-') -> type(SIGN);
-INT_g               : SIGN_g? DIGITS_g -> type(INT);
-DECIMAL_g           : 'SS' INT_g '.' DIGITS_g (('e'|'E') SIGN_g?  DIGITS_g)? -> type(DECIMAL);
-COLLECTION_g        : C_ O_ L_ L_ E_ C_ T_ I_ O_ N_ -> type(COLLECTION);
-LINESTRING          : L_ I_ N_ E_ S_ T_ R_ I_ N_ G_ ;
-MULTILINESTRING     : M_ U_ L_ T_ I_ L_ I_ N_ E_ S_ T_ R_ I_ N_ G_;
-MULTIPOINT          : M_ U_ L_ T_ I_ P_ O_ I_ N_ T_ ;
-MULTIPOLYGON        : M_ U_ L_ T_ I_ P_ O_ L_ Y_ G_ O_ N_;
-GEO_POINT           : P_ O_ I_ N_ T_;
-POLYGON             : P_ O_ L_ Y_ G_ O_ N_ ;
-
-SRID                : S_ R_ I_ D_;
-
-SQUOTE              : '\''  -> popMode;
-
-ERROR_CHARACTER_g	: .;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26080f42/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4 b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4
deleted file mode 100644
index 5a24b29..0000000
--- a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4
+++ /dev/null
@@ -1,447 +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.
- ******************************************************************************/
-
-grammar UriParser;
-
-//------------------------------------------------------------------------------
-// This grammar refers to the "odata-abnf-construction-rules.txt" Revision 517.
-// URL: https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/ABNF/odata-abnf-construction-rules.txt?rev=517
-
-// While contructing this grammar we tried to keep it close to the ABNF.
-// However this is not really possible in order to support
-// - percent decoding
-// - operator precedence
-// - having a context free grammar ( without java snipplets to add context)
-// - generating the parser in different target languages
-// Currently not supported are 
-// - $search
-// - geometry data
-// - json data in url
-//------------------------------------------------------------------------------
-
-
-options {
-    language   = Java;
-    tokenVocab = UriLexer;
-}
-
-//;------------------------------------------------------------------------------
-//; 0. URI
-//;------------------------------------------------------------------------------
-
-batchEOF            : BATCH EOF;
-
-entityEOF           : vNS=namespace vODI=odataIdentifier;
-
-metadataEOF         : METADATA EOF;
-
-//;------------------------------------------------------------------------------
-//; 1. Resource Path
-//;------------------------------------------------------------------------------
-
-//resourcePathEOF     : vlPS=pathSegments EOF;
-
-crossjoinEOF        : CROSSJOIN OPEN WSP? vlODI+=odataIdentifier WSP? ( COMMA WSP? vlODI+=odataIdentifier  WSP?)* CLOSE EOF;
-
-allEOF              : ALL;
-
-pathSegmentEOF      : (pathSegment | constSegment) EOF;
-
-pathSegments        : vlPS+=pathSegment (SLASH vlPS+=pathSegment)* (SLASH vCS=constSegment)?;
-
-pathSegment         : vNS=namespace? vODI=odataIdentifier vlNVO+=nameValueOptList*;
-
-nameValueOptList    : OPEN (vVO=commonExpr | vNVL=nameValueList)? CLOSE;
-nameValueList       : WSP* vlNVP+=nameValuePair WSP* ( COMMA WSP* vlNVP+=nameValuePair  WSP*)* ;
-nameValuePair       : vODI=odataIdentifier EQ (AT vALI=odataIdentifier | vCOM=commonExpr /*TODO | val2=enumX*/);
-
-constSegment        : (vV=value | vC=count | vR=ref | vAll=allExpr | vAny=anyExpr);
-
-count               : COUNT;
-ref                 : REF;
-value               : VALUE;
-
-//;------------------------------------------------------------------------------
-//; 2. Query Options
-//;------------------------------------------------------------------------------
-
-queryOptions        : vlQO+=queryOption ( AMP vlQO+=queryOption )*;//TODO can this be removed
-
-queryOption         : systemQueryOption; 
-
-systemQueryOption   : expand
-                    | filter 
-                    | inlinecount 
-                    | orderBy
-                    | search
-                    | select 
-                    | skip 
-                    | skiptoken
-                    | top
-                    ;
-
-skiptoken           : SKIPTOKEN EQ REST;
-expand              : EXPAND EQ expandItems;
-
-expandItemsEOF      : expandItems EOF;
-expandItems         : vlEI+=expandItem ( COMMA vlEI+=expandItem )*; 
-
-
-expandItem          : vS=STAR ( SLASH vR=ref | OPEN LEVELS EQ ( vL=INT | vM=MAX)  CLOSE )?
-                    | vEP=expandPath vEPE=expandPathExtension?;
-
-
-expandPath          : vlPS+=pathSegment (SLASH vlPS+=pathSegment)*;
-
-expandPathExtension : OPEN vlEO+=expandOption                        ( SEMI vlEO+=expandOption       )* CLOSE 
-                    | SLASH vR=ref   ( OPEN vlEOR+=expandRefOption   ( SEMI vlEOR+=expandRefOption   )* CLOSE )?
-                    | SLASH vC=count ( OPEN vlEOC+=expandCountOption ( SEMI vlEOC+=expandCountOption )* CLOSE )?
-                    ;  
-
-expandCountOption   : filter
-                    | searchInline
-                    ;
-
-expandRefOption     : expandCountOption
-                    | orderBy
-                    | skip
-                    | top 
-                    | inlinecount
-                    ;
-
-expandOption        : expandRefOption
-                    | select 
-                    | expand
-                    | levels;
-
-levels              : LEVELS EQ ( INT | MAX );
-
-filter              : FILTER EQ commonExpr;
-
-filterExpressionEOF : commonExpr EOF;
-
-orderBy             : ORDERBY EQ orderList;
-
-orderByEOF          : orderList EOF;
-
-orderList           : vlOI+=orderByItem ( WSP* COMMA WSP* vlOI+=orderByItem )*;
-
-orderByItem         : vC=commonExpr ( WSP ( vA=ASC | vD=DESC ) )?;
-
-skip                : SKIP_QO EQ INT;
-top                 : TOP EQ INT;
-//format              : FORMAT EQ ( ATOM | JSON | XML | PCHARS SLASH PCHARS);
-
-inlinecount         : COUNT EQ booleanNonCaseLiteral;
-
-search              : SEARCH searchSpecialToken;
-searchInline        : SEARCH_INLINE searchSpecialToken;
-
-searchSpecialToken  : EQ WSP? searchExpr;
-
-searchExpr          : (NOT WSP) searchExpr
-                    | searchExpr searchExpr
-                    | searchExpr  WSP searchExpr
-                    | searchExpr ( WSP AND WSP) searchExpr
-                    | searchExpr ( WSP OR WSP) searchExpr
-                    | searchPhrase
-                    | searchWord
-                    ;
-
-searchPhrase        : SEARCHPHRASE;
-searchWord          : SEARCHWORD;  
-
-select              : SELECT EQ vlSI+=selectItem ( COMMA vlSI+=selectItem )*;
-selectEOF           : vlSI+=selectItem ( COMMA vlSI+=selectItem )*;
-
-selectItem          : vlSS+=selectSegment ( SLASH vlSS+=selectSegment ) *;
-selectSegment       : vNS=namespace? ( vODI=odataIdentifier | vS=STAR );
-
-aliasAndValue       : vODI=ODATAIDENTIFIER EQ vV=parameterValue;
-
-parameterValue      : commonExpr  //TODO json not supported arrayOrObject
-                    ;
-
-//;------------------------------------------------------------------------------
-//; 3. Context URL Fragments
-//;------------------------------------------------------------------------------
-
-contextFragment     : REST; // the context fragment is only required on the client side
-
-//;------------------------------------------------------------------------------
-//; 4. Expressions
-//;------------------------------------------------------------------------------
-
-commonExpr          : OPEN commonExpr CLOSE                                                             #altPharenthesis
-                    | vE1=commonExpr (WSP HAS WSP) vE2=commonExpr                                       #altHas
-                    | methodCallExpr                                                                    #altMethod
-                    | ( unary WSP? ) commonExpr                                                         #altUnary
-                    | anyExpr                                                                           #altAny
-                    | allExpr                                                                           #altAll
-                    | memberExpr                                                                        #altMember
-                    | vE1=commonExpr (WSP vO=MUL WSP | WSP vO=DIV WSP | WSP vO=MOD WSP ) vE2=commonExpr #altMult
-                    | vE1=commonExpr (WSP vO=ADD WSP | WSP vO=SUB WSP) vE2=commonExpr                   #altAdd
-                    | vE1=commonExpr (WSP vO=GT WSP | WSP vO=GE WSP | WSP vO=LT WSP 
-                                     | WSP vO=LE WSP ) vE2=commonExpr                                   #altComparism
-                    | vE1=commonExpr (WSP vO=EQ_ALPHA WSP | WSP vO=NE WSP) vE2=commonExpr               #altEquality
-                    | vE1=commonExpr (WSP AND WSP) vE2=commonExpr                                       #altAnd
-                    | vE1=commonExpr (WSP OR WSP) vE2=commonExpr                                        #altOr
-                    | rootExpr                                                                          #altRoot     // $...
-                    | AT odataIdentifier                                                                #altAlias    // @...
-                    | primitiveLiteral                                                                  #altLiteral  // ...
-                    | arrayOrObject																		#altJson
-                    ;
-
-unary               : (MINUS| NOT) ;
-
-rootExpr            : ROOT vPs=pathSegments;
-
-memberExpr          :  vIt=IT ( SLASH (vANY=anyExpr | vALL=allExpr))?
-                    |  vIts=ITSLASH? vPs=pathSegments ( SLASH (vANY=anyExpr | vALL=allExpr))?;
-
-anyExpr             : ANY_LAMDA OPEN WSP? ( vLV=odataIdentifier WSP? COLON WSP? vLE=commonExpr WSP? )? CLOSE;
-allExpr             : ALL_LAMDA OPEN WSP?   vLV=odataIdentifier WSP? COLON WSP? vLE=commonExpr WSP? CLOSE;
-
-methodCallExpr      : indexOfMethodCallExpr
-                    | toLowerMethodCallExpr
-                    | toUpperMethodCallExpr
-                    | trimMethodCallExpr
-                    | substringMethodCallExpr
-                    | concatMethodCallExpr
-                    | lengthMethodCallExpr
-                    | yearMethodCallExpr
-                    | monthMethodCallExpr
-                    | dayMethodCallExpr
-                    | hourMethodCallExpr
-                    | minuteMethodCallExpr
-                    | secondMethodCallExpr
-                    | fractionalsecondsMethodCallExpr
-                    | totalsecondsMethodCallExpr
-                    | dateMethodCallExpr
-                    | timeMethodCallExpr
-                    | roundMethodCallExpr
-                    | floorMethodCallExpr
-                    | ceilingMethodCallExpr
-                    | geoDistanceMethodCallExpr
-                    | geoLengthMethodCallExpr
-                    | totalOffsetMinutesMethodCallExpr
-                    | minDateTimeMethodCallExpr
-                    | maxDateTimeMethodCallExpr
-                    | nowMethodCallExpr
-                    //from boolean
-                    | isofExpr
-                    | castExpr
-                    | endsWithMethodCallExpr
-                    | startsWithMethodCallExpr
-                    | containsMethodCallExpr
-                    | geoIntersectsMethodCallExpr
-                    ;
-
-
-containsMethodCallExpr    : CONTAINS_WORD    WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-startsWithMethodCallExpr  : STARTSWITH_WORD  WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-endsWithMethodCallExpr    : ENDSWITH_WORD    WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-lengthMethodCallExpr      : LENGTH_WORD      WSP? vE1=commonExpr WSP? CLOSE;
-indexOfMethodCallExpr     : INDEXOF_WORD     WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-substringMethodCallExpr   : SUBSTRING_WORD   WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? ( COMMA WSP? vE3=commonExpr WSP? )? CLOSE;
-toLowerMethodCallExpr     : TOLOWER_WORD     WSP? vE1=commonExpr WSP? CLOSE;
-toUpperMethodCallExpr     : TOUPPER_WORD     WSP? vE1=commonExpr WSP? CLOSE;
-trimMethodCallExpr        : TRIM_WORD        WSP? vE1=commonExpr WSP? CLOSE;
-concatMethodCallExpr      : CONCAT_WORD      WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-
-yearMethodCallExpr                : YEAR_WORD                WSP? vE1=commonExpr WSP? CLOSE;
-monthMethodCallExpr               : MONTH_WORD               WSP? vE1=commonExpr WSP? CLOSE;
-dayMethodCallExpr                 : DAY_WORD                 WSP? vE1=commonExpr WSP? CLOSE;
-hourMethodCallExpr                : HOUR_WORD                WSP? vE1=commonExpr WSP? CLOSE;
-minuteMethodCallExpr              : MINUTE_WORD              WSP? vE1=commonExpr WSP? CLOSE;
-secondMethodCallExpr              : SECOND_WORD              WSP? vE1=commonExpr WSP? CLOSE;
-fractionalsecondsMethodCallExpr   : FRACTIONALSECONDS_WORD   WSP? vE1=commonExpr WSP? CLOSE;
-totalsecondsMethodCallExpr        : TOTALSECONDS_WORD        WSP? vE1=commonExpr WSP? CLOSE;
-dateMethodCallExpr                : DATE_WORD                WSP? vE1=commonExpr WSP? CLOSE;
-timeMethodCallExpr                : TIME_WORD                WSP? vE1=commonExpr WSP? CLOSE;
-totalOffsetMinutesMethodCallExpr  : TOTALOFFSETMINUTES_WORD  WSP? vE1=commonExpr WSP? CLOSE;
-
-minDateTimeMethodCallExpr         : MINDATETIME_WORD WSP? CLOSE;
-maxDateTimeMethodCallExpr         : MAXDATETIME_WORD WSP? CLOSE;
-nowMethodCallExpr                 : NOW_WORD         WSP? CLOSE;
-
-roundMethodCallExpr               : ROUND_WORD   WSP? vE1=commonExpr WSP? CLOSE;
-floorMethodCallExpr               : FLOOR_WORD   WSP? vE1=commonExpr WSP? CLOSE;
-ceilingMethodCallExpr             : CEILING_WORD WSP? vE1=commonExpr WSP? CLOSE;
-
-geoDistanceMethodCallExpr         : GEO_DISTANCE_WORD   WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-geoLengthMethodCallExpr           : GEO_LENGTH_WORD     WSP? vE1=commonExpr WSP? CLOSE;
-geoIntersectsMethodCallExpr       : GEO_INTERSECTS_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-
-isofExpr                          : ISOF_WORD  WSP? ( vE1=commonExpr WSP? COMMA WSP? )? vNS=namespace vODI=odataIdentifier WSP? CLOSE;
-castExpr                          : CAST_WORD  WSP? ( vE1=commonExpr WSP? COMMA WSP? )? vNS=namespace vODI=odataIdentifier WSP? CLOSE;
-
-//;------------------------------------------------------------------------------
-//; 5. JSON format for function parameters
-//;------------------------------------------------------------------------------
-//; Note: the query part of a URI needs to be partially percent-decoded before
-//; applying these rules, see comment at the top of this file
-//;------------------------------------------------------------------------------
-
-arrayOrObject       : json_array
-                    | json_object;
-
-json_array          : BEGIN_ARRAY (json_value (WS* COMMA WS* json_value)*)? END_ARRAY;
-
-json_value          : jsonPrimitive
-                    | rootExpr
-                    | json_object
-                    | json_array;
-
-json_object         : BEGIN_OBJECT
-                      (json_key_value_pair (WS* COMMA WS* json_key_value_pair)*)?
-                      END_OBJECT;
-
-json_key_value_pair : STRING_IN_JSON WS* COLON WS* json_value;
-
-//; JSON syntax: adapted to URI restrictions from [RFC4627]                 
-jsonPrimitive 		: STRING_IN_JSON
-                    | number_in_json
-                    | TRUE
-                    | FALSE
-                    | NULLVALUE
-                    ;
-
-number_in_json		: INT | DECIMAL;
-
-//;------------------------------------------------------------------------------
-//; 6. Names and identifiers
-//;------------------------------------------------------------------------------
-
-qualifiedtypename       : namespace odataIdentifier
-                        | 'collection' OPEN ( namespace odataIdentifier ) CLOSE
-                        ;
-
-namespace               : (odataIdentifier POINT)+;
-
-odataIdentifier         : ODATAIDENTIFIER;
-
-//;------------------------------------------------------------------------------
-//; 7. Literal Data Values
-//;------------------------------------------------------------------------------
-
-
-primitiveLiteral    : nullruleLiteral
-                    | booleanNonCaseLiteral
-                    | decimalLiteral   //includes double and single literals
-                    | naninfinityLiteral
-                    | intLiteral       //includes int16/int32 and int64 literals
-                    | binaryLiteral  
-                    | dateLiteral
-                    | datetimeoffsetLiteral
-                    | durationLiteral
-                    | guidLiteral
-                    | stringLiteral
-                    | timeofdayLiteral
-                    | enumLiteral
-                    | geographyCollection
-                    | geographyLineString
-                    | geographyMultilineString
-                    | geographyMultipoint
-                    | geographyMultipolygon
-                    | geographyPoint
-                    | geographyPolygon
-                    | geometryCollection
-                    | geometryLineString
-                    | geometryMultilineString
-                    | geometryMultipoint
-                    | geometryMultipolygon
-                    | geometryPoint
-                    | geometryPolygon
-                    ;
-
-
-nullruleLiteral            : NULLVALUE;
-booleanNonCaseLiteral      : BOOLEAN | TRUE | FALSE;
-decimalLiteral             : DECIMAL;
-naninfinityLiteral         : NANINFINITY;
-intLiteral                 : INT;
-binaryLiteral              : BINARY;
-dateLiteral                : DATE;
-datetimeoffsetLiteral      : DATETIMEOFFSET;
-durationLiteral            : DURATION;
-guidLiteral                : GUID;
-stringLiteral              : STRING;
-timeofdayLiteral           : TIMEOFDAY;
-
-enumLiteral                : vNS=namespace vODI=odataIdentifier vValues=STRING;
-enumValues                 : vlODI+=odataIdentifier ( COMMA vlODI+=odataIdentifier )*;
-
-geographyCollection         : GEOGRAPHY  fullCollectionLiteral SQUOTE;
-fullCollectionLiteral       : sridLiteral collectionLiteral;
-
-collectionLiteral           : (COLLECTION ) OPEN geoLiteral ( COMMA geoLiteral )* CLOSE;
-
-geoLiteral                  : collectionLiteral
-                            | lineStringLiteral
-                            | multipointLiteral
-                            | multilineStringLiteral
-                            | multipolygonLiteral
-                            | pointLiteral
-                            | polygonLiteral;
-
-geographyLineString         : GEOGRAPHY  fullLineStringLiteral SQUOTE;
-fullLineStringLiteral       : sridLiteral lineStringLiteral;
-lineStringLiteral           : LINESTRING lineStringData;
-lineStringData              : OPEN positionLiteral ( COMMA positionLiteral )* CLOSE;
-
-geographyMultilineString    : GEOGRAPHY  fullMultilineStringLiteral SQUOTE;
-fullMultilineStringLiteral  : sridLiteral multilineStringLiteral;
-multilineStringLiteral      : MULTILINESTRING OPEN ( lineStringData ( COMMA lineStringData )* )? CLOSE;
-
-geographyMultipoint         : GEOGRAPHY  fullMultipointLiteral SQUOTE;
-fullMultipointLiteral       : sridLiteral multipointLiteral;
-multipointLiteral           : MULTIPOINT OPEN ( pointData ( COMMA pointData )* )? CLOSE ;
-
-geographyMultipolygon       : GEOGRAPHY  fullmultipolygonLiteral SQUOTE;
-fullmultipolygonLiteral     : sridLiteral multipolygonLiteral;
-multipolygonLiteral         : MULTIPOLYGON OPEN ( polygonData ( COMMA polygonData )* )? CLOSE;
-
-geographyPoint              : GEOGRAPHY  fullpointLiteral SQUOTE;
-fullpointLiteral            : sridLiteral pointLiteral;
-
-pointLiteral                : GEO_POINT pointData;
-pointData                   : OPEN positionLiteral CLOSE;
-
-positionLiteral             : (DECIMAL | INT ) WSP (DECIMAL | INT );  //; longitude, then latitude
-
-
-geographyPolygon            : GEOGRAPHY fullPolygonLiteral SQUOTE;
-fullPolygonLiteral          : sridLiteral polygonLiteral;
-polygonLiteral              : POLYGON polygonData;
-polygonData                 : OPEN ringLiteral ( COMMA ringLiteral )* CLOSE;
-ringLiteral                 : OPEN positionLiteral ( COMMA positionLiteral )* CLOSE;
-                            
-
-geometryCollection          : GEOMETRY  fullCollectionLiteral      SQUOTE;
-geometryLineString          : GEOMETRY  fullLineStringLiteral      SQUOTE;
-geometryMultilineString     : GEOMETRY  fullMultilineStringLiteral SQUOTE;
-geometryMultipoint          : GEOMETRY  fullMultipointLiteral      SQUOTE;
-geometryMultipolygon        : GEOMETRY  fullmultipolygonLiteral    SQUOTE;
-geometryPoint               : GEOMETRY  fullpointLiteral           SQUOTE;
-geometryPolygon             : GEOMETRY  fullPolygonLiteral         SQUOTE;
-
-sridLiteral                 : SRID EQ INT SEMI;
-
-

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26080f42/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
deleted file mode 100644
index bdfdf4c..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java
+++ /dev/null
@@ -1,60 +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.server.core.uri.parser;
-
-import java.util.BitSet;
-
-import org.antlr.v4.runtime.DiagnosticErrorListener;
-import org.antlr.v4.runtime.Parser;
-import org.antlr.v4.runtime.RecognitionException;
-import org.antlr.v4.runtime.Recognizer;
-import org.antlr.v4.runtime.atn.ATNConfigSet;
-import org.antlr.v4.runtime.dfa.DFA;
-
-class CheckFullContextListener extends DiagnosticErrorListener {
-
-  @Override
-  public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendingSymbol, final int line,
-      final int charPositionInLine,
-      final String msg, final RecognitionException e) {
-    // System.err.println("syntaxError detected");
-  }
-
-  @Override
-  public void reportAmbiguity(final Parser recognizer, final DFA dfa, final int startIndex, final int stopIndex,
-      final boolean exact,
-      final BitSet ambigAlts, final ATNConfigSet configs) {
-    // System.err.println("reportAmbiguity detected");
-  }
-
-  @Override
-  public void reportAttemptingFullContext(final Parser recognizer, final DFA dfa, final int startIndex,
-      final int stopIndex,
-      final BitSet conflictingAlts, final ATNConfigSet configs) {
-    // System.err.println("reportAttemptingFullContext detected");
-  }
-
-  @Override
-  public void reportContextSensitivity(final Parser recognizer, final DFA dfa, final int startIndex,
-      final int stopIndex, final int prediction,
-      final ATNConfigSet configs) {
-    // System.err.println("reportContextSensitivity detected");
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26080f42/lib/server-test/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-test/pom.xml b/lib/server-test/pom.xml
index 7def3ef..3b48d9e 100644
--- a/lib/server-test/pom.xml
+++ b/lib/server-test/pom.xml
@@ -47,10 +47,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.antlr</groupId>
-      <artifactId>antlr4-runtime</artifactId>
-    </dependency>
-    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26080f42/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 66b5ffc..7005233 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,8 +86,6 @@
     <jackson.version>2.4.2</jackson.version>
     <aalto-xml.version>0.9.10</aalto-xml.version>
 
-    <antlr.version>4.5</antlr.version>
-
     <android.platform.version>4.1.1.4</android.platform.version>
     <stax.api.version>1.0-2</stax.api.version>
     <woodstox.stax2-api.version>3.1.4</woodstox.stax2-api.version>
@@ -133,12 +131,6 @@
       </dependency>
 
       <dependency>
-        <groupId>org.antlr</groupId>
-        <artifactId>antlr4-runtime</artifactId>
-        <version>${antlr.version}</version>
-      </dependency>
-
-      <dependency>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <version>${maven.bundle.plugin.version}</version>
@@ -316,11 +308,6 @@
           <version>1.9</version>
         </plugin>
         <plugin>
-          <groupId>org.antlr</groupId>
-          <artifactId>antlr4-maven-plugin</artifactId>
-          <version>${antlr.version}</version>
-        </plugin>
-        <plugin>
           <groupId>com.keyboardsamurais.maven</groupId>
           <artifactId>maven-timestamp-plugin</artifactId>
           <version>1.0</version>
@@ -543,7 +530,6 @@
               <exclude>org/apache/olingo/**/tecsvc/**/*.class</exclude>
               <exclude>org/apache/olingo/**/fit/**/*.class</exclude>
               <exclude>org/apache/olingo/**/testutil/**/*.class</exclude>
-              <exclude>org/apache/olingo/**/antlr/**/*.class</exclude>
             </excludes>
           </instrumentation>
           <check/>


[08/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp ServerCore

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
index d36221d..906db19 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -59,7 +59,7 @@ public class DebugTabUri implements DebugTab {
 
   private final UriInfo uriInfo;
 
-  public DebugTabUri(UriInfo uriInfo) {
+  public DebugTabUri(final UriInfo uriInfo) {
     this.uriInfo = uriInfo;
   }
 
@@ -69,7 +69,7 @@ public class DebugTabUri implements DebugTab {
   }
 
   @Override
-  public void appendJson(JsonGenerator gen) throws IOException {
+  public void appendJson(final JsonGenerator gen) throws IOException {
     gen.writeStartObject();
 
     if (!uriInfo.getUriResourceParts().isEmpty()) {
@@ -106,10 +106,12 @@ public class DebugTabUri implements DebugTab {
     gen.writeEndObject();
   }
 
-  private void appendCommonJsonObjects(JsonGenerator gen, CountOption countOption, SkipOption skipOption,
-      TopOption topOption, FilterOption filterOption, OrderByOption orderByOption, SelectOption selectOption,
-      ExpandOption expandOption, SearchOption searchOption)
-      throws IOException {
+  private void appendCommonJsonObjects(final JsonGenerator gen, final CountOption countOption,
+      final SkipOption skipOption,
+      final TopOption topOption, final FilterOption filterOption, final OrderByOption orderByOption,
+      final SelectOption selectOption,
+      final ExpandOption expandOption, final SearchOption searchOption)
+          throws IOException {
     if (countOption != null) {
       gen.writeBooleanField("isCount", countOption.getValue());
     }
@@ -152,7 +154,8 @@ public class DebugTabUri implements DebugTab {
     }
   }
 
-  private void appendURIResourceParts(JsonGenerator gen, List<UriResource> uriResourceParts) throws IOException {
+  private void appendURIResourceParts(final JsonGenerator gen, final List<UriResource> uriResourceParts)
+      throws IOException {
     gen.writeStartArray();
     for (UriResource resource : uriResourceParts) {
       gen.writeStartObject();
@@ -171,7 +174,7 @@ public class DebugTabUri implements DebugTab {
     gen.writeEndArray();
   }
 
-  private void appendParameters(JsonGenerator gen, final String name, final List<UriParameter> parameters)
+  private void appendParameters(final JsonGenerator gen, final String name, final List<UriParameter> parameters)
       throws IOException {
     if (!parameters.isEmpty()) {
       Map<String, String> parameterMap = new LinkedHashMap<String, String>();
@@ -184,7 +187,7 @@ public class DebugTabUri implements DebugTab {
     }
   }
 
-  private void appendOrderByItemsJson(JsonGenerator gen, final List<OrderByItem> orders) throws IOException {
+  private void appendOrderByItemsJson(final JsonGenerator gen, final List<OrderByItem> orders) throws IOException {
     gen.writeStartArray();
     for (final OrderByItem item : orders) {
       gen.writeStartObject();
@@ -197,7 +200,8 @@ public class DebugTabUri implements DebugTab {
     gen.writeEndArray();
   }
 
-  private void appendExpandedPropertiesJson(JsonGenerator gen, List<ExpandItem> expandItems) throws IOException {
+  private void appendExpandedPropertiesJson(final JsonGenerator gen, final List<ExpandItem> expandItems)
+      throws IOException {
     gen.writeStartArray();
     for (ExpandItem item : expandItems) {
       appendExpandItemJson(gen, item);
@@ -205,7 +209,7 @@ public class DebugTabUri implements DebugTab {
     gen.writeEndArray();
   }
 
-  private void appendExpandItemJson(JsonGenerator gen, ExpandItem item) throws IOException {
+  private void appendExpandItemJson(final JsonGenerator gen, final ExpandItem item) throws IOException {
     gen.writeStartObject();
 
     if (item.isStar()) {
@@ -237,7 +241,7 @@ public class DebugTabUri implements DebugTab {
     gen.writeEndObject();
   }
 
-  private void appendExpressionJson(JsonGenerator gen, final Expression expression) throws IOException {
+  private void appendExpressionJson(final JsonGenerator gen, final Expression expression) throws IOException {
     if (expression == null) {
       gen.writeNull();
     } else {
@@ -250,7 +254,8 @@ public class DebugTabUri implements DebugTab {
     }
   }
 
-  private void appendSelectedPropertiesJson(JsonGenerator gen, List<SelectItem> selectItems) throws IOException {
+  private void appendSelectedPropertiesJson(final JsonGenerator gen, final List<SelectItem> selectItems)
+      throws IOException {
     gen.writeStartArray();
     for (SelectItem selectItem : selectItems) {
       gen.writeString(getSelectString(selectItem));
@@ -279,7 +284,7 @@ public class DebugTabUri implements DebugTab {
     return selectedProperty;
   }
 
-  private void appendSearchJson(JsonGenerator json, final SearchExpression searchExpression) throws IOException {
+  private void appendSearchJson(final JsonGenerator json, final SearchExpression searchExpression) throws IOException {
     json.writeStartObject();
     if (searchExpression.isSearchTerm()) {
       json.writeStringField("nodeType", "searchTerm");
@@ -306,7 +311,7 @@ public class DebugTabUri implements DebugTab {
     final JsonFactory jsonFactory = new ObjectMapper().getFactory();
 
     writer.append("<h2>Resource Path</h2>\n")
-        .append("<ul>\n<li class=\"json\">");
+    .append("<ul>\n<li class=\"json\">");
     JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
     appendURIResourceParts(json, uriInfo.getUriResourceParts());
     json.close();
@@ -314,7 +319,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getSearchOption() != null) {
       writer.append("<h2>Search Option</h2>\n")
-          .append("<ul>\n<li class=\"json\">");
+      .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendSearchJson(json, uriInfo.getSearchOption().getSearchExpression());
       json.close();
@@ -323,7 +328,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getFilterOption() != null) {
       writer.append("<h2>Filter Option</h2>\n")
-          .append("<ul>\n<li class=\"json\">");
+      .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendExpressionJson(json, uriInfo.getFilterOption().getExpression());
       json.close();
@@ -332,7 +337,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getOrderByOption() != null) {
       writer.append("<h2>OrderBy Option</h2>\n")
-          .append("<ul>\n<li class=\"json\">");
+      .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendOrderByItemsJson(json, uriInfo.getOrderByOption().getOrders());
       json.close();
@@ -341,7 +346,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getExpandOption() != null) {
       writer.append("<h2>Expand Option</h2>\n")
-          .append("<ul>\n<li class=\"json\">");
+      .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendExpandedPropertiesJson(json, uriInfo.getExpandOption().getExpandItems());
       json.close();
@@ -350,7 +355,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getSelectOption() != null) {
       writer.append("<h2>Selected Properties</h2>\n")
-          .append("<ul>\n");
+      .append("<ul>\n");
       for (final SelectItem selectItem : uriInfo.getSelectOption().getSelectItems()) {
         writer.append("<li>").append(getSelectString(selectItem)).append("</li>\n");
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ExpressionJsonVisitor.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ExpressionJsonVisitor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ExpressionJsonVisitor.java
index cb87b08..bf37973 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ExpressionJsonVisitor.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ExpressionJsonVisitor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -191,7 +191,7 @@ public class ExpressionJsonVisitor implements ExpressionVisitor<JsonNode> {
 
   @Override
   public JsonNode visitEnum(final EdmEnumType type, final List<String> enumValues) throws ExpressionVisitException,
-      ODataApplicationException {
+  ODataApplicationException {
     ObjectNode result = nodeFactory.objectNode()
         .put(NODE_TYPE_NAME, ENUM_NAME)
         .put(TYPE_NAME, getTypeString(type));
@@ -266,7 +266,7 @@ public class ExpressionJsonVisitor implements ExpressionVisitor<JsonNode> {
     }
   }
 
-  private String getType(BinaryOperatorKind operator) {
+  private String getType(final BinaryOperatorKind operator) {
     switch (operator) {
     case MUL:
     case DIV:
@@ -302,8 +302,8 @@ public class ExpressionJsonVisitor implements ExpressionVisitor<JsonNode> {
     final UriResource lastSegment = uriResourceParts.get(uriResourceParts.size() - 1);
     final EdmType type = lastSegment instanceof UriResourcePartTyped ?
         ((UriResourcePartTyped) lastSegment).getType() :
-        null;
-    return type == null ? UNKNOWN_NAME : type.getFullQualifiedName().getFullQualifiedNameAsString();
+          null;
+        return type == null ? UNKNOWN_NAME : type.getFullQualifiedName().getFullQualifiedNameAsString();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java
index 0ca965f..6aef2fb 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -46,11 +46,11 @@ public class ServerCoreDebugger {
   private DebugSupport debugSupport;
   private String debugFormat;
 
-  public ServerCoreDebugger(OData odata) {
+  public ServerCoreDebugger(final OData odata) {
     this.odata = odata;
   }
 
-  public void resolveDebugMode(HttpServletRequest request) {
+  public void resolveDebugMode(final HttpServletRequest request) {
     if (debugSupport != null) {
       // Should we read the parameter from the servlet here and ignore multiple parameters?
       debugFormat = request.getParameter(DebugSupport.ODATA_DEBUG_QUERY_PARAMETER);
@@ -63,7 +63,7 @@ public class ServerCoreDebugger {
 
   public ODataResponse createDebugResponse(final ODataRequest request, final ODataResponse response,
       final Exception exception, final UriInfo uriInfo, final Map<String, String> serverEnvironmentVariables) {
-    //Failsafe so we do not generate unauthorized debug messages
+    // Failsafe so we do not generate unauthorized debug messages
     if (!isDebugMode) {
       return response;
     }
@@ -129,7 +129,7 @@ public class ServerCoreDebugger {
     }
   }
 
-  public void setDebugSupportProcessor(DebugSupport debugSupport) {
+  public void setDebugSupportProcessor(final DebugSupport debugSupport) {
     this.debugSupport = debugSupport;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/DeserializerResultImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/DeserializerResultImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/DeserializerResultImpl.java
index 4ea30ad..01642c3 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/DeserializerResultImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/DeserializerResultImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerImpl.java
index df6b4cc..bc77e66 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -62,7 +62,7 @@ public class FixedFormatDeserializerImpl implements FixedFormatDeserializer {
   }
 
   @Override
-  public Object primitiveValue(InputStream content, final EdmProperty property) throws DeserializerException {
+  public Object primitiveValue(final InputStream content, final EdmProperty property) throws DeserializerException {
     if (property == null || !property.isPrimitive()) {
       throw new DeserializerException("Wrong property.", DeserializerException.MessageKeys.NOT_IMPLEMENTED);
     }
@@ -103,7 +103,7 @@ public class FixedFormatDeserializerImpl implements FixedFormatDeserializer {
                 parameter.isNullable(), parameter.getMaxLength(), parameter.getPrecision(), parameter.getScale(), true,
                 parameter.getMapping() == null ?
                     primitiveType.getDefaultType() :
-                    parameter.getMapping().getMappedJavaClass()));
+                      parameter.getMapping().getMappedJavaClass()));
       } catch (final EdmPrimitiveTypeException e) {
         throw new DeserializerException(
             "Invalid value '" + content + "' for parameter " + parameter.getName(), e,
@@ -119,7 +119,7 @@ public class FixedFormatDeserializerImpl implements FixedFormatDeserializer {
   @Override
   public List<BatchRequestPart> parseBatchRequest(final InputStream content, final String boundary,
       final BatchOptions options)
-      throws BatchDeserializerException {
+          throws BatchDeserializerException {
     final BatchParser parser = new BatchParser();
 
     return parser.parseBatchRequest(content, boundary, options);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchBodyPart.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchBodyPart.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchBodyPart.java
index 6c88da2..7cb031e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchBodyPart.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchBodyPart.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -72,7 +72,7 @@ public class BatchBodyPart implements BatchPart {
     return isChangeSet ? consumeChangeSet(remainingMessage) : consumeQueryOperation(remainingMessage);
   }
 
-  private List<BatchQueryOperation> consumeChangeSet(List<Line> remainingMessage)
+  private List<BatchQueryOperation> consumeChangeSet(final List<Line> remainingMessage)
       throws BatchDeserializerException {
     final List<List<Line>> changeRequests = splitChangeSet(remainingMessage);
     final List<BatchQueryOperation> requestList = new LinkedList<BatchQueryOperation>();
@@ -84,7 +84,7 @@ public class BatchBodyPart implements BatchPart {
     return requestList;
   }
 
-  private List<List<Line>> splitChangeSet(List<Line> remainingMessage) throws BatchDeserializerException {
+  private List<List<Line>> splitChangeSet(final List<Line> remainingMessage) throws BatchDeserializerException {
 
     final HeaderField contentTypeField = headers.getHeaderField(HttpHeader.CONTENT_TYPE);
     final String changeSetBoundary = BatchParserCommon.getBoundary(contentTypeField.getValue(),

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchChangeSetPart.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchChangeSetPart.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchChangeSetPart.java
index 3c596fd..526880a 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchChangeSetPart.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchChangeSetPart.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReader.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReader.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReader.java
index c0a1e20..1a79985 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReader.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReader.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,9 +18,6 @@
  */
 package org.apache.olingo.server.core.deserializer.batch;
 
-import org.apache.olingo.commons.api.format.ContentType;
-import org.apache.olingo.commons.api.http.HttpHeader;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
@@ -28,6 +25,9 @@ import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.olingo.commons.api.format.ContentType;
+import org.apache.olingo.commons.api.http.HttpHeader;
+
 public class BatchLineReader {
   private static final byte CR = '\r';
   private static final byte LF = '\n';
@@ -66,7 +66,7 @@ public class BatchLineReader {
   public List<String> toList() throws IOException {
     final List<String> result = new ArrayList<String>();
     String currentLine = readLine();
-    if(currentLine != null) {
+    if (currentLine != null) {
       currentBoundary = currentLine.trim();
       result.add(currentLine);
 
@@ -80,7 +80,7 @@ public class BatchLineReader {
   public List<Line> toLineList() throws IOException {
     final List<Line> result = new ArrayList<Line>();
     String currentLine = readLine();
-    if(currentLine != null) {
+    if (currentLine != null) {
       currentBoundary = currentLine.trim();
       int counter = 1;
       result.add(new Line(currentLine, counter++));
@@ -93,9 +93,9 @@ public class BatchLineReader {
     return result;
   }
 
-  private void updateCurrentCharset(String currentLine) {
-    if(currentLine != null) {
-      if(currentLine.startsWith(HttpHeader.CONTENT_TYPE)) {
+  private void updateCurrentCharset(final String currentLine) {
+    if (currentLine != null) {
+      if (currentLine.startsWith(HttpHeader.CONTENT_TYPE)) {
         String clValue = currentLine.substring(13, currentLine.length() - 2).trim();
         ContentType ct = ContentType.parse(clValue);
         if (ct != null) {
@@ -111,18 +111,18 @@ public class BatchLineReader {
             currentBoundary = DOUBLE_DASH + boundary;
           }
         }
-      } else if(CRLF.equals(currentLine)) {
+      } else if (CRLF.equals(currentLine)) {
         readState.foundLinebreak();
-      } else if(isBoundary(currentLine)) {
+      } else if (isBoundary(currentLine)) {
         readState.foundBoundary();
       }
     }
   }
 
-  private boolean isBoundary(String currentLine) {
-    if((currentBoundary + CRLF).equals(currentLine)) {
+  private boolean isBoundary(final String currentLine) {
+    if ((currentBoundary + CRLF).equals(currentLine)) {
       return true;
-    } else if((currentBoundary + DOUBLE_DASH + CRLF).equals(currentLine)) {
+    } else if ((currentBoundary + DOUBLE_DASH + CRLF).equals(currentLine)) {
       return true;
     }
     return false;
@@ -145,10 +145,10 @@ public class BatchLineReader {
       }
 
       if (!foundLineEnd) {
-        byte currentChar = this.buffer[offset++];
-        if(!innerBuffer.hasRemaining()) {
+        byte currentChar = buffer[offset++];
+        if (!innerBuffer.hasRemaining()) {
           innerBuffer.flip();
-          ByteBuffer tmp = ByteBuffer.allocate(innerBuffer.limit() *2);
+          ByteBuffer tmp = ByteBuffer.allocate(innerBuffer.limit() * 2);
           tmp.put(innerBuffer);
           innerBuffer = tmp;
         }
@@ -166,7 +166,7 @@ public class BatchLineReader {
           }
 
           // Check if there is at least one character
-          if (limit != EOF && this.buffer[offset] == LF) {
+          if (limit != EOF && buffer[offset] == LF) {
             innerBuffer.put(LF);
             offset++;
           }
@@ -174,11 +174,11 @@ public class BatchLineReader {
       }
     }
 
-    if(innerBuffer.position() == 0) {
+    if (innerBuffer.position() == 0) {
       return null;
     } else {
       String currentLine;
-      if(readState.isReadBody()) {
+      if (readState.isReadBody()) {
         currentLine = new String(innerBuffer.array(), 0, innerBuffer.position(), getCurrentCharset());
       } else {
         currentLine = new String(innerBuffer.array(), 0, innerBuffer.position(), CS_ISO_8859_1);
@@ -208,9 +208,11 @@ public class BatchLineReader {
     public void foundLinebreak() {
       state++;
     }
+
     public void foundBoundary() {
       state = 0;
     }
+
     public boolean isReadBody() {
       return state >= 2;
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java
index 243cbe0..c6c4c49 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -34,7 +34,7 @@ public class BatchParser {
 
   public List<BatchRequestPart> parseBatchRequest(final InputStream content, final String boundary,
       final BatchOptions options)
-          throws BatchDeserializerException {
+      throws BatchDeserializerException {
     this.options = options;
 
     BatchRequestTransformator transformator = new BatchRequestTransformator(options.getRawBaseUri(),
@@ -44,7 +44,7 @@ public class BatchParser {
 
   private List<BatchRequestPart> parse(final InputStream in, final String boundary,
       final BatchRequestTransformator transformator)
-      throws BatchDeserializerException {
+          throws BatchDeserializerException {
     try {
       return parseBatch(in, boundary, transformator);
     } catch (IOException e) {
@@ -72,7 +72,7 @@ public class BatchParser {
   }
 
   private List<List<Line>> splitBodyParts(final InputStream in, final String boundary) throws IOException,
-      BatchDeserializerException {
+  BatchDeserializerException {
     final BatchLineReader reader = new BatchLineReader(in);
     final List<Line> message = reader.toLineList();
     reader.close();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommon.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommon.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommon.java
index bdb8195..055a56d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommon.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommon.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,7 +35,7 @@ public class BatchParserCommon {
 
   private static final String PATTERN_BOUNDARY =
       "([a-zA-Z0-9_\\-\\.'\\+]{1,70})|"
-      + "\"([a-zA-Z0-9_\\-\\.'\\+\\s\\(\\),/:=\\?]{1,69}[a-zA-Z0-9_\\-\\.'\\+\\(\\),/:=\\?])\"";
+          + "\"([a-zA-Z0-9_\\-\\.'\\+\\s\\(\\),/:=\\?]{1,69}[a-zA-Z0-9_\\-\\.'\\+\\(\\),/:=\\?])\"";
   private static final Pattern PATTERN_LAST_CRLF = Pattern.compile("(.*)\\r\\n\\s*", Pattern.DOTALL);
   private static final Pattern PATTERN_HEADER_LINE = Pattern.compile("([a-zA-Z\\-]+):\\s?(.*)\\s*");
 
@@ -147,7 +147,7 @@ public class BatchParserCommon {
     return messageParts;
   }
 
-  private static void removeEndingCRLFFromList(List<Line> list) {
+  private static void removeEndingCRLFFromList(final List<Line> list) {
     if (list.size() > 0) {
       Line lastLine = list.remove(list.size() - 1);
       list.add(removeEndingCRLF(lastLine));
@@ -163,7 +163,7 @@ public class BatchParserCommon {
     }
   }
 
-  public static Header consumeHeaders(List<Line> remainingMessage) {
+  public static Header consumeHeaders(final List<Line> remainingMessage) {
     final int headerLineNumber = remainingMessage.size() != 0 ? remainingMessage.get(0).getLineNumber() : 0;
     final Header headers = new Header(headerLineNumber);
     final Iterator<Line> iter = remainingMessage.iterator();
@@ -189,7 +189,7 @@ public class BatchParserCommon {
     return headers;
   }
 
-  public static void consumeBlankLine(List<Line> remainingMessage, final boolean isStrict)
+  public static void consumeBlankLine(final List<Line> remainingMessage, final boolean isStrict)
       throws BatchDeserializerException {
     if (remainingMessage.size() > 0 && remainingMessage.get(0).toString().matches("\\s*\r?\n\\s*")) {
       remainingMessage.remove(0);
@@ -226,7 +226,7 @@ public class BatchParserCommon {
   }
 
   public static InputStream convertLineListToInputStream(final List<Line> list, final Charset charset,
-                                                         final int length) {
+      final int length) {
     final String message = trimLineListToLength(list, length);
 
     return new ByteArrayInputStream(message.getBytes(charset));

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchPart.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchPart.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchPart.java
index 13986c4..da969da 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchPart.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchPart.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchQueryOperation.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchQueryOperation.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchQueryOperation.java
index 8bbcb81..ba32ced 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchQueryOperation.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchQueryOperation.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestTransformator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestTransformator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestTransformator.java
index 20ef8ea..b9174c9 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestTransformator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestTransformator.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -30,8 +30,8 @@ import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpMethod;
 import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.deserializer.batch.BatchDeserializerException;
-import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart;
 import org.apache.olingo.server.api.deserializer.batch.BatchDeserializerException.MessageKeys;
+import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart;
 
 public class BatchRequestTransformator {
   private static final Charset DEFAULT_CHARSET = Charset.forName("utf-8");
@@ -100,7 +100,7 @@ public class BatchRequestTransformator {
 
   private ODataRequest createRequest(final BatchQueryOperation operation, final String baseUri,
       final boolean isChangeSet)
-      throws BatchDeserializerException {
+          throws BatchDeserializerException {
     final HttpRequestStatusLine statusLine =
         new HttpRequestStatusLine(operation.getHttpStatusLine(), baseUri, rawServiceResolutionUri);
     statusLine.validateHttpMethod(isChangeSet);
@@ -127,13 +127,13 @@ public class BatchRequestTransformator {
     return request;
   }
 
-  private Charset getCharset(BatchQueryOperation operation) {
+  private Charset getCharset(final BatchQueryOperation operation) {
     String ct = operation.getHeaders().getHeader(HttpHeader.CONTENT_TYPE);
-    if(ct != null) {
+    if (ct != null) {
       ContentType contentType = ContentType.parse(ct);
-      if(contentType != null) {
+      if (contentType != null) {
         String charsetValue = contentType.getParameter(ContentType.PARAMETER_CHARSET);
-        if(charsetValue != null) {
+        if (charsetValue != null) {
           return Charset.forName(charsetValue);
         }
       }
@@ -153,8 +153,8 @@ public class BatchRequestTransformator {
   }
 
   private InputStream getBodyStream(final BatchQueryOperation operation, final HttpRequestStatusLine statusLine,
-                                    final Charset charset)
-      throws BatchDeserializerException {
+      final Charset charset)
+          throws BatchDeserializerException {
     if (statusLine.getMethod().equals(HttpMethod.GET)) {
       return new ByteArrayInputStream(new byte[0]);
     } else {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchTransformatorCommon.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchTransformatorCommon.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchTransformatorCommon.java
index 2f3d8bb..d319f86 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchTransformatorCommon.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchTransformatorCommon.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,9 +26,9 @@ import org.apache.olingo.server.api.deserializer.batch.BatchDeserializerExceptio
 import org.apache.olingo.server.api.deserializer.batch.BatchDeserializerException.MessageKeys;
 
 public class BatchTransformatorCommon {
-  
+
   private BatchTransformatorCommon() {
-    //Private Utility Constructor
+    // Private Utility Constructor
   }
 
   public static void validateContentType(final Header headers, final ContentType expected)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Header.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Header.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Header.java
index 1391f94..66372ab 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Header.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Header.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HeaderField.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HeaderField.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HeaderField.java
index fc0e156..9ad3343 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HeaderField.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HeaderField.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLine.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLine.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLine.java
index f2d006a..1600ee6 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLine.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLine.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -143,7 +143,7 @@ public class HttpRequestStatusLine {
   }
 
   public void validateHttpMethod(final boolean isChangeSet) throws BatchDeserializerException {
-    if(isChangeSet && !HTTP_CHANGE_SET_METHODS.contains(getMethod().toString())) {
+    if (isChangeSet && !HTTP_CHANGE_SET_METHODS.contains(getMethod().toString())) {
       throw new BatchDeserializerException("Invalid change set method", MessageKeys.INVALID_CHANGESET_METHOD,
           Integer.toString(statusLine.getLineNumber()));
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Line.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Line.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Line.java
index 6485a49..3417670 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Line.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Line.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
index 549cf33..640100b 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilderImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilderImpl.java
index f154074..b0287ff 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilderImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilderImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
index 9639b3d..7bbc4a0 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -93,7 +93,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
     }
   }
 
-  private EntityCollection consumeEntityCollectionNode(final EdmEntityType edmEntityType, ObjectNode tree,
+  private EntityCollection consumeEntityCollectionNode(final EdmEntityType edmEntityType, final ObjectNode tree,
       final ExpandTreeBuilder expandBuilder) throws DeserializerException {
     EntityCollection entitySet = new EntityCollection();
 
@@ -185,7 +185,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
     }
   }
 
-  private ObjectNode parseJsonTree(InputStream stream) throws IOException, DeserializerException {
+  private ObjectNode parseJsonTree(final InputStream stream) throws IOException, DeserializerException {
     ObjectMapper objectMapper = new ObjectMapper();
     objectMapper.configure(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, true);
     JsonParser parser = new JsonFactory(objectMapper).createParser(stream);
@@ -227,7 +227,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
     return parameters;
   }
 
-  private Parameter createParameter(JsonNode node, final String paramName, final EdmParameter edmParameter)
+  private Parameter createParameter(final JsonNode node, final String paramName, final EdmParameter edmParameter)
       throws DeserializerException {
     Parameter parameter = new Parameter();
     parameter.setName(paramName);
@@ -265,8 +265,8 @@ public class ODataJsonDeserializer implements ODataDeserializer {
   public Parameter parameter(final String content, final EdmParameter parameter) throws DeserializerException {
     try {
       JsonParser parser = new JsonFactory(new ObjectMapper()
-          .configure(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, true))
-          .createParser(content);
+      .configure(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, true))
+      .createParser(content);
       JsonNode node = parser.getCodec().readTree(parser);
       if (node == null) {
         throw new DeserializerException("Invalid JSON syntax.",
@@ -356,8 +356,8 @@ public class ODataJsonDeserializer implements ODataDeserializer {
    * @param edmNavigationProperty related navigation property
    * @throws DeserializerException if jsonNode is not null or if null but nullable or collection navigationProperty
    */
-  private void checkNotNullOrValidNull(JsonNode jsonNode,
-      EdmNavigationProperty edmNavigationProperty) throws DeserializerException {
+  private void checkNotNullOrValidNull(final JsonNode jsonNode,
+      final EdmNavigationProperty edmNavigationProperty) throws DeserializerException {
     boolean isNullable = edmNavigationProperty.isNullable();
     if ((jsonNode.isNull() && !isNullable) || (jsonNode.isNull() && edmNavigationProperty.isCollection())) {
       throw new DeserializerException("Property: " + edmNavigationProperty.getName() + " must not be null.",
@@ -365,32 +365,33 @@ public class ODataJsonDeserializer implements ODataDeserializer {
     }
   }
 
-  private Link createLink(ExpandTreeBuilder expandBuilder, String navigationPropertyName, JsonNode jsonNode,
-      EdmNavigationProperty edmNavigationProperty) throws DeserializerException {
+  private Link createLink(final ExpandTreeBuilder expandBuilder, final String navigationPropertyName,
+      final JsonNode jsonNode,
+      final EdmNavigationProperty edmNavigationProperty) throws DeserializerException {
     Link link = new Link();
     link.setTitle(navigationPropertyName);
     final ExpandTreeBuilder childExpandBuilder = (expandBuilder != null) ?
         expandBuilder.expand(edmNavigationProperty) : null;
-    if (jsonNode.isArray() && edmNavigationProperty.isCollection()) {
-      link.setType(Constants.ENTITY_SET_NAVIGATION_LINK_TYPE);
-      EntityCollection inlineEntitySet = new EntityCollection();
-      inlineEntitySet.getEntities().addAll(
-          consumeEntitySetArray(edmNavigationProperty.getType(), jsonNode, childExpandBuilder));
-      link.setInlineEntitySet(inlineEntitySet);
-    } else if (!jsonNode.isArray() && (!jsonNode.isValueNode() || jsonNode.isNull())
-        && !edmNavigationProperty.isCollection()) {
-      link.setType(Constants.ENTITY_NAVIGATION_LINK_TYPE);
-      if (!jsonNode.isNull()) {
-        Entity inlineEntity = consumeEntityNode(edmNavigationProperty.getType(), (ObjectNode) jsonNode,
-            childExpandBuilder);
-        link.setInlineEntity(inlineEntity);
-      }
-    } else {
-      throw new DeserializerException("Invalid value: " + jsonNode.getNodeType()
-          + " for expanded navigation property: " + navigationPropertyName,
-          MessageKeys.INVALID_VALUE_FOR_NAVIGATION_PROPERTY, navigationPropertyName);
-    }
-    return link;
+        if (jsonNode.isArray() && edmNavigationProperty.isCollection()) {
+          link.setType(Constants.ENTITY_SET_NAVIGATION_LINK_TYPE);
+          EntityCollection inlineEntitySet = new EntityCollection();
+          inlineEntitySet.getEntities().addAll(
+              consumeEntitySetArray(edmNavigationProperty.getType(), jsonNode, childExpandBuilder));
+          link.setInlineEntitySet(inlineEntitySet);
+        } else if (!jsonNode.isArray() && (!jsonNode.isValueNode() || jsonNode.isNull())
+            && !edmNavigationProperty.isCollection()) {
+          link.setType(Constants.ENTITY_NAVIGATION_LINK_TYPE);
+          if (!jsonNode.isNull()) {
+            Entity inlineEntity = consumeEntityNode(edmNavigationProperty.getType(), (ObjectNode) jsonNode,
+                childExpandBuilder);
+            link.setInlineEntity(inlineEntity);
+          }
+        } else {
+          throw new DeserializerException("Invalid value: " + jsonNode.getNodeType()
+              + " for expanded navigation property: " + navigationPropertyName,
+              MessageKeys.INVALID_VALUE_FOR_NAVIGATION_PROPERTY, navigationPropertyName);
+        }
+        return link;
   }
 
   private Link consumeBindingLink(final String key, final JsonNode jsonNode, final EdmEntityType edmEntityType)
@@ -460,7 +461,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
   private void consumePropertySingleNode(final String name, final EdmType type,
       final boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
       final boolean isUnicode, final EdmMapping mapping, final JsonNode jsonNode, final Property property)
-      throws DeserializerException {
+          throws DeserializerException {
     switch (type.getKind()) {
     case PRIMITIVE:
     case DEFINITION:
@@ -482,7 +483,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
 
   private Object readComplexNode(final String name, final EdmType type, final boolean isNullable,
       final JsonNode jsonNode)
-      throws DeserializerException {
+          throws DeserializerException {
     // read and add all complex properties
     ComplexValue value = readComplexValue(name, type, isNullable, jsonNode);
 
@@ -498,7 +499,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
   private void consumePropertyCollectionNode(final String name, final EdmType type,
       final boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
       final boolean isUnicode, final EdmMapping mapping, final JsonNode jsonNode, final Property property)
-      throws DeserializerException {
+          throws DeserializerException {
     if (!jsonNode.isArray()) {
       throw new DeserializerException("Value for property: " + name + " must be an array but is not.",
           DeserializerException.MessageKeys.INVALID_JSON_TYPE_FOR_PROPERTY, name);
@@ -516,9 +517,9 @@ public class ODataJsonDeserializer implements ODataDeserializer {
         valueArray.add(value);
       }
       property.setValue(type.getKind() == EdmTypeKind.ENUM ?
-              ValueType.COLLECTION_ENUM :
-              ValueType.COLLECTION_PRIMITIVE,
-          valueArray);
+          ValueType.COLLECTION_ENUM :
+          ValueType.COLLECTION_PRIMITIVE,
+            valueArray);
       break;
     case COMPLEX:
       while (iterator.hasNext()) {
@@ -611,12 +612,12 @@ public class ODataJsonDeserializer implements ODataDeserializer {
     final EdmPrimitiveType edmPrimitiveType =
         type.getKind() == EdmTypeKind.ENUM ?
             ((EdmEnumType) type).getUnderlyingType() :
-                type.getKind() == EdmTypeKind.DEFINITION ?
-                    ((EdmTypeDefinition) type).getUnderlyingType() :
-                    type;
-    return mapping == null || mapping.getMappedJavaClass() == null ?
-        edmPrimitiveType.getDefaultType() :
-        mapping.getMappedJavaClass();
+            type.getKind() == EdmTypeKind.DEFINITION ?
+                ((EdmTypeDefinition) type).getUnderlyingType() :
+                type;
+                  return mapping == null || mapping.getMappedJavaClass() == null ?
+                      edmPrimitiveType.getDefaultType() :
+                        mapping.getMappedJavaClass();
   }
 
   /**
@@ -633,7 +634,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
     }
   }
 
-  private void removeAnnotations(ObjectNode tree) throws DeserializerException {
+  private void removeAnnotations(final ObjectNode tree) throws DeserializerException {
     List<String> toRemove = new ArrayList<String>();
     Iterator<Entry<String, JsonNode>> fieldsIterator = tree.fields();
     while (fieldsIterator.hasNext()) {
@@ -705,23 +706,23 @@ public class ODataJsonDeserializer implements ODataDeserializer {
 
   private boolean matchNumberCase(final JsonNode node, final EdmPrimitiveTypeKind primKind) {
     return node.isNumber() &&
-      (primKind == EdmPrimitiveTypeKind.Int16
-      || primKind == EdmPrimitiveTypeKind.Int32
-      || primKind == EdmPrimitiveTypeKind.Byte
-      || primKind == EdmPrimitiveTypeKind.SByte
-      || primKind == EdmPrimitiveTypeKind.Single
-      || primKind == EdmPrimitiveTypeKind.Double);
+        (primKind == EdmPrimitiveTypeKind.Int16
+            || primKind == EdmPrimitiveTypeKind.Int32
+            || primKind == EdmPrimitiveTypeKind.Byte
+            || primKind == EdmPrimitiveTypeKind.SByte
+            || primKind == EdmPrimitiveTypeKind.Single
+            || primKind == EdmPrimitiveTypeKind.Double);
   }
 
   private boolean matchTextualCase(final JsonNode node, final EdmPrimitiveTypeKind primKind) {
     return node.isTextual() &&
         (primKind == EdmPrimitiveTypeKind.String
-        || primKind == EdmPrimitiveTypeKind.Binary
-        || primKind == EdmPrimitiveTypeKind.Date
-        || primKind == EdmPrimitiveTypeKind.DateTimeOffset
-        || primKind == EdmPrimitiveTypeKind.Duration
-        || primKind == EdmPrimitiveTypeKind.Guid
-        || primKind == EdmPrimitiveTypeKind.TimeOfDay);
+            || primKind == EdmPrimitiveTypeKind.Binary
+            || primKind == EdmPrimitiveTypeKind.Date
+            || primKind == EdmPrimitiveTypeKind.DateTimeOffset
+            || primKind == EdmPrimitiveTypeKind.Duration
+            || primKind == EdmPrimitiveTypeKind.Guid
+            || primKind == EdmPrimitiveTypeKind.TimeOfDay);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
index eb1f5de..d3876b6 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -115,7 +115,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
     return value;
   }
 
-  private Object complex(final XMLEventReader reader, final StartElement start, EdmComplexType edmComplex)
+  private Object complex(final XMLEventReader reader, final StartElement start, final EdmComplexType edmComplex)
       throws XMLStreamException, EdmPrimitiveTypeException, DeserializerException {
     ComplexValue value = new ComplexValue();
     boolean foundEndProperty = false;
@@ -165,7 +165,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
   private Property property(final XMLEventReader reader, final StartElement start, final EdmType edmType,
       final boolean isNullable, final Integer maxLength, final Integer precision,
       final Integer scale, final boolean isUnicode, final boolean isCollection)
-      throws XMLStreamException, EdmPrimitiveTypeException, DeserializerException {
+          throws XMLStreamException, EdmPrimitiveTypeException, DeserializerException {
 
     final Property property = new Property();
 
@@ -182,7 +182,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
     return property;
   }
 
-  private ValueType getValueType(EdmType edmType, boolean isCollection) {
+  private ValueType getValueType(final EdmType edmType, final boolean isCollection) {
     if (edmType instanceof EdmPrimitiveType) {
       if (edmType instanceof EdmEnumType) {
         return isCollection ? ValueType.COLLECTION_ENUM : ValueType.ENUM;
@@ -231,7 +231,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
   }
 
   @Override
-  public DeserializerResult property(InputStream input, EdmProperty edmProperty)
+  public DeserializerResult property(final InputStream input, final EdmProperty edmProperty)
       throws DeserializerException {
     try {
       final XMLEventReader reader = getReader(input);
@@ -342,7 +342,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
     }
   }
 
-  private List<String> entityRefCollection(XMLEventReader reader, StartElement start)
+  private List<String> entityRefCollection(final XMLEventReader reader, final StartElement start)
       throws XMLStreamException {
     boolean foundEndElement = false;
     ArrayList<String> references = new ArrayList<String>();
@@ -360,7 +360,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
     return references;
   }
 
-  private String entityRef(XMLEventReader reader, StartElement start) throws XMLStreamException {
+  private String entityRef(final XMLEventReader reader, final StartElement start) throws XMLStreamException {
     boolean foundEndElement = false;
     final Attribute entityRefId = start.getAttributeByName(Constants.QNAME_ATOM_ATTR_ID);
     while (reader.hasNext() && !foundEndElement) {
@@ -388,7 +388,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
 
   private void properties(final XMLEventReader reader, final StartElement start, final Entity entity,
       final EdmEntityType edmEntityType)
-      throws XMLStreamException, EdmPrimitiveTypeException, DeserializerException {
+          throws XMLStreamException, EdmPrimitiveTypeException, DeserializerException {
 
     boolean foundEndProperties = false;
     while (reader.hasNext() && !foundEndProperties) {
@@ -547,7 +547,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
   }
 
   @Override
-  public DeserializerResult entity(InputStream input, EdmEntityType edmEntityType)
+  public DeserializerResult entity(final InputStream input, final EdmEntityType edmEntityType)
       throws DeserializerException {
     try {
       final XMLEventReader reader = getReader(input);
@@ -633,7 +633,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
   }
 
   @Override
-  public DeserializerResult entityCollection(InputStream input, EdmEntityType edmEntityType)
+  public DeserializerResult entityCollection(final InputStream input, final EdmEntityType edmEntityType)
       throws DeserializerException {
     try {
       final XMLEventReader reader = getReader(input);
@@ -654,7 +654,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
   }
 
   @Override
-  public DeserializerResult entityReferences(InputStream stream) throws DeserializerException {
+  public DeserializerResult entityReferences(final InputStream stream) throws DeserializerException {
     try {
       XMLEventReader reader = getReader(stream);
       ArrayList<URI> references = new ArrayList<URI>();
@@ -677,7 +677,7 @@ public class ODataXmlDeserializer implements ODataDeserializer {
   }
 
   @Override
-  public DeserializerResult actionParameters(InputStream stream, EdmAction edmAction)
+  public DeserializerResult actionParameters(final InputStream stream, final EdmAction edmAction)
       throws DeserializerException {
     Map<String, Parameter> parameters = new LinkedHashMap<String, Parameter>();
     if (edmAction.getParameterNames() == null || edmAction.getParameterNames().isEmpty()
@@ -724,8 +724,8 @@ public class ODataXmlDeserializer implements ODataDeserializer {
     }
   }
 
-  private void consumeParameters(EdmAction edmAction, XMLEventReader reader,
-      StartElement start, Map<String, Parameter> parameters) throws DeserializerException,
+  private void consumeParameters(final EdmAction edmAction, final XMLEventReader reader,
+      final StartElement start, final Map<String, Parameter> parameters) throws DeserializerException,
       EdmPrimitiveTypeException, XMLStreamException {
 
     List<String> parameterNames = edmAction.getParameterNames();
@@ -763,8 +763,8 @@ public class ODataXmlDeserializer implements ODataDeserializer {
     }
   }
 
-  private Parameter createParameter(XMLEventReader reader, StartElement start, String paramName,
-      EdmParameter edmParameter) throws DeserializerException, EdmPrimitiveTypeException, XMLStreamException {
+  private Parameter createParameter(final XMLEventReader reader, final StartElement start, final String paramName,
+      final EdmParameter edmParameter) throws DeserializerException, EdmPrimitiveTypeException, XMLStreamException {
 
     Parameter parameter = new Parameter();
     parameter.setName(paramName);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagHelperImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagHelperImpl.java
index 81cefe3..168541f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagHelperImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagHelperImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,7 +29,7 @@ public class ETagHelperImpl implements ETagHelper {
   @Override
   public boolean checkReadPreconditions(final String eTag,
       final Collection<String> ifMatchHeaders, final Collection<String> ifNoneMatchHeaders)
-      throws PreconditionException {
+          throws PreconditionException {
     if (eTag != null) {
       final ETagInformation ifMatch = createETagInformation(ifMatchHeaders);
       if (!ifMatch.isMatchedBy(eTag) && !ifMatch.getETags().isEmpty()) {
@@ -44,7 +44,7 @@ public class ETagHelperImpl implements ETagHelper {
   @Override
   public void checkChangePreconditions(final String eTag,
       final Collection<String> ifMatchHeaders, final Collection<String> ifNoneMatchHeaders)
-      throws PreconditionException {
+          throws PreconditionException {
     if (eTag != null) {
       final ETagInformation ifMatch = createETagInformation(ifMatchHeaders);
       final ETagInformation ifNoneMatch = createETagInformation(ifNoneMatchHeaders);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagInformation.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagInformation.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagInformation.java
index 03310ec..f71bcde 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagInformation.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagInformation.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagParser.java
index 805a29c..dee4c03 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagParser.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -31,21 +31,21 @@ import java.util.regex.Pattern;
  * <p>See <a href="https://www.ietf.org/rfc/rfc7232.txt">RFC 7232</a> for details;
  * there the following grammar is defined:</p>
  * <pre>
- *     If-Match      = "*" / 1#entity-tag
- *     If-None-Match = "*" / 1#entity-tag
- *     entity-tag    = [ weak ] opaque-tag
- *     weak          = %x57.2F ; "W/", case-sensitive
- *     opaque-tag    = DQUOTE *etagc DQUOTE
- *     etagc         = %x21 / %x23-7E / %x80-FF
+ * If-Match = "*" / 1#entity-tag
+ * If-None-Match = "*" / 1#entity-tag
+ * entity-tag = [ weak ] opaque-tag
+ * weak = %x57.2F ; "W/", case-sensitive
+ * opaque-tag = DQUOTE *etagc DQUOTE
+ * etagc = %x21 / %x23-7E / %x80-FF
  * </pre>
  * <p>Values with illegal syntax do not contribute to the result but no exception is thrown.</p>
  */
 public class ETagParser {
 
   private static final Pattern ETAG = Pattern.compile("\\s*(,\\s*)+|((?:W/)?\"[!#-~\\x80-\\xFF]*\")");
-  
-  private ETagParser (){
-    //Private constructor for utility classes
+
+  private ETagParser() {
+    // Private constructor for utility classes
   }
 
   protected static Collection<String> parse(final Collection<String> values) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/PreconditionsValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/PreconditionsValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/PreconditionsValidator.java
index a8690d1..414eacd 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/PreconditionsValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/etag/PreconditionsValidator.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -42,7 +42,7 @@ public class PreconditionsValidator {
     return affectedEntitySetOrSingleton != null
         && (isMediaValue ?
             customETagSupport.hasMediaETag(affectedEntitySetOrSingleton) :
-            customETagSupport.hasETag(affectedEntitySetOrSingleton));
+              customETagSupport.hasETag(affectedEntitySetOrSingleton));
   }
 
   private EdmBindingTarget extractInformation(final UriInfo uriInfo) throws PreconditionException {
@@ -87,7 +87,7 @@ public class PreconditionsValidator {
     return lastFoundEntitySetOrSingleton;
   }
 
-  private EdmBindingTarget getEntitySetFromFunctionImport(UriResourceFunction uriResourceFunction) {
+  private EdmBindingTarget getEntitySetFromFunctionImport(final UriResourceFunction uriResourceFunction) {
     EdmFunctionImport functionImport = uriResourceFunction.getFunctionImport();
     if (functionImport != null && functionImport.getReturnedEntitySet() != null
         && !uriResourceFunction.isCollection()) {
@@ -96,12 +96,12 @@ public class PreconditionsValidator {
     return null;
   }
 
-  private EdmBindingTarget getEntitySet(UriResourceEntitySet uriResourceEntitySet) {
+  private EdmBindingTarget getEntitySet(final UriResourceEntitySet uriResourceEntitySet) {
     return uriResourceEntitySet.isCollection() ? null : uriResourceEntitySet.getEntitySet();
   }
 
-  private EdmBindingTarget getEntitySetFromNavigation(EdmBindingTarget lastFoundEntitySetOrSingleton,
-      UriResourceNavigation uriResourceNavigation) {
+  private EdmBindingTarget getEntitySetFromNavigation(final EdmBindingTarget lastFoundEntitySetOrSingleton,
+      final UriResourceNavigation uriResourceNavigation) {
     if (lastFoundEntitySetOrSingleton != null && !uriResourceNavigation.isCollection()) {
       EdmNavigationProperty navProp = uriResourceNavigation.getProperty();
       return lastFoundEntitySetOrSingleton.getRelatedBindingTarget(navProp.getName());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferParser.java
index eee7959..d142f09 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferParser.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -33,18 +33,18 @@ import org.apache.olingo.server.api.prefer.Preferences.Preference;
  * <p>See <a href="https://www.ietf.org/rfc/rfc7240.txt">RFC 7240</a> for details;
  * there the following grammar is defined:</p>
  * <pre>
- *     Prefer        = "Prefer" ":" 1#preference
- *     preference    = token [ BWS "=" BWS word ] *( OWS ";" [ OWS parameter ] )
- *     parameter     = token [ BWS "=" BWS word ]
- *     token         = 1*tchar
- *     tchar         = "!" / "#" / "$" / "%" / "&" / "'" / "*"
-                     / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
- *     word          = token / quoted-string
- *     quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
- *     qdtext        = HTAB / SP / %x21 / %x23-5B / %x5D-7E / %x80-FF
- *     quoted-pair   = "\" ( HTAB / SP / %x21-7E /  %x80-FF )
- *     OWS           = *( SP / HTAB )  ; optional whitespace
- *     BWS           = OWS             ; "bad" whitespace
+ * Prefer = "Prefer" ":" 1#preference
+ * preference = token [ BWS "=" BWS word ] *( OWS ";" [ OWS parameter ] )
+ * parameter = token [ BWS "=" BWS word ]
+ * token = 1*tchar
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
+ * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
+ * word = token / quoted-string
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
+ * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / %x80-FF
+ * quoted-pair = "\" ( HTAB / SP / %x21-7E / %x80-FF )
+ * OWS = *( SP / HTAB ) ; optional whitespace
+ * BWS = OWS ; "bad" whitespace
  * </pre>
  * <p>Values with illegal syntax do not contribute to the result but no exception is thrown.</p>
  */
@@ -58,9 +58,9 @@ public class PreferParser {
   private static final Pattern PREFERENCE = Pattern.compile("\\s*(,\\s*)+|"
       + "(?:" + namedValue + "((?:\\s*;\\s*(?:" + namedValue + ")?)*))");
   private static final Pattern PARAMETER = Pattern.compile("\\s*(;\\s*)+|(?:" + namedValue + ")");
-  
-  private PreferParser (){
-    //Private constructor for utility classes
+
+  private PreferParser() {
+    // Private constructor for utility classes
   }
 
   protected static Map<String, Preference> parse(final Collection<String> values) {
@@ -77,7 +77,7 @@ public class PreferParser {
     return result;
   }
 
-  private static void parse(final String value, Map<String, Preference> result) {
+  private static void parse(final String value, final Map<String, Preference> result) {
     Map<String, Preference> partResult = new HashMap<String, Preference>();
     String separator = "";
     int start = 0;
@@ -90,13 +90,13 @@ public class PreferParser {
         final String name = matcher.group(2).toLowerCase(Locale.ROOT);
         // RFC 7240:
         // If any preference is specified more than once, only the first instance is to be
-        // considered.  All subsequent occurrences SHOULD be ignored without signaling
+        // considered. All subsequent occurrences SHOULD be ignored without signaling
         // an error or otherwise altering the processing of the request.
         if (!partResult.containsKey(name)) {
           final String preferenceValue = getValue(matcher.group(3));
           final Map<String, String> parameters =
               matcher.group(4) == null || matcher.group(4).isEmpty() ? null :
-                  parseParameters(matcher.group(4));
+                parseParameters(matcher.group(4));
           partResult.put(name, new Preference(preferenceValue, parameters));
         }
         separator = null;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java
index ecafdc4..85a724d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -41,14 +41,17 @@ public class PreferencesImpl implements Preferences {
     preferences = PreferParser.parse(preferHeaders);
   }
 
+  @Override
   public Preference getPreference(final String name) {
     return preferences.get(name.toLowerCase(Locale.ROOT));
   }
 
+  @Override
   public boolean hasAllowEntityReferences() {
     return preferences.containsKey(PreferenceName.ALLOW_ENTITY_REFERENCES.getName());
   }
 
+  @Override
   public URI getCallback() {
     if (preferences.containsKey(PreferenceName.CALLBACK.getName())
         && preferences.get(PreferenceName.CALLBACK.getName()).getParameters() != null
@@ -62,18 +65,22 @@ public class PreferencesImpl implements Preferences {
     return null;
   }
 
+  @Override
   public boolean hasContinueOnError() {
     return preferences.containsKey(PreferenceName.CONTINUE_ON_ERROR.getName());
   }
 
+  @Override
   public Integer getMaxPageSize() {
     return getNonNegativeIntegerPreference(PreferenceName.MAX_PAGE_SIZE.getName());
   }
 
+  @Override
   public boolean hasTrackChanges() {
     return preferences.containsKey(PreferenceName.TRACK_CHANGES.getName());
   }
 
+  @Override
   public Return getReturn() {
     if (preferences.containsKey(PreferenceName.RETURN.getName())) {
       final String value = preferences.get(PreferenceName.RETURN.getName()).getValue();
@@ -86,10 +93,12 @@ public class PreferencesImpl implements Preferences {
     return null;
   }
 
+  @Override
   public boolean hasRespondAsync() {
     return preferences.containsKey(PreferenceName.RESPOND_ASYNC.getName());
   }
 
+  @Override
   public Integer getWait() {
     return getNonNegativeIntegerPreference(PreferenceName.WAIT.getName());
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AbstractODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AbstractODataSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AbstractODataSerializer.java
index 0f0eff6..d29b3ff 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AbstractODataSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AbstractODataSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,7 +28,8 @@ public abstract class AbstractODataSerializer implements ODataSerializer {
 
   protected static final String IO_EXCEPTION_TEXT = "An I/O exception occurred.";
 
-  protected void closeCircleStreamBufferOutput(OutputStream outputStream, SerializerException cachedException)
+  protected void closeCircleStreamBufferOutput(final OutputStream outputStream,
+      final SerializerException cachedException)
       throws SerializerException {
     if (outputStream != null) {
       try {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializer.java
index 6f431d4..ac779fc 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,10 +18,6 @@
  */
 package org.apache.olingo.server.core.serializer;
 
-import org.apache.olingo.commons.api.http.HttpStatusCode;
-import org.apache.olingo.server.api.ODataResponse;
-import org.apache.olingo.server.api.serializer.SerializerException;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -34,6 +30,10 @@ import java.nio.channels.WritableByteChannel;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.olingo.commons.api.http.HttpStatusCode;
+import org.apache.olingo.server.api.ODataResponse;
+import org.apache.olingo.server.api.serializer.SerializerException;
+
 public class AsyncResponseSerializer {
   private static final int BUFFER_SIZE = 8192;
   private static final String COLON = ":";
@@ -59,10 +59,10 @@ public class AsyncResponseSerializer {
   }
 
   private void appendResponseHeader(final ODataResponse response,
-                                    final ByteArrayOutputStream buffer) throws IOException {
+      final ByteArrayOutputStream buffer) throws IOException {
     final Map<String, List<String>> header = response.getAllHeaders();
 
-    for (final Map.Entry<String, List<String>> entry: header.entrySet()) {
+    for (final Map.Entry<String, List<String>> entry : header.entrySet()) {
       appendHeader(entry.getKey(), entry.getValue(), buffer);
     }
   }
@@ -80,7 +80,7 @@ public class AsyncResponseSerializer {
     append(HTTP_VERSION + SP + response.getStatusCode() + SP + status + CRLF, buffer);
   }
 
-  private void appendBody(ODataResponse response, ByteArrayOutputStream buffer) throws IOException {
+  private void appendBody(final ODataResponse response, final ByteArrayOutputStream buffer) throws IOException {
     InputStream input = response.getContent();
     if (input != null) {
       ByteBuffer inBuffer = ByteBuffer.allocate(BUFFER_SIZE);


[39/51] [abbrv] olingo-odata4 git commit: [OLINGO-???] less use of reflection in equals() and hashCode()

Posted by mi...@apache.org.
[OLINGO-???] less use of reflection in equals() and hashCode()

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 26f7d2a6b1ddf295d0133d78022b87391c98f48d
Parents: a283bdd
Author: Klaus Straubinger <kl...@sap.com>
Authored: Fri Jan 15 16:08:27 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Jan 18 13:36:52 2016 +0100

----------------------------------------------------------------------
 .../commons/api/edm/FullQualifiedName.java      | 19 ++----
 .../commons/api/edm/geo/ComposedGeospatial.java | 32 ++++++++-
 .../olingo/commons/api/edm/geo/Geospatial.java  | 31 ++-------
 .../api/edm/geo/GeospatialCollection.java       | 10 ++-
 .../olingo/commons/api/edm/geo/LineString.java  |  8 +--
 .../commons/api/edm/geo/MultiLineString.java    |  8 +--
 .../olingo/commons/api/edm/geo/MultiPoint.java  |  8 +--
 .../commons/api/edm/geo/MultiPolygon.java       |  8 +--
 .../olingo/commons/api/edm/geo/Point.java       | 72 ++++++++++++++------
 .../olingo/commons/api/edm/geo/Polygon.java     | 38 ++++++++---
 .../apache/olingo/commons/api/edm/geo/SRID.java | 49 +++++--------
 11 files changed, 150 insertions(+), 133 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
index 9f83d42..de0325e 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
@@ -28,7 +28,6 @@ public final class FullQualifiedName implements Serializable {
   private static final long serialVersionUID = -4063629050858999076L;
 
   private final String namespace;
-
   private final String name;
 
   private final String fqn;
@@ -90,24 +89,14 @@ public final class FullQualifiedName implements Serializable {
       return false;
     }
 
-    FullQualifiedName that = (FullQualifiedName) o;
-
-    if (namespace != null ? !namespace.equals(that.namespace) : that.namespace != null) {
-      return false;
-    }
-    if (name != null ? !name.equals(that.name) : that.name != null) {
-      return false;
-    }
-    return !(fqn != null ? !fqn.equals(that.fqn) : that.fqn != null);
-
+    final FullQualifiedName that = (FullQualifiedName) o;
+    return (namespace == null ? that.namespace == null : namespace.equals(that.namespace))
+        && (name == null ? that.name == null : name.equals(that.name));
   }
 
   @Override
   public int hashCode() {
-    int result = namespace != null ? namespace.hashCode() : 0;
-    result = 31 * result + (name != null ? name.hashCode() : 0);
-    result = 31 * result + (fqn != null ? fqn.hashCode() : 0);
-    return result;
+    return fqn == null ? 0 : fqn.hashCode();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/ComposedGeospatial.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/ComposedGeospatial.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/ComposedGeospatial.java
index f7e9f3d..0120a78 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/ComposedGeospatial.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/ComposedGeospatial.java
@@ -22,15 +22,13 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
- /**
+/**
  * Abstract base class for all Geometries that are composed out of other geospatial elements.
  *
  * @param <T> Type of the contained geospatial elements
  */
 public abstract class ComposedGeospatial<T extends Geospatial> extends Geospatial implements Iterable<T> {
 
-  private static final long serialVersionUID = 8796254901098541307L;
-
   protected final List<T> geospatials;
 
   protected ComposedGeospatial(final Dimension dimension, final Type type, final SRID srid,
@@ -56,4 +54,32 @@ public abstract class ComposedGeospatial<T extends Geospatial> extends Geospatia
   public boolean isEmpty() {
     return geospatials.isEmpty();
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    final ComposedGeospatial<?> other = (ComposedGeospatial<?>) o;
+    return dimension == other.dimension
+        && (srid == null ? other.srid == null : srid.equals(other.srid))
+        && geospatials.equals(other.geospatials);
+  }
+
+  @Override
+  public int hashCode() {
+    int result = dimension == null ? 0 : dimension.hashCode();
+    result = 31 * result + (srid == null ? 0 : srid.hashCode());
+    result = 31 * result + geospatials.hashCode();
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return geospatials.toString();
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
index 539196c..63d8b3f 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
@@ -18,21 +18,13 @@
  */
 package org.apache.olingo.commons.api.edm.geo;
 
-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;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 
 /**
  * Base class for all geospatial info.
  */
-public abstract class Geospatial implements Serializable {
+public abstract class Geospatial {
 
-  private static final long serialVersionUID = 5409612902190067390L;
-  
   /**
    * Dimension of the geospatial type
    */
@@ -46,7 +38,7 @@ public abstract class Geospatial implements Serializable {
      */
     GEOGRAPHY
   }
-  
+
   /**
    * Type of the geospatial type
    */
@@ -122,7 +114,7 @@ public abstract class Geospatial implements Serializable {
    * @return type.
    * @see Type
    */
-  public Type getType() {
+  public Type getGeoType() {
     return type;
   }
 
@@ -134,25 +126,10 @@ public abstract class Geospatial implements Serializable {
   public SRID getSrid() {
     return srid;
   }
-  
+
   /**
    * Returns the {@link EdmPrimitiveTypeKind}
    * @return Edm primitve type kind
    */
   public abstract EdmPrimitiveTypeKind getEdmPrimitiveTypeKind();
-
-  @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/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/GeospatialCollection.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/GeospatialCollection.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/GeospatialCollection.java
index e46aea2..4ac4a27 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/GeospatialCollection.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/GeospatialCollection.java
@@ -27,10 +27,8 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  */
 public class GeospatialCollection extends ComposedGeospatial<Geospatial> {
 
-  private static final long serialVersionUID = -9181547636133878977L;
-  
   /**
-   * Creates a new collection of geospatial types
+   * Creates a new collection of geospatial types.
    * @param dimension     Dimension of the collection
    * @param srid          SRID Value
    * @param geospatials   Members of the collection
@@ -41,8 +39,8 @@ public class GeospatialCollection extends ComposedGeospatial<Geospatial> {
 
   @Override
   public EdmPrimitiveTypeKind getEdmPrimitiveTypeKind() {
-    return dimension == Dimension.GEOGRAPHY
-        ? EdmPrimitiveTypeKind.GeographyCollection
-            : EdmPrimitiveTypeKind.GeometryCollection;
+    return dimension == Dimension.GEOGRAPHY ?
+        EdmPrimitiveTypeKind.GeographyCollection :
+        EdmPrimitiveTypeKind.GeometryCollection;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/LineString.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/LineString.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/LineString.java
index af2e13e..38e4573 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/LineString.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/LineString.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  */
 public class LineString extends ComposedGeospatial<Point> {
 
-  private static final long serialVersionUID = 3207958185407535907L;
-  
   /**
    * Creates a new LineString
    * @param dimension     Dimension of the LineString
@@ -42,8 +40,8 @@ public class LineString extends ComposedGeospatial<Point> {
 
   @Override
   public EdmPrimitiveTypeKind getEdmPrimitiveTypeKind() {
-    return dimension == Dimension.GEOGRAPHY
-        ? EdmPrimitiveTypeKind.GeographyLineString
-            : EdmPrimitiveTypeKind.GeometryLineString;
+    return dimension == Dimension.GEOGRAPHY ?
+        EdmPrimitiveTypeKind.GeographyLineString :
+        EdmPrimitiveTypeKind.GeometryLineString;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiLineString.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiLineString.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiLineString.java
index f8796b6..6bd88b2 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiLineString.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiLineString.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  */
 public class MultiLineString extends ComposedGeospatial<LineString> {
 
-  private static final long serialVersionUID = -5042414471218124125L;
-  
   /**
    * Creates a new MultiLineString
    * 
@@ -43,9 +41,9 @@ public class MultiLineString extends ComposedGeospatial<LineString> {
 
   @Override
   public EdmPrimitiveTypeKind getEdmPrimitiveTypeKind() {
-    return dimension == Dimension.GEOGRAPHY
-        ? EdmPrimitiveTypeKind.GeographyMultiLineString
-            : EdmPrimitiveTypeKind.GeometryMultiLineString;
+    return dimension == Dimension.GEOGRAPHY ?
+        EdmPrimitiveTypeKind.GeographyMultiLineString :
+        EdmPrimitiveTypeKind.GeometryMultiLineString;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPoint.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPoint.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPoint.java
index 8a38a73..8d23dcc 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPoint.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPoint.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  */
 public class MultiPoint extends ComposedGeospatial<Point> {
 
-  private static final long serialVersionUID = 4951011255142116129L;
-  
   /**
    * Creates a new collection of points
    * @param dimension   Dimension of the points
@@ -42,9 +40,9 @@ public class MultiPoint extends ComposedGeospatial<Point> {
 
   @Override
   public EdmPrimitiveTypeKind getEdmPrimitiveTypeKind() {
-    return dimension == Dimension.GEOGRAPHY
-        ? EdmPrimitiveTypeKind.GeographyMultiPoint
-            : EdmPrimitiveTypeKind.GeometryMultiPoint;
+    return dimension == Dimension.GEOGRAPHY ?
+        EdmPrimitiveTypeKind.GeographyMultiPoint :
+        EdmPrimitiveTypeKind.GeometryMultiPoint;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPolygon.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPolygon.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPolygon.java
index d39c3a1..8fae3d7 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPolygon.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/MultiPolygon.java
@@ -28,8 +28,6 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  */
 public class MultiPolygon extends ComposedGeospatial<Polygon> {
 
-  private static final long serialVersionUID = -160184788048512883L;
-  
   /**
    * Creates a collection of polygons
    * 
@@ -43,8 +41,8 @@ public class MultiPolygon extends ComposedGeospatial<Polygon> {
 
   @Override
   public EdmPrimitiveTypeKind getEdmPrimitiveTypeKind() {
-    return dimension == Dimension.GEOGRAPHY
-        ? EdmPrimitiveTypeKind.GeographyMultiPolygon
-            : EdmPrimitiveTypeKind.GeometryMultiPolygon;
+    return dimension == Dimension.GEOGRAPHY ?
+        EdmPrimitiveTypeKind.GeographyMultiPolygon :
+        EdmPrimitiveTypeKind.GeometryMultiPolygon;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Point.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Point.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Point.java
index 0a79622..fa0ff9e 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Point.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Point.java
@@ -21,15 +21,11 @@ package org.apache.olingo.commons.api.edm.geo;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 
 /**
- * Represents a point 
- * 
- * Either Edm.GeographyPoint or Edm.GeometryPoint
+ * Represents a point, either Edm.GeographyPoint or Edm.GeometryPoint.
  *
  */
 public class Point extends Geospatial {
 
-  private static final long serialVersionUID = 4917380107331557828L;
-
   /**
    * The X coordinate of the point. In most long/lat systems, this is the longitude.
    */
@@ -47,41 +43,40 @@ public class Point extends Geospatial {
   private double z;
 
   /**
-   * Creates a new point
-   * 
+   * Creates a new point.
    * @param dimension   Dimension of the point
    * @param srid        SRID value
    */
   public Point(final Dimension dimension, final SRID srid) {
     super(dimension, Type.POINT, srid);
   }
-  
+
   /**
-   * Returns the x coordinate
+   * Returns the x coordinate.
    * @return x coordinate
    */
   public double getX() {
     return x;
   }
-  
+
   /**
-   * Sets the x coordinate
+   * Sets the x coordinate.
    * @param x x coordinate
    */
   public void setX(final double x) {
     this.x = x;
   }
-  
+
   /**
-   * Returns the y coordinate
+   * Returns the y coordinate.
    * @return y coordinate
    */
   public double getY() {
     return y;
   }
-  
+
   /**
-   * Sets the y coordinate
+   * Sets the y coordinate.
    * @param y y coordinate
    */
   public void setY(final double y) {
@@ -89,15 +84,15 @@ public class Point extends Geospatial {
   }
 
   /**
-   * Returns the z coordinate
+   * Returns the z coordinate.
    * @return z coordinate
    */
   public double getZ() {
     return z;
   }
-  
+
   /**
-   * Sets the z coordinate
+   * Sets the z coordinate.
    * @param z z coordinate
    */
   public void setZ(final double z) {
@@ -106,8 +101,43 @@ public class Point extends Geospatial {
 
   @Override
   public EdmPrimitiveTypeKind getEdmPrimitiveTypeKind() {
-    return dimension == Dimension.GEOGRAPHY
-        ? EdmPrimitiveTypeKind.GeographyPoint
-            : EdmPrimitiveTypeKind.GeometryPoint;
+    return dimension == Dimension.GEOGRAPHY ?
+        EdmPrimitiveTypeKind.GeographyPoint :
+        EdmPrimitiveTypeKind.GeometryPoint;
+  }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    final Point point = (Point) o;
+    return dimension == point.dimension
+        && (srid == null ? point.srid == null : srid.equals(point.srid))
+        && x == point.x
+        && y == point.y
+        && z == point.z;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = dimension == null ? 0 : dimension.hashCode();
+    result = 31 * result + (srid == null ? 0 : srid.hashCode());
+    result = 31 * result + Double.valueOf(x).hashCode();
+    result = 31 * result + Double.valueOf(y).hashCode();
+    result = 31 * result + Double.valueOf(z).hashCode();
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return (dimension == null ? "" : dimension.name())
+        + '\''
+        + (srid == null ? "" : "SRID=" + srid.toString() + ';')
+        + "Point(" + x + ' ' + y + ")'";
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Polygon.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Polygon.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Polygon.java
index c59d73f..7ac4681 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Polygon.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Polygon.java
@@ -27,14 +27,11 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  */
 public class Polygon extends Geospatial {
 
-  private static final long serialVersionUID = 7797602503445391678L;
-
   final ComposedGeospatial<Point> interior;
-
   final ComposedGeospatial<Point> exterior;
-  
+
   /**
-   * Creates a new polygon
+   * Creates a new polygon.
    * 
    * @param dimension   Dimension of the polygon
    * @param srid        SRID values
@@ -69,8 +66,33 @@ public class Polygon extends Geospatial {
 
   @Override
   public EdmPrimitiveTypeKind getEdmPrimitiveTypeKind() {
-    return dimension == Dimension.GEOGRAPHY
-        ? EdmPrimitiveTypeKind.GeographyPolygon
-            : EdmPrimitiveTypeKind.GeometryPolygon;
+    return dimension == Dimension.GEOGRAPHY ?
+        EdmPrimitiveTypeKind.GeographyPolygon :
+        EdmPrimitiveTypeKind.GeometryPolygon;
+  }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    final Polygon polygon = (Polygon) o;
+    return dimension == polygon.dimension
+        && (srid == null ? polygon.srid == null : srid.equals(polygon.srid))
+        && (interior == null ? polygon.interior == null : interior.equals(polygon.interior))
+        && (exterior == null ? polygon.exterior == null : exterior.equals(polygon.exterior));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = dimension == null ? 0 : dimension.hashCode();
+    result = 31 * result + (srid == null ? 0 : srid.hashCode());
+    result = 31 * result + (interior == null ? 0 : interior.hashCode());
+    result = 31 * result + (exterior == null ? 0 : exterior.hashCode());
+    return result;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/26f7d2a6/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java
index 1b1a1b0..0f28772 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java
@@ -18,10 +18,10 @@
  */
 package org.apache.olingo.commons.api.edm.geo;
 
-import org.apache.olingo.commons.api.edm.geo.Geospatial.Dimension;
-
 import java.io.Serializable;
 
+import org.apache.olingo.commons.api.edm.geo.Geospatial.Dimension;
+
 /**
  * A geometry or geography property MAY define a value for the SRID attribute. The value of this attribute identifies
  * which spatial reference system is applied to values of the property on type instances.
@@ -29,23 +29,22 @@ import java.io.Serializable;
  * The value of the SRID attribute MUST be a non-negative integer or the special value <tt>variable</tt>. If no value is
  * specified, the attribute defaults to 0 for Geometry types or 4326 for Geography types.
  * <br/>
- * Standards Track Work Product Copyright © OASIS Open 2013. All Rights Reserved. 19 November 2013 Page 22 of 83The
- * valid values of the SRID attribute and their meanings are as defined by the European Petroleum Survey Group [EPSG].
+ * Standards Track Work Product Copyright © OASIS Open 2013. All Rights Reserved. 19 November 2013
+ * <br>
+ * The valid values of the SRID attribute and their meanings are as defined by the
+ * European Petroleum Survey Group [EPSG].
  */
 public final class SRID implements Serializable {
 
-  private static final String VARIABLE = "variable";
-
   private static final long serialVersionUID = 8412685060902464629L;
+  private static final String VARIABLE = "variable";
 
   private Dimension dimension = Dimension.GEOGRAPHY;
-
   private Integer value;
-
   private Boolean variable;
   
   /**
-   * Creates a new SRID instance from a given 
+   * Creates a new SRID instance from a given value.
    * @param exp Either "variable" or a numeric non-negative SRID value
    * @return SRID instance
    */
@@ -70,15 +69,15 @@ public final class SRID implements Serializable {
   }
 
   /**
-   * Returns the dimension of the SRID instance
+   * Returns the dimension of the SRID instance.
    * @return dimension of the SRID instance
    */
   public Dimension getDimension() {
     return dimension;
   }
-  
+
   /**
-   * Sets the dimension of the SRID instance
+   * Sets the dimension of the SRID instance.
    * @param dimension dimension of the SRID instance
    */
   public void setDimension(final Dimension dimension) {
@@ -86,27 +85,13 @@ public final class SRID implements Serializable {
   }
 
   private String getValue() {
-    if (value == null) {
-      if (dimension == Dimension.GEOMETRY) {
-        return "0";
-      } else {
-        return "4326";
-      }
-    }
-
-    return value.toString();
-//    return value == null ? dimension == Dimension.GEOMETRY
-//        ? "0"
-//            : "4326"
-//        : value.getName();
+    return value == null ?
+        dimension == Dimension.GEOMETRY ? "0" : "4326" :
+        value.toString();
   }
 
-  private boolean isVariable() {
-    return variable != null && variable;
-  }
-  
   /**
-   * Returns true if the value of the instance is not equals to the default (uninitialized)
+   * Returns true if the value of the instance is not equals to the default (uninitialized).
    * @return true if the value of the instance is not equals to the default (uninitialized)
    */
   public boolean isNotDefault() {
@@ -144,8 +129,6 @@ public final class SRID implements Serializable {
 
   @Override
   public String toString() {
-    return isVariable()
-        ? VARIABLE
-        : getValue();
+    return variable != null && variable ? VARIABLE : getValue();
   }
 }


[33/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] URI parser shall not ignore empty path segments

Posted by mi...@apache.org.
[OLINGO-834] URI parser shall not ignore empty path segments

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 3295bcc062206b2764fe33692004541d0b602bed
Parents: b086601
Author: Klaus Straubinger <kl...@sap.com>
Authored: Tue Jan 12 15:05:01 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Tue Jan 12 15:18:45 2016 +0100

----------------------------------------------------------------------
 .../olingo/fit/tecsvc/http/BasicHttpITCase.java |    4 +-
 .../olingo/server/core/uri/parser/Parser.java   |   22 +-
 .../server/core/uri/parser/ParserHelper.java    |    2 +-
 .../server/core/uri/parser/UriDecoder.java      |   45 +-
 .../core/uri/parser/search/SearchParser.java    |    2 +-
 .../server/core/uri/validator/UriValidator.java |   67 +-
 .../core/uri/parser/ExpressionParserTest.java   |    8 +-
 .../server/core/uri/parser/LexerTest.java       |  318 +
 .../server/core/uri/parser/UriDecoderTest.java  |   17 +-
 .../search/SearchParserAndTokenizerTest.java    |   33 +-
 .../uri/parser/search/SearchParserTest.java     |   16 +-
 .../uri/parser/search/SearchTokenizerTest.java  |   15 +-
 .../core/uri/antlr/TestFullResourcePath.java    | 5900 -----------------
 .../olingo/server/core/uri/antlr/TestLexer.java |  323 -
 .../core/uri/antlr/TestUriParserImpl.java       | 1046 ----
 .../core/uri/parser/TestFullResourcePath.java   | 5905 ++++++++++++++++++
 .../core/uri/parser/TestUriParserImpl.java      | 1046 ++++
 .../core/uri/queryoption/QueryOptionTest.java   |   14 +-
 18 files changed, 7374 insertions(+), 7409 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java
index e097581..bb13989 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java
@@ -114,7 +114,7 @@ public class BasicHttpITCase extends AbstractBaseTestITCase {
 
   @Test
   public void testIEEE754ParameterContentNegotiation() throws Exception {
-    final URL url = new URL(SERVICE_URI + "/ESAllPrim(32767)?$format=application/json;IEEE754Compatible=true");
+    final URL url = new URL(SERVICE_URI + "ESAllPrim(32767)?$format=application/json;IEEE754Compatible=true");
     final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
     connection.setRequestMethod(HttpMethod.GET.name());
     connection.setRequestProperty(HttpHeader.ACCEPT, "application/json;IEEE754Compatible=false");
@@ -131,7 +131,7 @@ public class BasicHttpITCase extends AbstractBaseTestITCase {
 
   @Test
   public void testIEEE754ParameterViaAcceptHeader() throws Exception {
-    final URL url = new URL(SERVICE_URI + "/ESAllPrim(32767)");
+    final URL url = new URL(SERVICE_URI + "ESAllPrim(32767)");
     final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
     connection.setRequestMethod(HttpMethod.GET.name());
     connection.setRequestProperty(HttpHeader.ACCEPT, "application/json;IEEE754Compatible=true");

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
index 86f5749..34944c8 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.server.core.uri.parser;
 
 import java.util.ArrayDeque;
+import java.util.Collections;
 import java.util.Deque;
 import java.util.List;
 
@@ -60,6 +61,7 @@ public class Parser {
   private static final String ATOM = "atom";
   private static final String JSON = "json";
   private static final String XML = "xml";
+  private static final String DOLLAR = "$";
   private static final String AT = "@";
   private static final String NULL = "null";
 
@@ -78,14 +80,19 @@ public class Parser {
     Deque<EdmType> contextTypes = new ArrayDeque<EdmType>();
     boolean contextIsCollection = false;
 
-    final List<String> pathSegmentsDecoded = UriDecoder.splitAndDecodePath(path);
-    final int numberOfSegments = pathSegmentsDecoded.size();
+    List<String> pathSegmentsDecoded = UriDecoder.splitAndDecodePath(path);
+    int numberOfSegments = pathSegmentsDecoded.size();
+    // Remove an initial empty segment resulting from the expected '/' at the beginning of the path.
+    if (numberOfSegments > 1 && pathSegmentsDecoded.get(0).isEmpty()) {
+      pathSegmentsDecoded.remove(0);
+      numberOfSegments--;
+    }
 
     // first, read the decoded path segments
-    final String firstSegment = numberOfSegments == 0 ? "" : pathSegmentsDecoded.get(0);
+    final String firstSegment = pathSegmentsDecoded.get(0);
 
     if (firstSegment.isEmpty()) {
-      ensureLastSegment(firstSegment, 0, numberOfSegments);
+      ensureLastSegment(firstSegment, 1, numberOfSegments);
       contextUriInfo.setKind(UriInfoKind.service);
 
     } else if (firstSegment.equals("$batch")) {
@@ -168,11 +175,12 @@ public class Parser {
     }
 
     // second, read the system query options and the custom query options
-    final List<QueryOption> options = UriDecoder.splitAndDecodeOptions(query);
+    final List<QueryOption> options =
+        query == null ? Collections.<QueryOption> emptyList() : UriDecoder.splitAndDecodeOptions(query);
     for (final QueryOption option : options) {
       final String optionName = option.getName();
       final String optionValue = option.getText();
-      if (optionName.startsWith("$")) {
+      if (optionName.startsWith(DOLLAR)) {
         SystemQueryOption systemOption = null;
         if (optionName.equals(SystemQueryOptionKind.FILTER.toString())) {
           UriTokenizer filterTokenizer = new UriTokenizer(optionValue);
@@ -315,7 +323,7 @@ public class Parser {
               UriParserSyntaxException.MessageKeys.DUPLICATED_ALIAS, optionName);
         }
 
-      } else {
+      } else if (!optionName.isEmpty()) {
         contextUriInfo.addCustomQueryOption((CustomQueryOption) option);
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
index 7f4abf7..852c43a 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
@@ -157,7 +157,7 @@ public class ParserHelper {
     final List<EdmKeyPropertyRef> keyPropertyRefs = edmEntityType.getKeyPropertyRefs();
     if (tokenizer.next(TokenKind.CLOSE)) {
       throw new UriParserSemanticException(
-          "Expected " + keyPropertyRefs.size() + " key predicates but none.",
+          "Expected " + keyPropertyRefs.size() + " key predicates but got none.",
           UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
           Integer.toString(keyPropertyRefs.size()), "0");
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
index 6450bf6..1cc5ec5 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
@@ -19,8 +19,6 @@
 package org.apache.olingo.server.core.uri.parser;
 
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -33,7 +31,7 @@ public class UriDecoder {
   /** Splits the path string at '/' characters and percent-decodes the resulting path segments. */
   protected static List<String> splitAndDecodePath(final String path) throws UriParserSyntaxException {
     List<String> pathSegmentsDecoded = new ArrayList<String>();
-    for (final String segment : splitSkipEmpty(path, '/')) {
+    for (final String segment : split(path, '/')) {
       pathSegmentsDecoded.add(decode(segment));
     }
     return pathSegmentsDecoded;
@@ -42,58 +40,39 @@ public class UriDecoder {
   /**
    * Splits the query-option string at '&' characters, the resulting parts at '=' characters,
    * and separately percent-decodes names and values of the resulting name-value pairs.
+   * If there is no '=' character in an option, the whole option is considered as name.
    */
   protected static List<QueryOption> splitAndDecodeOptions(final String queryOptionString)
       throws UriParserSyntaxException {
-    if (queryOptionString == null || queryOptionString.isEmpty()) {
-      return Collections.emptyList();
-    }
-
     List<QueryOption> queryOptions = new ArrayList<QueryOption>();
-    for (final String option : splitSkipEmpty(queryOptionString, '&')) {
-      final List<String> pair = splitFirst(option, '=');
+    for (final String option : split(queryOptionString, '&')) {
+      final int pos = option.indexOf('=');
+      final String name = pos >= 0 ? option.substring(0, pos)  : option;
+      final String text = pos >= 0 ? option.substring(pos + 1) : "";
       queryOptions.add(new CustomQueryOptionImpl()
-          .setName(decode(pair.get(0)))
-          .setText(decode(pair.get(1))));
+          .setName(decode(name))
+          .setText(decode(text)));
     }
     return queryOptions;
   }
 
-  private static List<String> splitFirst(final String input, final char c) {
-    int pos = input.indexOf(c);
-    if (pos >= 0) {
-      return Arrays.asList(input.substring(0, pos), input.substring(pos + 1));
-    } else {
-      return Arrays.asList(input, "");
-    }
-  }
-
   /**
-   * Splits the input string at the given character and drops all empty elements.
+   * Splits the input string at the given character.
    * @param input string to split
    * @param c character at which to split
    * @return list of elements (can be empty)
    */
-  private static List<String> splitSkipEmpty(final String input, final char c) {
-    if (input.isEmpty() || input.length() == 1 && input.charAt(0) == c) {
-      return Collections.emptyList();
-    }
-
+  private static List<String> split(final String input, final char c) {
     List<String> list = new LinkedList<String>();
 
     int start = 0;
     int end;
-
     while ((end = input.indexOf(c, start)) >= 0) {
-      if (start != end) {
-        list.add(input.substring(start, end));
-      }
+      list.add(input.substring(start, end));
       start = end + 1;
     }
 
-    if (input.charAt(input.length() - 1) != c) {
-      list.add(input.substring(start));
-    }
+    list.add(input.substring(start));
 
     return list;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
index 4fccb81..6c3db4f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
@@ -50,7 +50,7 @@ public class SearchParser {
       searchExpression = parse(tokenizer.tokenize(searchQuery));
     } catch (SearchTokenizerException e) {
       String message = e.getMessage();
-      throw new SearchParserException("Tokenizer exception with message: " + message,
+      throw new SearchParserException("Tokenizer exception with message: " + message, e,
           SearchParserException.MessageKeys.TOKENIZER_EXCEPTION, message);
     }
     final SearchOptionImpl searchOption = new SearchOptionImpl();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
index 149d1fc..5d842fb 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
@@ -286,9 +286,9 @@ public class UriValidator {
           RowIndexForUriType.mediaStream : RowIndexForUriType.propertyPrimitiveValue;
       break;
     default:
-      throw new UriValidationException("Unexpected kind in path segment before $value: "
-          + secondLastPathSegment.getKind(), UriValidationException.MessageKeys.UNALLOWED_KIND_BEFORE_VALUE,
-          secondLastPathSegment.toString());
+      throw new UriValidationException(
+          "Unexpected kind in path segment before $value: " + secondLastPathSegment.getKind(),
+          UriValidationException.MessageKeys.UNALLOWED_KIND_BEFORE_VALUE, secondLastPathSegment.toString());
     }
     return idx;
   }
@@ -302,9 +302,9 @@ public class UriValidator {
       return ((UriResourcePartTyped) secondLastPathSegment).isCollection() ?
           RowIndexForUriType.references : RowIndexForUriType.reference;
     } else {
-      throw new UriValidationException("secondLastPathSegment not a class of UriResourcePartTyped: "
-          + lastPathSegment.getClass(), UriValidationException.MessageKeys.LAST_SEGMENT_NOT_TYPED, lastPathSegment
-          .toString());
+      throw new UriValidationException(
+          "secondLastPathSegment not a class of UriResourcePartTyped: " + lastPathSegment.getClass(),
+          UriValidationException.MessageKeys.LAST_SEGMENT_NOT_TYPED, lastPathSegment.toString());
     }
   }
 
@@ -314,40 +314,36 @@ public class UriValidator {
       return ((UriResourcePartTyped) lastPathSegment).isCollection() ?
           RowIndexForUriType.propertyPrimitiveCollection : RowIndexForUriType.propertyPrimitive;
     } else {
-      throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
-          + lastPathSegment.getClass(), UriValidationException.MessageKeys.LAST_SEGMENT_NOT_TYPED, lastPathSegment
-          .toString());
+      throw new UriValidationException(
+          "lastPathSegment not a class of UriResourcePartTyped: " + lastPathSegment.getClass(),
+          UriValidationException.MessageKeys.LAST_SEGMENT_NOT_TYPED, lastPathSegment.toString());
     }
   }
 
   private RowIndexForUriType rowIndexForFunction(final UriResource lastPathSegment) throws UriValidationException {
     final UriResourceFunction uriFunction = (UriResourceFunction) lastPathSegment;
-    final EdmReturnType returnType = uriFunction.getFunction().getReturnType();
-
     if (!uriFunction.getFunction().isComposable()) {
       return RowIndexForUriType.none;
     }
 
+    final boolean isCollection = uriFunction.isCollection();
+    final EdmTypeKind typeKind = uriFunction.getFunction().getReturnType().getType().getKind();
     RowIndexForUriType idx;
-    switch (returnType.getType().getKind()) {
+    switch (typeKind) {
     case ENTITY:
-      idx = returnType.isCollection() && uriFunction.getKeyPredicates().isEmpty() ?
-          RowIndexForUriType.entitySet : RowIndexForUriType.entity;
+      idx = isCollection ? RowIndexForUriType.entitySet : RowIndexForUriType.entity;
       break;
     case PRIMITIVE:
     case ENUM:
     case DEFINITION:
-      idx = returnType.isCollection() ? RowIndexForUriType.propertyPrimitiveCollection :
-                                        RowIndexForUriType.propertyPrimitive;
+      idx = isCollection ? RowIndexForUriType.propertyPrimitiveCollection : RowIndexForUriType.propertyPrimitive;
       break;
     case COMPLEX:
-      idx = returnType.isCollection() ? RowIndexForUriType.propertyComplexCollection :
-                                        RowIndexForUriType.propertyComplex;
+      idx = isCollection ? RowIndexForUriType.propertyComplexCollection : RowIndexForUriType.propertyComplex;
       break;
     default:
-      throw new UriValidationException("Unsupported function return type: " + returnType.getType().getKind(),
-          UriValidationException.MessageKeys.UNSUPPORTED_FUNCTION_RETURN_TYPE,
-          returnType.getType().getKind().toString());
+      throw new UriValidationException("Unsupported function return type: " + typeKind,
+          UriValidationException.MessageKeys.UNSUPPORTED_FUNCTION_RETURN_TYPE, typeKind.toString());
     }
 
     return idx;
@@ -512,18 +508,17 @@ public class UriValidator {
       for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
         options.append(option.getName()).append(" ");
       }
-      throw new UriValidationException("System query option " + options.toString() + " not allowed for method "
-          + httpMethod, UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED_FOR_HTTP_METHOD,
+      throw new UriValidationException(
+          "System query option " + options.toString() + " not allowed for method " + httpMethod,
+          UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED_FOR_HTTP_METHOD,
           options.toString(), httpMethod.toString());
     }
   }
 
   private boolean isAction(final UriInfo uriInfo) {
     List<UriResource> uriResourceParts = uriInfo.getUriResourceParts();
-    if (uriResourceParts.isEmpty()) {
-      return false;
-    }
-    return UriResourceKind.action == uriResourceParts.get(uriResourceParts.size() - 1).getKind();
+    return !uriResourceParts.isEmpty()
+        && UriResourceKind.action == uriResourceParts.get(uriResourceParts.size() - 1).getKind();
   }
 
   private void validateParameters(final UriInfo uriInfo) throws UriValidationException {
@@ -531,18 +526,18 @@ public class UriValidator {
       final boolean isFunction = pathSegment.getKind() == UriResourceKind.function;
 
       if (isFunction) {
-        final UriResourceFunction functionPathSegement = (UriResourceFunction) pathSegment;
-        final EdmFunction edmFuntion = functionPathSegement.getFunction();
+        final UriResourceFunction functionPathSegment = (UriResourceFunction) pathSegment;
+        final EdmFunction edmFunction = functionPathSegment.getFunction();
 
         final Map<String, UriParameter> parameters = new HashMap<String, UriParameter>();
-        for (final UriParameter parameter : functionPathSegement.getParameters()) {
+        for (final UriParameter parameter : functionPathSegment.getParameters()) {
           parameters.put(parameter.getName(), parameter);
         }
 
         boolean firstParameter = true;
-        for (final String parameterName : edmFuntion.getParameterNames()) {
+        for (final String parameterName : edmFunction.getParameterNames()) {
           final UriParameter parameter = parameters.get(parameterName);
-          final boolean isNullable = edmFuntion.getParameter(parameterName).isNullable();
+          final boolean isNullable = edmFunction.getParameter(parameterName).isNullable();
 
           if (parameter != null) {
             /** No alias, value explicit null */
@@ -560,7 +555,7 @@ public class UriValidator {
             }
 
             parameters.remove(parameterName);
-          } else if (!isNullable && !(firstParameter && edmFuntion.isBound())) {
+          } else if (!isNullable && !(firstParameter && edmFunction.isBound())) {
             // The first parameter of bound functions is implicit provided by the preceding path segment
             throw new UriValidationException("Missing non nullable parameter " + parameterName,
                 UriValidationException.MessageKeys.MISSING_PARAMETER, parameterName);
@@ -586,11 +581,11 @@ public class UriValidator {
       if (isEntitySet || pathSegment.getKind() == UriResourceKind.navigationProperty || isEntityColFunction) {
         final List<UriParameter> keyPredicates = isEntitySet ?
             ((UriResourceEntitySet) pathSegment).getKeyPredicates() :
-            isEntityColFunction ? ((UriResourceFunction) pathSegment).getKeyPredicates()
-                : ((UriResourceNavigation) pathSegment).getKeyPredicates();
+            isEntityColFunction ?
+                ((UriResourceFunction) pathSegment).getKeyPredicates() :
+                ((UriResourceNavigation) pathSegment).getKeyPredicates();
 
         if (keyPredicates != null) {
-
                 final EdmEntityType entityType = isEntitySet ?
                     ((UriResourceEntitySet) pathSegment).getEntityType() :
                       isEntityColFunction ? (EdmEntityType) ((UriResourceFunction) pathSegment).getType()

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
index 94d5373..f495c5b 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
@@ -290,15 +290,13 @@ public class ExpressionParserTest {
     }
     expressionString += ')';
 
-    Expression expression = parseExpression(expressionString);
-    assertNotNull(expression);
-    return expression;
+    return parseExpression(expressionString);
   }
 
   private Expression parseExpression(final String expressionString)
       throws UriParserException, UriValidationException {
     UriTokenizer tokenizer = new UriTokenizer(expressionString);
-    Expression expression = new ExpressionParser(mock(Edm.class), odata).parse(tokenizer, null, null);
+    final Expression expression = new ExpressionParser(mock(Edm.class), odata).parse(tokenizer, null, null);
     assertNotNull(expression);
     assertTrue(tokenizer.next(TokenKind.EOF));
     return expression;
@@ -306,7 +304,7 @@ public class ExpressionParserTest {
 
   private void wrongExpression(final String expressionString) {
     try {
-      new ExpressionParser(mock(Edm.class), odata).parse(new UriTokenizer(expressionString), null, null);
+      parseExpression(expressionString);
       fail("Expected exception not thrown.");
     } catch (final UriParserException e) {
       assertNotNull(e);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/LexerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/LexerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/LexerTest.java
new file mode 100644
index 0000000..df3b506
--- /dev/null
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/LexerTest.java
@@ -0,0 +1,318 @@
+/*
+ * 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.core.uri.parser;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.olingo.server.core.uri.parser.UriTokenizer;
+import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
+import org.junit.Test;
+
+/**
+ * Tests originally written for the ANTLR lexer.
+ */
+public class LexerTest {
+
+  private TokenValidator test = new TokenValidator();
+
+  @Test
+  public void unary() {
+    test.run("-a eq a").has(TokenKind.MinusOperator, TokenKind.ODataIdentifier, TokenKind.EqualsOperator,
+        TokenKind.ODataIdentifier).isInput();
+  }
+
+  @Test
+  public void uriTokens() {
+//    test.run("#").isType(TokenKind.FRAGMENT).isInput();
+    test.run("$count").has(TokenKind.COUNT).isInput();
+    test.run("$ref").has(TokenKind.REF).isInput();
+    test.run("$value").has(TokenKind.VALUE).isInput();
+  }
+
+  @Test
+  public void queryOptionsTokens() {
+    test.run("$skip=1").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$skip=2").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$skip=123").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+
+    test.run("$top=1").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$top=2").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$top=123").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+
+    test.run("$levels=1").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$levels=2").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$levels=123").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$levels=max").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.MAX).isInput();
+
+//    test.run("$format=atom").has(TokenKind.FORMAT, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$format=json").has(TokenKind.FORMAT, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$format=xml").has(TokenKind.FORMAT,, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$format=abc/def").has(TokenKind.FORMAT, TokenKind.EQ,
+//        TokenKind.ODataIdentifier, TokenKind.SLASH, TokenKind.ODataIdentifier).isInput();
+
+//    test.run("$id=123").has(TokenKind.ID, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+//    test.run("$id=ABC").has(TokenKind.ID, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+
+//    test.run("$skiptoken=ABC").has(TokenKind.SKIPTOKEN, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$skiptoken=ABC").has(TokenKind.SKIPTOKEN, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+
+    test.run("$search=\"ABC\"").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase).isInput();
+    test.run("$search=ABC").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word).isInput();
+    test.run("$search=\"A%20B%20C\"").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase).isInput();
+    test.run("$search=Test Test").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word,
+        TokenKind.AndOperatorSearch, TokenKind.Word).isInput();
+    test.run("$search=Test&$filter=ABC eq 1").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word);
+  }
+
+  @Test
+  public void queryOptionsDefaultMode() {
+    test.run("$expand=ABC($skip=1)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($skip=123)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($search=abc)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($search=\"123\")").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($top=1)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($top=123)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+
+    test.run("$expand=ABC($expand=DEF($skip=1))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+    test.run("$expand=ABC($expand=DEF($skip=123))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+
+    test.run("$expand=ABC($expand=DEF($top=1))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+    test.run("$expand=ABC($expand=DEF($top=123))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+
+    test.run("$expand=ABC($expand=DEF($search=Test Test))")
+        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word,
+            TokenKind.AndOperatorSearch, TokenKind.Word, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+    test.run("$expand=ABC($expand=DEF($search=\"Test\" \"Test\"))")
+        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase,
+            TokenKind.AndOperatorSearch, TokenKind.Phrase, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+    test.run("$expand=ABC($expand=DEF($search=\"Test\" \"Test\";$filter=PropertyInt16 eq 0;$orderby=PropertyInt16))")
+        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase,
+            TokenKind.AndOperatorSearch, TokenKind.Phrase, TokenKind.SEMI,
+            TokenKind.FILTER, TokenKind.EQ, TokenKind.ODataIdentifier, TokenKind.EqualsOperator,
+            TokenKind.IntegerValue, TokenKind.SEMI,
+            TokenKind.ORDERBY, TokenKind.EQ, TokenKind.ODataIdentifier, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+  }
+
+  @Test
+  public void queryExpressions() {
+    test.run("$it").has(TokenKind.IT).isText("$it");
+
+    test.run("$filter=contains(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ContainsMethod).isText("contains(");
+
+    test.run("$filter=containsabc").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ODataIdentifier)
+        .isText("containsabc");
+
+    test.run("$filter=startswith(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.StartswithMethod)
+        .isText("startswith(");
+    test.run("$filter=endswith(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.EndswithMethod).isText("endswith(");
+    test.run("$filter=length(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.LengthMethod).isText("length(");
+    test.run("$filter=indexof(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.IndexofMethod).isText("indexof(");
+    test.run("$filter=substring(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.SubstringMethod).isText("substring(");
+    test.run("$filter=tolower(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.TolowerMethod).isText("tolower(");
+    test.run("$filter=toupper(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ToupperMethod).isText("toupper(");
+    test.run("$filter=trim(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.TrimMethod).isText("trim(");
+    test.run("$filter=concat(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ConcatMethod).isText("concat(");
+  }
+
+  @Test
+  public void literalDataValues() {
+    // null
+    test.run("null").has(TokenKind.NULL).isInput();
+
+    // binary
+    test.run("binary'ABCD'").has(TokenKind.BinaryValue).isInput();
+    test.run("BiNaRy'ABCD'").has(TokenKind.BinaryValue).isInput();
+
+    // boolean
+    test.run("true").has(TokenKind.BooleanValue).isInput();
+    test.run("false").has(TokenKind.BooleanValue).isInput();
+    test.run("TrUe").has(TokenKind.BooleanValue).isInput();
+    test.run("FaLsE").has(TokenKind.BooleanValue).isInput();
+
+    // Lexer rule INT
+    test.run("123").has(TokenKind.IntegerValue).isInput();
+    test.run("123456789").has(TokenKind.IntegerValue).isInput();
+    test.run("+123").has(TokenKind.IntegerValue).isInput();
+    test.run("+123456789").has(TokenKind.IntegerValue).isInput();
+    test.run("-123").has(TokenKind.IntegerValue).isInput();
+    test.run("-123456789").has(TokenKind.IntegerValue).isInput();
+
+    // Lexer rule DECIMAL
+    test.run("0.1").has(TokenKind.DecimalValue).isInput();
+    test.run("1.1").has(TokenKind.DecimalValue).isInput();
+    test.run("+0.1").has(TokenKind.DecimalValue).isInput();
+    test.run("+1.1").has(TokenKind.DecimalValue).isInput();
+    test.run("-0.1").has(TokenKind.DecimalValue).isInput();
+    test.run("-1.1").has(TokenKind.DecimalValue).isInput();
+
+    // Lexer rule EXP
+    test.run("1.1e+1").has(TokenKind.DoubleValue).isInput();
+    test.run("1.1e-1").has(TokenKind.DoubleValue).isInput();
+
+    test.run("NaN").has(TokenKind.DoubleValue).isInput();
+    test.run("-INF").has(TokenKind.DoubleValue).isInput();
+    test.run("INF").has(TokenKind.DoubleValue).isInput();
+
+    // Lexer rule GUID
+    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").has(TokenKind.GuidValue).isInput();
+    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").has(TokenKind.GuidValue).isInput();
+
+    // Lexer rule DATE
+    test.run("2013-11-15").has(TokenKind.DateValue).isInput();
+
+    // Lexer rule DATETIMEOFFSET
+    test.run("2013-11-15T13:35Z").has(TokenKind.DateTimeOffsetValue).isInput();
+    test.run("2013-11-15T13:35:10Z").has(TokenKind.DateTimeOffsetValue).isInput();
+    test.run("2013-11-15T13:35:10.1234Z").has(TokenKind.DateTimeOffsetValue).isInput();
+
+    test.run("2013-11-15T13:35:10.1234+01:30").has(TokenKind.DateTimeOffsetValue).isInput();
+    test.run("2013-11-15T13:35:10.1234-01:12").has(TokenKind.DateTimeOffsetValue).isInput();
+
+    test.run("2013-11-15T13:35Z").has(TokenKind.DateTimeOffsetValue).isInput();
+
+    // Lexer rule DURATION
+    test.run("duration'PT67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("duration'PT5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("duration'PT4H'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("duration'P3D'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT5M67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("DuRaTiOn'P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("DuRaTiOn'-P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("20:00").has(TokenKind.TimeOfDayValue).isInput();
+    test.run("20:15:01").has(TokenKind.TimeOfDayValue).isInput();
+    test.run("20:15:01.02").has(TokenKind.TimeOfDayValue).isInput();
+
+    test.run("20:15:01.02").has(TokenKind.TimeOfDayValue).isInput();
+
+    // String
+    test.run("'ABC'").has(TokenKind.StringValue).isInput();
+    test.run("'A%20C'").has(TokenKind.StringValue).isInput();
+    test.run("'%20%20%20ABC'").has(TokenKind.StringValue).isInput();
+  }
+
+  @Test
+  public void delims() {
+    // The last two chars are not in cPCT_ENCODED_UNESCAPED.
+//    final String cPCT_ENCODED = "%45%46%47" + "%22" + "%5C";
+//    final String cUNRESERVED = "ABCabc123-._~";
+//    final String cOTHER_DELIMS = "!()*+,;";
+//    final String cSUB_DELIMS = "$&'=" + cOTHER_DELIMS;
+
+//    private static final String cPCHAR = cUNRESERVED + cPCT_ENCODED + cSUB_DELIMS + ":@";
+//    final String reserved = "/";
+    // Test lexer rule UNRESERVED
+//    test.run("$format=A/" + cUNRESERVED).has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/" + cUNRESERVED + reserved).has(TokenKind.FORMAT).isText(cUNRESERVED);
+    // Test lexer rule PCT_ENCODED
+//    test.run("$format=A/" + cPCT_ENCODED).has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/" + cPCT_ENCODED + reserved).has(TokenKind.FORMAT).isText(cPCT_ENCODED);
+    // Test lexer rule SUB_DELIMS
+//    test.run("$format=A/" + cSUB_DELIMS).has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/" + cSUB_DELIMS + reserved).has(TokenKind.FORMAT).isText("$");
+    // Test lexer rule PCHAR rest
+//    test.run("$format=A/:@").has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/:@" + reserved).has(TokenKind.FORMAT).isText(":@");
+    // Test lexer rule PCHAR all
+//    test.run("$format=" + cPCHAR + "/" + cPCHAR).has(TokenKind.FORMAT).isInput();
+  }
+
+  public class TokenValidator {
+
+    private String input = null;
+    private UriTokenizer tokenizer = null;
+    private String curText = null;
+
+    public TokenValidator run(final String uri) {
+      input = uri;
+      tokenizer = new UriTokenizer(uri);
+      curText = "";
+      return this;
+    }
+
+    public TokenValidator has(final TokenKind... expected) {
+      for (final TokenKind kind : expected) {
+        assertTrue(tokenizer.next(kind));
+        curText += tokenizer.getText();
+      }
+      return this;
+    }
+
+    public TokenValidator isText(final String expected) {
+      assertEquals(expected, tokenizer.getText());
+      return this;
+    }
+
+    public TokenValidator isInput() {
+      assertEquals(input, curText);
+      assertTrue(tokenizer.next(TokenKind.EOF));
+      return this;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriDecoderTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriDecoderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriDecoderTest.java
index 20ab94f..243cb45 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriDecoderTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriDecoderTest.java
@@ -19,7 +19,6 @@
 package org.apache.olingo.server.core.uri.parser;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.Arrays;
@@ -32,13 +31,14 @@ public class UriDecoderTest {
 
   @Test
   public void split() throws Exception {
-    assertTrue(UriDecoder.splitAndDecodePath("").isEmpty());
-    assertTrue(UriDecoder.splitAndDecodePath("/").isEmpty());
+    assertEquals(Arrays.asList(""), UriDecoder.splitAndDecodePath(""));
+    assertEquals(Arrays.asList("", ""), UriDecoder.splitAndDecodePath("/"));
     assertEquals(Arrays.asList("a"), UriDecoder.splitAndDecodePath("a"));
-    assertEquals(Arrays.asList("a"), UriDecoder.splitAndDecodePath("a/"));
-    assertEquals(Arrays.asList("a"), UriDecoder.splitAndDecodePath("/a"));
-    assertEquals(Arrays.asList("a", "a"), UriDecoder.splitAndDecodePath("a/a"));
-    assertEquals(Arrays.asList("a", "a"), UriDecoder.splitAndDecodePath("/a/a"));
+    assertEquals(Arrays.asList("a", ""), UriDecoder.splitAndDecodePath("a/"));
+    assertEquals(Arrays.asList("", "a"), UriDecoder.splitAndDecodePath("/a"));
+    assertEquals(Arrays.asList("a", "b"), UriDecoder.splitAndDecodePath("a/b"));
+    assertEquals(Arrays.asList("", "a", "b"), UriDecoder.splitAndDecodePath("/a/b"));
+    assertEquals(Arrays.asList("", "a", "", "", "b", ""), UriDecoder.splitAndDecodePath("/a///b/"));
   }
 
   @Test
@@ -49,7 +49,7 @@ public class UriDecoderTest {
 
   @Test
   public void options() throws Exception {
-    assertTrue(UriDecoder.splitAndDecodeOptions("").isEmpty());
+    checkOption("", "", "");
 
     checkOption("a", "a", "");
     checkOption("a=b", "a", "b");
@@ -67,6 +67,7 @@ public class UriDecoderTest {
 
     checkOption("=&=", "", "");
     assertEquals(2, UriDecoder.splitAndDecodeOptions("=&=").size());
+    assertEquals(13, UriDecoder.splitAndDecodeOptions("&&&&&&&&&&&&").size());
 
     checkOption("=&c=d", "", "");
     checkOption("=&c=d", "c", "d");

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
index 9bb7d6f..f19fc82 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
@@ -194,7 +194,7 @@ public class SearchParserAndTokenizerTest {
   }
 
   private static Validator assertQuery(final String searchQuery) {
-    return Validator.init(searchQuery);
+    return new Validator(searchQuery);
   }
 
   private static class Validator {
@@ -204,18 +204,12 @@ public class SearchParserAndTokenizerTest {
       this.searchQuery = searchQuery;
     }
 
-    private static Validator init(final String searchQuery) {
-      return new Validator(searchQuery);
-    }
-
-    private void resultsIn(final SearchParserException.MessageKey key)
-        throws SearchTokenizerException {
-
+    private void resultsIn(final SearchParserException.MessageKey key) throws SearchTokenizerException {
       try {
         resultsIn(searchQuery);
-      } catch (SearchParserException e) {
-        Assert.assertEquals("SearchParserException with unexpected message '" + e.getMessage() +
-            "' was thrown.", key, e.getMessageKey());
+      } catch (final SearchParserException e) {
+        Assert.assertEquals("SearchParserException with unexpected message '" + e.getMessage() + "' was thrown.",
+            key, e.getMessageKey());
         return;
       }
       Assert.fail("SearchParserException with message key " + key.getKey() + " was not thrown.");
@@ -224,23 +218,22 @@ public class SearchParserAndTokenizerTest {
     public void resultsInExpectedTerm(final String actualToken) throws SearchTokenizerException {
       try {
         resultsIn(searchQuery);
-      } catch (SearchParserException e) {
+      } catch (final SearchParserException e) {
         Assert.assertEquals(SearchParserException.MessageKeys.EXPECTED_DIFFERENT_TOKEN, e.getMessageKey());
         Assert.assertEquals("Expected PHRASE||WORD found: " + actualToken, e.getMessage());
+        return;
       }
+      Assert.fail("SearchParserException with message key "
+          + SearchParserException.MessageKeys.EXPECTED_DIFFERENT_TOKEN + " was not thrown.");
     }
 
-    private void resultsIn(String expectedSearchExpression) throws SearchTokenizerException, SearchParserException {
-      final SearchExpression searchExpression = getSearchExpression();
-      Assert.assertEquals(expectedSearchExpression, searchExpression.toString());
-    }
-
-    private SearchExpression getSearchExpression() throws SearchParserException, SearchTokenizerException {
-      SearchOption result = new SearchParser().parse(searchQuery);
+    private void resultsIn(final String expectedSearchExpression)
+        throws SearchTokenizerException, SearchParserException {
+      final SearchOption result = new SearchParser().parse(searchQuery);
       Assert.assertNotNull(result);
       final SearchExpression searchExpression = result.getSearchExpression();
       Assert.assertNotNull(searchExpression);
-      return searchExpression;
+      Assert.assertEquals(expectedSearchExpression, searchExpression.toString());
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
index 780c209..40be4ac 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
@@ -224,34 +224,34 @@ public class SearchParserTest extends SearchParser {
   private void runEx(final MessageKeys key, final Token... tokenArray) {
     try {
       run(tokenArray);
-      fail("Expected UriParserSyntaxException with key " + key);
+      fail("Expected SearchParserException with key " + key);
     } catch (SearchParserException e) {
       assertEquals(key, e.getMessageKey());
     }
   }
 
-  private SearchExpression run(final SearchQueryToken.Token... tokenArray) throws SearchParserException {
+  private SearchExpression run(final Token... tokenArray) throws SearchParserException {
     List<SearchQueryToken> tokenList = prepareTokens(tokenArray);
     SearchExpression se = parse(tokenList);
     assertNotNull(se);
     return se;
   }
 
-  public List<SearchQueryToken> prepareTokens(final SearchQueryToken.Token... tokenArray) {
+  public List<SearchQueryToken> prepareTokens(final Token... tokenArray) {
     ArrayList<SearchQueryToken> tokenList = new ArrayList<SearchQueryToken>();
     int wordNumber = 1;
     int phraseNumber = 1;
-    for (Token aTokenArray : tokenArray) {
+    for (Token aToken : tokenArray) {
       SearchQueryToken token = mock(SearchQueryToken.class);
-      when(token.getToken()).thenReturn(aTokenArray);
-      if (aTokenArray == Token.WORD) {
+      when(token.getToken()).thenReturn(aToken);
+      if (aToken == Token.WORD) {
         when(token.getLiteral()).thenReturn("word" + wordNumber);
         wordNumber++;
-      } else if (aTokenArray == Token.PHRASE) {
+      } else if (aToken == Token.PHRASE) {
         when(token.getLiteral()).thenReturn("\"phrase" + phraseNumber + "\"");
         phraseNumber++;
       }
-      when(token.toString()).thenReturn("" + aTokenArray);
+      when(token.toString()).thenReturn("" + aToken);
       tokenList.add(token);
     }
     return tokenList;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
index a6c1375..8179027 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
@@ -269,7 +269,7 @@ public class SearchTokenizerTest {
     assertQuery("\"\"").resultsIn(SearchTokenizerException.MessageKeys.INVALID_TOKEN_STATE);
     assertQuery("some AND)").resultsIn(SearchTokenizerException.MessageKeys.FORBIDDEN_CHARACTER);
     assertQuery("some OR)").resultsIn(SearchTokenizerException.MessageKeys.FORBIDDEN_CHARACTER);
-    assertQuery("some NOT)").enableLogging().resultsIn(SearchTokenizerException.MessageKeys.FORBIDDEN_CHARACTER);
+    assertQuery("some NOT)").resultsIn(SearchTokenizerException.MessageKeys.FORBIDDEN_CHARACTER);
   }
 
   @Test
@@ -308,7 +308,6 @@ public class SearchTokenizerTest {
 
   private static class Validator {
     private List<Tuple> validations = new ArrayList<Tuple>();
-    private boolean log;
     private final String searchQuery;
 
     public void resultsIn(final SearchQueryToken.Token... tokens) throws SearchTokenizerException {
@@ -345,11 +344,6 @@ public class SearchTokenizerTest {
       this.searchQuery = searchQuery;
     }
 
-    private Validator enableLogging() {
-      log = true;
-      return this;
-    }
-
     private Validator addExpected(final SearchQueryToken.Token token, final String literal) {
       validations.add(new Tuple(token, literal));
       return this;
@@ -368,10 +362,6 @@ public class SearchTokenizerTest {
         validate();
       } catch (SearchTokenizerException e) {
         Assert.assertEquals("SearchTokenizerException with unexpected message was thrown.", key, e.getMessageKey());
-        if (log) {
-          System.out.println("Caught SearchTokenizerException with message key " +
-              e.getMessageKey() + " and message " + e.getMessage());
-        }
         return;
       }
       Assert.fail("No SearchTokenizerException was not thrown.");
@@ -381,9 +371,6 @@ public class SearchTokenizerTest {
       SearchTokenizer tokenizer = new SearchTokenizer();
       List<SearchQueryToken> result = tokenizer.tokenize(searchQuery);
       Assert.assertNotNull(result);
-      if (log) {
-        System.out.println(result);
-      }
       if (validations.size() != 0) {
         Assert.assertEquals(validations.size(), result.size());
 


[34/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] better debug output

Posted by mi...@apache.org.
[OLINGO-834] better debug output

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: b881e9caac3a76d4e3fefdeac9e5b48666031bcb
Parents: 3295bcc
Author: Klaus Straubinger <kl...@sap.com>
Authored: Wed Jan 13 16:16:29 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Jan 18 13:29:41 2016 +0100

----------------------------------------------------------------------
 .../search/SearchBinaryOperatorKind.java        | 27 ++++-------
 .../search/SearchUnaryOperatorKind.java         | 20 +--------
 .../olingo/server/core/debug/DebugTabUri.java   | 47 +++++++++++++-------
 3 files changed, 42 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b881e9ca/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
index 224d3c1..0f174cb 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
@@ -19,27 +19,16 @@
 package org.apache.olingo.server.api.uri.queryoption.search;
 
 public enum SearchBinaryOperatorKind {
-  // and/or
-  AND("and"), OR("or");
-
-  private String syntax;
-
-  private SearchBinaryOperatorKind(final String syntax) {
-    this.syntax = syntax;
-  }
-
-  @Override
-  public String toString() {
-    return syntax;
-  }
+  AND,
+  OR;
 
   public static SearchBinaryOperatorKind get(final String operator) {
-    for (SearchBinaryOperatorKind op : SearchBinaryOperatorKind.values()) {
-      if (op.toString().equals(operator)) {
-        return op;
-      }
+    if (AND.name().equals(operator)) {
+      return AND;
+    } else if (OR.name().equals(operator)) {
+      return OR;
+    } else {
+      return null;
     }
-    return null;
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b881e9ca/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
index 07d1302..bbc9ba6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
@@ -19,25 +19,9 @@
 package org.apache.olingo.server.api.uri.queryoption.search;
 
 public enum SearchUnaryOperatorKind {
-  NOT("not");
-
-  private String syntax;
-
-  private SearchUnaryOperatorKind(final String syntax) {
-    this.syntax = syntax;
-  }
-
-  @Override
-  public String toString() {
-    return syntax;
-  }
+  NOT;
 
   public static SearchUnaryOperatorKind get(final String operator) {
-    for (SearchUnaryOperatorKind op : SearchUnaryOperatorKind.values()) {
-      if (op.toString().equals(operator)) {
-        return op;
-      }
-    }
-    return null;
+    return NOT.equals(operator) ? NOT : null;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b881e9ca/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
index 906db19..7909334 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
@@ -27,11 +27,13 @@ import java.util.Map;
 
 import org.apache.olingo.commons.api.ex.ODataException;
 import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.api.uri.UriInfoKind;
 import org.apache.olingo.server.api.uri.UriParameter;
 import org.apache.olingo.server.api.uri.UriResource;
 import org.apache.olingo.server.api.uri.UriResourceEntitySet;
 import org.apache.olingo.server.api.uri.UriResourceFunction;
 import org.apache.olingo.server.api.uri.UriResourceNavigation;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
 import org.apache.olingo.server.api.uri.queryoption.CountOption;
 import org.apache.olingo.server.api.uri.queryoption.ExpandItem;
 import org.apache.olingo.server.api.uri.queryoption.ExpandOption;
@@ -72,7 +74,8 @@ public class DebugTabUri implements DebugTab {
   public void appendJson(final JsonGenerator gen) throws IOException {
     gen.writeStartObject();
 
-    if (!uriInfo.getUriResourceParts().isEmpty()) {
+    gen.writeStringField("kind", uriInfo.getKind().name());
+    if (uriInfo.getKind() == UriInfoKind.resource) {
       gen.writeFieldName("uriResourceParts");
       appendURIResourceParts(gen, uriInfo.getUriResourceParts());
     }
@@ -161,6 +164,10 @@ public class DebugTabUri implements DebugTab {
       gen.writeStartObject();
       gen.writeStringField("uriResourceKind", resource.getKind().toString());
       gen.writeStringField("segment", resource.toString());
+      if (resource instanceof UriResourcePartTyped && ((UriResourcePartTyped) resource).getType() != null) {
+        gen.writeStringField("type",
+            ((UriResourcePartTyped) resource).getType().getFullQualifiedName().getFullQualifiedNameAsString());
+      }
       if (resource instanceof UriResourceEntitySet) {
         appendParameters(gen, "keys", ((UriResourceEntitySet) resource).getKeyPredicates());
       } else if (resource instanceof UriResourceNavigation) {
@@ -231,7 +238,12 @@ public class DebugTabUri implements DebugTab {
     }
 
     if (item.getLevelsOption() != null) {
-      gen.writeNumberField("levels", item.getLevelsOption().getValue());
+      gen.writeFieldName("levels");
+      if (item.getLevelsOption().isMax()) {
+          gen.writeString("max");
+      } else {
+        gen.writeNumber(item.getLevelsOption().getValue());
+      }
     }
 
     appendCommonJsonObjects(gen, item.getCountOption(), item.getSkipOption(), item.getTopOption(),
@@ -275,9 +287,9 @@ public class DebugTabUri implements DebugTab {
       boolean first = true;
       for (UriResource resourcePart : selectItem.getResourcePath().getUriResourceParts()) {
         if (!first) {
-          selectedProperty += "/";
+          selectedProperty += '/';
         }
-        selectedProperty = resourcePart.toString();
+        selectedProperty += resourcePart.toString();
         first = false;
       }
     }
@@ -309,17 +321,22 @@ public class DebugTabUri implements DebugTab {
   public void appendHtml(final Writer writer) throws IOException {
     // factory for JSON generators (the object mapper is necessary to write expression trees)
     final JsonFactory jsonFactory = new ObjectMapper().getFactory();
+    JsonGenerator json;
 
-    writer.append("<h2>Resource Path</h2>\n")
-    .append("<ul>\n<li class=\"json\">");
-    JsonGenerator json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
-    appendURIResourceParts(json, uriInfo.getUriResourceParts());
-    json.close();
-    writer.append("\n</li>\n</ul>\n");
+    if (uriInfo.getKind() == UriInfoKind.resource) {
+      writer.append("<h2>Resource Path</h2>\n")
+          .append("<ul>\n<li class=\"json\">");
+      json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
+      appendURIResourceParts(json, uriInfo.getUriResourceParts());
+      json.close();
+      writer.append("\n</li>\n</ul>\n");
+    } else {
+      writer.append("<h2>Kind</h2>\n<p>").append(uriInfo.getKind().name()).append("</p>\n");
+    }
 
     if (uriInfo.getSearchOption() != null) {
       writer.append("<h2>Search Option</h2>\n")
-      .append("<ul>\n<li class=\"json\">");
+          .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendSearchJson(json, uriInfo.getSearchOption().getSearchExpression());
       json.close();
@@ -328,7 +345,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getFilterOption() != null) {
       writer.append("<h2>Filter Option</h2>\n")
-      .append("<ul>\n<li class=\"json\">");
+          .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendExpressionJson(json, uriInfo.getFilterOption().getExpression());
       json.close();
@@ -337,7 +354,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getOrderByOption() != null) {
       writer.append("<h2>OrderBy Option</h2>\n")
-      .append("<ul>\n<li class=\"json\">");
+          .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendOrderByItemsJson(json, uriInfo.getOrderByOption().getOrders());
       json.close();
@@ -346,7 +363,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getExpandOption() != null) {
       writer.append("<h2>Expand Option</h2>\n")
-      .append("<ul>\n<li class=\"json\">");
+          .append("<ul>\n<li class=\"json\">");
       json = jsonFactory.createGenerator(writer).useDefaultPrettyPrinter();
       appendExpandedPropertiesJson(json, uriInfo.getExpandOption().getExpandItems());
       json.close();
@@ -355,7 +372,7 @@ public class DebugTabUri implements DebugTab {
 
     if (uriInfo.getSelectOption() != null) {
       writer.append("<h2>Selected Properties</h2>\n")
-      .append("<ul>\n");
+          .append("<ul>\n");
       for (final SelectItem selectItem : uriInfo.getSelectOption().getSelectItems()) {
         writer.append("<li>").append(getSelectString(selectItem)).append("</li>\n");
       }


[11/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] ExpressionParser parses path expressions

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
index e9f1c07..ec9cc22 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
@@ -82,13 +82,8 @@ public class TestFullResourcePath {
         .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
         .isKeyPredicate(1, "PropertyDefString", "'abc'");
 
-    testUri
-        .run("ESMixEnumDefCollComp", "$filter=PropertyEnumString has Namespace1_Alias.ENString'String1'")
-        .goPath()
-        .at(0)
-        .isEntitySet("ESMixEnumDefCollComp")
-        .goUpUriValidator()
-        .goFilter().is("<<PropertyEnumString> has <olingo.odata.test1.ENString<String1>>>");
+    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has Namespace1_Alias.ENString'String1'")
+        .is("<<PropertyEnumString> has <olingo.odata.test1.ENString<String1>>>");
 
     testUri
         .run("ESMixEnumDefCollComp(PropertyEnumString=Namespace1_Alias.ENString'String1',PropertyDefString='abc')")
@@ -100,7 +95,7 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void testFunctionBound_varOverloading() throws Exception {
+  public void functionBound_varOverloading() throws Exception {
     // on ESTwoKeyNav
     testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
         .at(0)
@@ -941,7 +936,10 @@ public class TestFullResourcePath {
     testUri.run("$crossjoin(ESKeyNav,ESTwoKeyNav)")
         .isKind(UriInfoKind.crossjoin)
         .isCrossJoinEntityList(Arrays.asList("ESKeyNav", "ESTwoKeyNav"));
+  }
 
+  @Test
+  public void crossjoinFilter() throws Exception {
     testUri.run("$crossjoin(ESTwoPrim,ESMixPrimCollComp)",
         "$filter=ESTwoPrim/PropertyString eq ESMixPrimCollComp/PropertyComp/PropertyString")
         .goFilter()
@@ -950,7 +948,7 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void runCrossjoinError() throws Exception {
+  public void crossjoinError() throws Exception {
     testUri.runEx("$crossjoin").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testUri.runEx("$crossjoin/error").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
     testUri.runEx("$crossjoin()").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
@@ -1031,20 +1029,20 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void resourcePathWithApostrophe() {
+  public void resourcePathWithApostrophe() throws Exception {
     testUri.runEx("ESAllPrim'").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testUri.runEx("ESAllPrim'InvalidStuff").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
 
-    testUri.runEx("ESAllPrim", "$filter=PropertyInt16' eq 0")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETKeyNavEx("PropertyInt16' eq 0")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
 
-    testUri.runEx("ESAllPrim", "$filter=PropertyInt16 eq' 0")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETKeyNavEx("PropertyInt16 eq' 0")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
 
-    testUri.runEx("ESAllPrim", "$filter=PropertyInt16 eq 0'")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETKeyNavEx("PropertyInt16 eq 0'")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
 
-    testUri.runEx("ESAllPrim", "$filter=PropertyInt16 eq 'dsd''")
+    testFilter.runOnETKeyNavEx("PropertyInt16 eq 'dsd''")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
   }
 
@@ -1334,14 +1332,6 @@ public class TestFullResourcePath {
 
   @Test
   public void runEsNameKeyCast() throws Exception {
-    // testUri.runEx("ESTwoPrim(1)/olingo.odata.test1.ETBase(1)")
-    // .isExSemantic(MessageKeys.xxx);
-
-    // testUri.runEx("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase(1)")
-    // .isExSemantic(MessageKeys.xxx);
-
-    testUri.runEx("ESBase/olingo.odata.test1.ETTwoPrim(1)").isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
-
     testUri.run("ESTwoPrim(1)/olingo.odata.test1.ETBase")
         .isKind(UriInfoKind.resource).goPath()
         .first()
@@ -1388,6 +1378,15 @@ public class TestFullResourcePath {
         .isEntitySet("ESTwoPrim")
         .isType(EntityTypeProvider.nameETTwoPrim)
         .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
+
+    // TODO: Keys cannot be specified twice.
+    //testUri.runEx("ESTwoPrim(1)/olingo.odata.test1.ETBase(1)")
+    //    .isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
+
+    //testUri.runEx("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase(1)")
+    //    .isExSemantic(MessageKeys.TYPE_FILTER_NOT_CHAINABLE);
+
+    testUri.runEx("ESBase/olingo.odata.test1.ETTwoPrim(1)").isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
   }
 
   @Test
@@ -2620,9 +2619,7 @@ public class TestFullResourcePath {
         .goExpand().first()
         .isExpandStartType(EntityTypeProvider.nameETBaseTwoKeyNav)
         .goPath().first()
-        // .isType(EntityTypeProvider.nameETTwoKeyNav)
-        // .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        // .n()
+        .isType(EntityTypeProvider.nameETKeyNav)
         .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
 
     testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')",
@@ -2633,9 +2630,7 @@ public class TestFullResourcePath {
         .goExpand().first()
         .isExpandStartType(EntityTypeProvider.nameETBaseTwoKeyNav)
         .goPath().first()
-        // .isType(EntityTypeProvider.nameETTwoKeyNav)
-        // .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        // .n()
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
         .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
 
     testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')",
@@ -2647,9 +2642,7 @@ public class TestFullResourcePath {
         .goExpand().first()
         .isExpandStartType(EntityTypeProvider.nameETBaseTwoKeyNav)
         .goPath().first()
-        // .isType(EntityTypeProvider.nameETTwoKeyNav)
-        // .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        // .n()
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
         .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
         .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
 
@@ -2658,11 +2651,7 @@ public class TestFullResourcePath {
         .goExpand().first()
         .isExpandStartType(EntityTypeProvider.nameETBaseTwoKeyNav)
         .goPath().first()
-        // .isType(EntityTypeProvider.nameETTwoKeyNav)
-        // .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        // .n()
-        .isComplex("PropertyCompNav")
-        .isType(ComplexTypeProvider.nameCTBasePrimCompNav)
+        .isComplexProperty("PropertyCompNav", ComplexTypeProvider.nameCTBasePrimCompNav, false)
         .n()
         .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
 
@@ -2672,11 +2661,8 @@ public class TestFullResourcePath {
         .goExpand().first()
         .isExpandStartType(EntityTypeProvider.nameETBaseTwoKeyNav)
         .goPath().first()
-        // .isType(EntityTypeProvider.nameETTwoKeyNav)
-        // .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        // .n()
-        .isComplex("PropertyCompNav")
-        .isType(ComplexTypeProvider.nameCTBasePrimCompNav)
+        .isComplexProperty("PropertyCompNav", ComplexTypeProvider.nameCTBasePrimCompNav, false)
+        .isTypeFilter(ComplexTypeProvider.nameCTTwoBasePrimCompNav)
         .n()
         .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
 
@@ -2704,10 +2690,7 @@ public class TestFullResourcePath {
         .goExpand().first()
         .isExpandStartType(EntityTypeProvider.nameETBaseTwoKeyNav)
         .goPath().first()
-        // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
-        // .isType(EntityTypeProvider.nameETTwoKeyNav)
-        // .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        // .n().isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
         .isType(EntityTypeProvider.nameETTwoKeyNav)
         .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
         .goUpExpandValidator()
@@ -3246,7 +3229,9 @@ public class TestFullResourcePath {
 
   }
 
+  // TODO
   @Test
+  @Ignore
   public void filter() throws Exception {
 
     testFilter.runOnETTwoKeyNav("PropertyString")
@@ -3311,9 +3296,6 @@ public class TestFullResourcePath {
         .root().left()
         .isType(PropertyProvider.nameDate)
         .isMember().isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
-        // .first().isUriPathInfoKind(UriResourceKind.startingTypeFilter)
-        // .isType(EntityTypeProvider.nameETTwoKeyNav).isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
-        // .n().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false)
         .first().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false)
         .goUpFilterValidator()
         .root().right()
@@ -3324,9 +3306,6 @@ public class TestFullResourcePath {
         .root().left()
         .isType(PropertyProvider.nameString)
         .isMember().isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
-        // .first().isUriPathInfoKind(UriResourceKind.startingTypeFilter)
-        // .isType(EntityTypeProvider.nameCTTwoPrim).isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase)
-        // .n().isPrimitiveProperty("AdditionalPropString", PropertyProvider.nameString, false)
         .first().isPrimitiveProperty("AdditionalPropString", PropertyProvider.nameString, false)
         .goUpFilterValidator()
         .root().right()
@@ -3352,19 +3331,18 @@ public class TestFullResourcePath {
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     // TODO: This should throw an exception because the top node of the filter tree must be boolean.
     // testFilter.runOnETTwoKeyNavEx("PropertyComp")
-    // .isExSemantic(MessageKeys.XYZ);
+    //     .isExSemantic(MessageKeys.UNKNOWN_TYPE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/invalid")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOnETTwoKeyNavEx("concat('a','b')/invalid").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/concat('a','b')")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    // TODO: These should throw exceptions because the types are incompatible.
-    // testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyInt16 eq '1'")
-    // .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    // testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyComp/PropertyDate eq 1")
-    // .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-    // testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyComp/PropertyString eq 1")
-    // .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyInt16 eq '1'")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyComp/PropertyDate eq 1")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyComp/PropertyString eq 1")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyInt64 eq 1")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOnETTwoKeyNavEx("NavPropertyETKeyNavMany/PropertyInt16 gt 42")
@@ -3788,8 +3766,155 @@ public class TestFullResourcePath {
         .right().isLiteral("INF").isType(PropertyProvider.nameDecimal);
   }
 
+  // TODO
   @Test
+  @Ignore
   public void filterProperties() throws Exception {
+    testFilter.runOnETAllPrim("PropertyBoolean eq true")
+        .is("<<PropertyBoolean> eq <true>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyBoolean", PropertyProvider.nameBoolean, false)
+        .goUpFilterValidator()
+        .root().right().isTrue();
+
+    testFilter.runOnETAllPrim("PropertyDecimal eq 1.25")
+        .is("<<PropertyDecimal> eq <1.25>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyDecimal", PropertyProvider.nameDecimal, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("1.25");
+
+    testFilter.runOnETAllPrim("PropertyDouble eq 1.5")
+        .is("<<PropertyDouble> eq <1.5>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyDouble", PropertyProvider.nameDouble, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("1.5");
+
+    testFilter.runOnETAllPrim("PropertySingle eq 1.5")
+        .is("<<PropertySingle> eq <1.5>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertySingle", PropertyProvider.nameSingle, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("1.5");
+
+    testFilter.runOnETAllPrim("PropertySByte eq -128")
+        .is("<<PropertySByte> eq <-128>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertySByte", PropertyProvider.nameSByte, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("-128");
+
+    testFilter.runOnETAllPrim("PropertyByte eq 255")
+        .is("<<PropertyByte> eq <255>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyByte",
+            PropertyProvider.nameByte, false).goUpFilterValidator()
+        .root().right().isLiteral("255");
+
+    testFilter.runOnETAllPrim("PropertyInt16 eq 32767")
+        .is("<<PropertyInt16> eq <32767>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("32767");
+
+    testFilter.runOnETAllPrim("PropertyInt32 eq 2147483647")
+        .is("<<PropertyInt32> eq <2147483647>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyInt32", PropertyProvider.nameInt32, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("2147483647");
+
+    testFilter.runOnETAllPrim("PropertyInt64 eq 9223372036854775807")
+        .is("<<PropertyInt64> eq <9223372036854775807>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyInt64", PropertyProvider.nameInt64, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("9223372036854775807");
+
+    testFilter.runOnETAllPrim("PropertyDate eq 2013-09-25")
+        .is("<<PropertyDate> eq <2013-09-25>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("2013-09-25");
+
+    testFilter.runOnETAllPrim("PropertyDateTimeOffset eq 2013-09-25T12:34:56.123456789012-10:24")
+        .is("<<PropertyDateTimeOffset> eq <2013-09-25T12:34:56.123456789012-10:24>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath()
+        .isPrimitiveProperty("PropertyDateTimeOffset", PropertyProvider.nameDateTimeOffset, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("2013-09-25T12:34:56.123456789012-10:24");
+
+    testFilter.runOnETAllPrim("PropertyDuration eq duration'P10DT5H34M21.123456789012S'")
+        .is("<<PropertyDuration> eq <duration'P10DT5H34M21.123456789012S'>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyDuration", PropertyProvider.nameDuration, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("duration'P10DT5H34M21.123456789012S'");
+
+    testFilter.runOnETAllPrim("PropertyGuid eq 005056A5-09B1-1ED3-89BD-FB81372CCB33")
+        .is("<<PropertyGuid> eq <005056A5-09B1-1ED3-89BD-FB81372CCB33>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyGuid", PropertyProvider.nameGuid, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("005056A5-09B1-1ED3-89BD-FB81372CCB33");
+
+    testFilter.runOnETAllPrim("PropertyString eq 'somestring'")
+        .is("<<PropertyString> eq <'somestring'>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("'somestring'");
+
+    testFilter.runOnETAllPrim("PropertyTimeOfDay eq 12:34:55.12345678901")
+        .is("<<PropertyTimeOfDay> eq <12:34:55.12345678901>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyTimeOfDay", PropertyProvider.nameTimeOfDay, false)
+        .goUpFilterValidator()
+        .root().right().isLiteral("12:34:55.12345678901");
+
+    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1'")
+        .is("<<PropertyEnumString> eq <olingo.odata.test1.ENString<String1>>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
+        .goUpFilterValidator()
+        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1"));
+
+    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String2'")
+        .is("<<PropertyEnumString> eq <olingo.odata.test1.ENString<String2>>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
+        .goUpFilterValidator()
+        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String2"));
+
+    testFilter.runOnETMixEnumDefCollComp(
+        "PropertyCompMixedEnumDef/PropertyEnumString eq olingo.odata.test1.ENString'String3'")
+        .is("<<PropertyCompMixedEnumDef/PropertyEnumString> eq <olingo.odata.test1.ENString<String3>>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath()
+        .first().isComplex("PropertyCompMixedEnumDef")
+        .n().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
+        .goUpFilterValidator()
+        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String3"));
+
+    testFilter
+        .runOnETMixEnumDefCollComp(
+            "PropertyCompMixedEnumDef/PropertyEnumString eq " +
+                "PropertyCompMixedEnumDef/PropertyEnumString")
+        .is("<<PropertyCompMixedEnumDef/PropertyEnumString> eq " +
+            "<PropertyCompMixedEnumDef/PropertyEnumString>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .root().left().goPath()
+        .first().isComplex("PropertyCompMixedEnumDef")
+        .n().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
+        .goUpFilterValidator()
+        .root().right().goPath()
+        .first().isComplex("PropertyCompMixedEnumDef")
+        .n().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false);
+
     testFilter.runOnETAllPrim("PropertyByte mod 0")
         .is("<<PropertyByte> mod <0>>");
 
@@ -3953,9 +4078,10 @@ public class TestFullResourcePath {
         .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
   }
 
+  // TODO: $it on primitive types?
   @Test
-  public void filterPMethods() throws Exception {
-
+  @Ignore
+  public void methods() throws Exception {
     testFilter.runOnETKeyNav("indexof(PropertyString,'47') eq 5")
         .is("<<indexof(<PropertyString>,<'47'>)> eq <5>>")
         .root().left()
@@ -4024,16 +4150,6 @@ public class TestFullResourcePath {
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<'bar'>");
 
-    testFilter.runOnETKeyNav("concat(PropertyString, cast(PropertyCompAllPrim/PropertyInt16,Edm.String))")
-        .is("<concat(<PropertyString>,<cast(<PropertyCompAllPrim/PropertyInt16>,<Edm.String>)>)>")
-        .isMethod(MethodKind.CONCAT, 2)
-        .isParameterText(0, "<PropertyString>")
-        .isParameterText(1, "<cast(<PropertyCompAllPrim/PropertyInt16>,<Edm.String>)>")
-        .goParameter(1)
-        .isMethod(MethodKind.CAST, 2)
-        .isParameterText(0, "<PropertyCompAllPrim/PropertyInt16>")
-        .isParameterText(1, "<Edm.String>");
-
     testFilter.runOnETKeyNav("length(PropertyString) eq 32")
         .is("<<length(<PropertyString>)> eq <32>>")
         .root().left()
@@ -4416,59 +4532,167 @@ public class TestFullResourcePath {
         .isType(EntityTypeProvider.nameETTwoKeyNav, true)
         .n().isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
 
-    testFilter.runOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyInt16 eq $root"
-        + "/ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyInt16")
-        .is("<<PropertyComp/PropertyComp/PropertyInt16> eq <$root/ESTwoKeyNav/PropertyInt16>>")
-        .root().left()
-        .goPath()
-        .first().isComplex("PropertyComp").isType(ComplexTypeProvider.nameCTPrimComp, false)
-        .n().isComplex("PropertyComp").isType(ComplexTypeProvider.nameCTAllPrim, false)
-        .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
-        .goUpFilterValidator()
-        .root().right()
-        .goPath()
-        .first().isUriPathInfoKind(UriResourceKind.root)
-        .n().isEntitySet("ESTwoKeyNav")
-        .isKeyPredicate(0, "PropertyInt16", "1")
-        .isKeyPredicate(1, "PropertyString", "'2'")
-        .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
-    testFilter.runOnETKeyNav("cast(olingo.odata.test1.ETBaseTwoKeyNav)")
-        .is("<cast(<olingo.odata.test1.ETBaseTwoKeyNav>)>")
-        .root()
-        .isMethod(MethodKind.CAST, 1)
-        .isParameterText(0, "<olingo.odata.test1.ETBaseTwoKeyNav>")
-        .goParameter(0)
-        .isTypedLiteral(EntityTypeProvider.nameETBaseTwoKeyNav);
+    testFilter.runOnETTwoKeyNav("endswith(PropertyComp/PropertyComp/PropertyString,'dorf')")
+        .is("<endswith(<PropertyComp/PropertyComp/PropertyString>,<'dorf'>)>")
+        .isMethod(MethodKind.ENDSWITH, 2)
+        .goParameter(0).goPath()
+        .first().isComplex("PropertyComp")
+        .n().isComplex("PropertyComp")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
+        .root().goParameter(1).isLiteral("'dorf'");
 
-    testFilter.runOnETKeyNav("cast(PropertyCompTwoPrim,olingo.odata.test1.CTBase)")
-        .is("<cast(<PropertyCompTwoPrim>,<olingo.odata.test1.CTBase>)>")
-        .root()
-        .isMethod(MethodKind.CAST, 2)
-        .isParameterText(0, "<PropertyCompTwoPrim>")
-        .isParameterText(1, "<olingo.odata.test1.CTBase>")
-        .goParameter(0).goPath().first()
-        .isComplex("PropertyCompTwoPrim").isType(ComplexTypeProvider.nameCTTwoPrim, false)
-        .goUpFilterValidator()
-        .root()
-        .goParameter(1)
-        .isTypedLiteral(ComplexTypeProvider.nameCTBase);
+    testFilter.runOnETTwoKeyNav("endswith(PropertyComp/PropertyComp/PropertyString,'dorf') eq true")
+        .is("<<endswith(<PropertyComp/PropertyComp/PropertyString>,<'dorf'>)> eq <true>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isMethod(MethodKind.ENDSWITH, 2)
+        .goParameter(0).goPath()
+        .first().isComplex("PropertyComp")
+        .n().isComplex("PropertyComp")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
+        .root().left().goParameter(1).isLiteral("'dorf'");
 
-    testFilter.runOnETKeyNav("cast($it,olingo.odata.test1.CTBase)")
-        .is("<cast(<$it>,<olingo.odata.test1.CTBase>)>")
-        .root()
-        .isMethod(MethodKind.CAST, 2)
-        .isParameterText(0, "<$it>")
-        .isParameterText(1, "<olingo.odata.test1.CTBase>")
-        .goParameter(0).goPath().first()
-        .isIt().isType(EntityTypeProvider.nameETKeyNav, false)
-        .goUpFilterValidator()
-        .root()
-        .goParameter(1).isTypedLiteral(ComplexTypeProvider.nameCTBase);
+    testFilter.runOnETTwoKeyNav("endswith('Walldorf','dorf')")
+        .is("<endswith(<'Walldorf'>,<'dorf'>)>")
+        .isMethod(MethodKind.ENDSWITH, 2)
+        .goParameter(0).isLiteral("'Walldorf'")
+        .root().goParameter(1).isLiteral("'dorf'");
 
-    testFilter.runOnETKeyNav("cast($it,olingo.odata.test1.CTBase) eq cast($it,olingo.odata.test1.CTBase)"
-        )
-        .is("<<cast(<$it>,<olingo.odata.test1.CTBase>)> eq <cast(<$it>,<olingo.odata.test1.CTBase>)>>")
+    testFilter.runOnETTwoKeyNav("endswith('Walldorf','dorf') eq true")
+        .is("<<endswith(<'Walldorf'>,<'dorf'>)> eq <true>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isMethod(MethodKind.ENDSWITH, 2)
+        .goParameter(0).isLiteral("'Walldorf'")
+        .root().left().goParameter(1).isLiteral("'dorf'");
+
+    testFilter.runOnETKeyNav("startswith(PropertyCompAllPrim/PropertyString,'Wall')")
+        .is("<startswith(<PropertyCompAllPrim/PropertyString>,<'Wall'>)>")
+        .isMethod(MethodKind.STARTSWITH, 2)
+        .goParameter(0).goPath()
+        .first().isComplex("PropertyCompAllPrim")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
+        .root().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETKeyNav("startswith(PropertyCompAllPrim/PropertyString,'Wall') eq true")
+        .is("<<startswith(<PropertyCompAllPrim/PropertyString>,<'Wall'>)> eq <true>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isMethod(MethodKind.STARTSWITH, 2)
+        .goParameter(0).goPath()
+        .first().isComplex("PropertyCompAllPrim")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
+        .root().left().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETKeyNav("startswith('Walldorf','Wall')")
+        .is("<startswith(<'Walldorf'>,<'Wall'>)>")
+        .isMethod(MethodKind.STARTSWITH, 2)
+        .goParameter(0).isLiteral("'Walldorf'")
+        .root().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETKeyNav("startswith('Walldorf','Wall') eq true")
+        .is("<<startswith(<'Walldorf'>,<'Wall'>)> eq <true>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isMethod(MethodKind.STARTSWITH, 2)
+        .goParameter(0).isLiteral("'Walldorf'")
+        .root().left().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETTwoKeyNav("contains(PropertyComp/PropertyComp/PropertyString,'Wall')")
+        .is("<contains(<PropertyComp/PropertyComp/PropertyString>,<'Wall'>)>")
+        .isMethod(MethodKind.CONTAINS, 2)
+        .goParameter(0).goPath()
+        .first().isComplex("PropertyComp")
+        .n().isComplex("PropertyComp")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
+        .root().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETTwoKeyNav("contains(PropertyComp/PropertyComp/PropertyString,'Wall') eq true")
+        .is("<<contains(<PropertyComp/PropertyComp/PropertyString>,<'Wall'>)> eq <true>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isMethod(MethodKind.CONTAINS, 2)
+        .goParameter(0).goPath()
+        .first().isComplex("PropertyComp")
+        .n().isComplex("PropertyComp")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
+        .root().left().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETTwoKeyNav("contains('Walldorf','Wall')")
+        .is("<contains(<'Walldorf'>,<'Wall'>)>")
+        .isMethod(MethodKind.CONTAINS, 2)
+        .goParameter(0).isLiteral("'Walldorf'")
+        .root().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETTwoKeyNav("contains('Walldorf','Wall') eq true")
+        .is("<<contains(<'Walldorf'>,<'Wall'>)> eq <true>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isMethod(MethodKind.CONTAINS, 2)
+        .goParameter(0).isLiteral("'Walldorf'")
+        .root().left().goParameter(1).isLiteral("'Wall'");
+
+    testFilter.runOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyInt16 eq "
+        + "$root/ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyInt16")
+        .is("<<PropertyComp/PropertyComp/PropertyInt16> eq <$root/ESTwoKeyNav/PropertyInt16>>")
+        .root().left()
+        .goPath()
+        .first().isComplex("PropertyComp").isType(ComplexTypeProvider.nameCTPrimComp, false)
+        .n().isComplex("PropertyComp").isType(ComplexTypeProvider.nameCTAllPrim, false)
+        .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+        .goUpFilterValidator()
+        .root().right()
+        .goPath()
+        .first().isUriPathInfoKind(UriResourceKind.root)
+        .n().isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+  }
+
+  // TODO: Implement cast method.
+  @Test
+  @Ignore
+  public void castMethod() throws Exception {
+    testFilter.runOnETKeyNav("cast(olingo.odata.test1.ETBaseTwoKeyNav)")
+        .is("<cast(<olingo.odata.test1.ETBaseTwoKeyNav>)>")
+        .root()
+        .isMethod(MethodKind.CAST, 1)
+        .isParameterText(0, "<olingo.odata.test1.ETBaseTwoKeyNav>")
+        .goParameter(0)
+        .isTypedLiteral(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+    testFilter.runOnETKeyNav("cast(PropertyCompTwoPrim,olingo.odata.test1.CTBase)")
+        .is("<cast(<PropertyCompTwoPrim>,<olingo.odata.test1.CTBase>)>")
+        .root()
+        .isMethod(MethodKind.CAST, 2)
+        .isParameterText(0, "<PropertyCompTwoPrim>")
+        .isParameterText(1, "<olingo.odata.test1.CTBase>")
+        .goParameter(0).goPath().first()
+        .isComplex("PropertyCompTwoPrim").isType(ComplexTypeProvider.nameCTTwoPrim, false)
+        .goUpFilterValidator()
+        .root()
+        .goParameter(1)
+        .isTypedLiteral(ComplexTypeProvider.nameCTBase);
+
+    testFilter.runOnETKeyNav("cast($it,olingo.odata.test1.CTBase)")
+        .is("<cast(<$it>,<olingo.odata.test1.CTBase>)>")
+        .root()
+        .isMethod(MethodKind.CAST, 2)
+        .isParameterText(0, "<$it>")
+        .isParameterText(1, "<olingo.odata.test1.CTBase>")
+        .goParameter(0).goPath().first()
+        .isIt().isType(EntityTypeProvider.nameETKeyNav, false)
+        .goUpFilterValidator()
+        .root()
+        .goParameter(1).isTypedLiteral(ComplexTypeProvider.nameCTBase);
+
+    testFilter.runOnETKeyNav("concat(PropertyString,cast(PropertyCompAllPrim/PropertyInt16,Edm.String))")
+        .is("<concat(<PropertyString>,<cast(<PropertyCompAllPrim/PropertyInt16>,<Edm.String>)>)>")
+        .isMethod(MethodKind.CONCAT, 2)
+        .isParameterText(0, "<PropertyString>")
+        .isParameterText(1, "<cast(<PropertyCompAllPrim/PropertyInt16>,<Edm.String>)>")
+        .goParameter(1)
+        .isMethod(MethodKind.CAST, 2)
+        .isParameterText(0, "<PropertyCompAllPrim/PropertyInt16>")
+        .isParameterText(1, "<Edm.String>");
+
+    testFilter.runOnETKeyNav("cast($it,olingo.odata.test1.CTBase) eq cast($it,olingo.odata.test1.CTBase)")
+        .is("<<cast(<$it>,<olingo.odata.test1.CTBase>)> eq <cast(<$it>,<olingo.odata.test1.CTBase>)>>")
         .root().left()
         .isMethod(MethodKind.CAST, 2)
         .isParameterText(0, "<$it>")
@@ -4563,26 +4787,22 @@ public class TestFullResourcePath {
         .goUpFilterValidator().root()
         .goParameter(1).isTypedLiteral(EntityTypeProvider.nameETKeyPrimNav);
 
+    testFilter.runOnETAllPrim("olingo.odata.test1.UFCRTCTTwoPrimTwoParam(ParameterInt16=null,ParameterString=null)")
+        .goPath()
+        .isFunction("UFCRTCTTwoPrimTwoParam")
+        .isParameter(0, "ParameterInt16", null)
+        .isParameter(1, "ParameterString", null);
+
     testFilter.runOnETKeyNavEx("cast(NavPropertyETKeyPrimNavOne,olingo.odata.test1.ETKeyNav)")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOnETKeyNav("any()")
         .isMember().goPath().first().isUriPathInfoKind(UriResourceKind.lambdaAny);
   }
 
+  // TODO: Check whether lambda expressions really are allowed on complex collections.
   @Test
+  @Ignore
   public void lambdaFunctions() throws Exception {
-
-    testFilter.runOnETKeyNav("any(d:d/PropertyInt16 eq 1)")
-        .is("<<ANY;<<d/PropertyInt16> eq <1>>>>")
-        .root().goPath()
-        .first().isUriPathInfoKind(UriResourceKind.lambdaAny)
-        .goLambdaExpression()
-        .isBinary(BinaryOperatorKind.EQ)
-        .left().goPath()
-        .first().isUriPathInfoKind(UriResourceKind.lambdaVariable)
-        .isType(EntityTypeProvider.nameETKeyNav, false)
-        .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
     testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyString eq 'SomeString')")
         .is("<NavPropertyETTwoKeyNavMany/<ANY;<<d/PropertyString> eq <'SomeString'>>>>")
         .root().goPath()
@@ -4610,7 +4830,7 @@ public class TestFullResourcePath {
         .first().isUriPathInfoKind(UriResourceKind.lambdaVariable)
         .isType(PropertyProvider.nameString, false);
 
-    testFilter.runOnETKeyNav(" NavPropertyETTwoKeyNavOne/olingo.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()"
+    testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavOne/olingo.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()"
         + "/any(d:d/PropertyComp/PropertyInt16 eq 6)")
         .is("<NavPropertyETTwoKeyNavOne/BFCETTwoKeyNavRTESTwoKeyNav/<ANY;<<d/PropertyComp/PropertyInt16> eq <6>>>>")
         .root().goPath()
@@ -4625,8 +4845,8 @@ public class TestFullResourcePath {
         .n().isComplex("PropertyComp")
         .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
 
-    testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyInt16 eq 1 or d/any"
-        + "(e:e/CollPropertyString eq 'SomeString'))")
+    testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyInt16 eq 1 or "
+        + "d/any(e:e/CollPropertyString eq 'SomeString'))")
         .is("<NavPropertyETTwoKeyNavMany/<ANY;<<<d/PropertyInt16> eq <1>> or "
             + "<d/<ANY;<<e/CollPropertyString> eq <'SomeString'>>>>>>>")
         .root().goPath()
@@ -4653,8 +4873,8 @@ public class TestFullResourcePath {
         .isType(EntityTypeProvider.nameETTwoKeyNav, false)
         .n().isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
 
-    testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyInt16 eq 1 or d/CollPropertyString/any"
-        + "(e:e eq 'SomeString'))")
+    testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyInt16 eq 1 or "
+        + "d/CollPropertyString/any(e:e eq 'SomeString'))")
         .is("<NavPropertyETTwoKeyNavMany/<ANY;<<<d/PropertyInt16> eq <1>> or "
             + "<d/CollPropertyString/<ANY;<<e> eq <'SomeString'>>>>>>>")
         .root().goPath()
@@ -4681,9 +4901,8 @@ public class TestFullResourcePath {
         .first().isUriPathInfoKind(UriResourceKind.lambdaVariable)
         .isType(PropertyProvider.nameString, false);
 
-    testFilter
-        .runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyString eq 'SomeString' and d/CollPropertyString/any"
-            + "(e:e eq d/PropertyString))")
+    testFilter.runOnETKeyNav("NavPropertyETTwoKeyNavMany/any(d:d/PropertyString eq 'SomeString' and "
+            + "d/CollPropertyString/any(e:e eq d/PropertyString))")
         .is("<NavPropertyETTwoKeyNavMany/<ANY;<<<d/PropertyString> eq <'SomeString'>> and "
             + "<d/CollPropertyString/<ANY;<<e> eq <d/PropertyString>>>>>>>")
         .root().goPath()
@@ -4714,11 +4933,14 @@ public class TestFullResourcePath {
         .first().isUriPathInfoKind(UriResourceKind.lambdaVariable)
         .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
+    testFilter.runOnETKeyNavEx("any(d:d/PropertyInt16 eq 1)")
+        .isExSemantic(MessageKeys.PROPERTY_NOT_IN_TYPE);
   }
 
+  // TODO: Implement isof method.
   @Test
-  public void runIsOf() throws Exception {
-
+  @Ignore
+  public void isOfMethod() throws Exception {
     testFilter.runOnETKeyNav("isof(olingo.odata.test1.ETTwoKeyNav)")
         .is("<isof(<olingo.odata.test1.ETTwoKeyNav>)>")
         .root()
@@ -4903,271 +5125,16 @@ public class TestFullResourcePath {
         .goUpFilterValidator()
         .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String3"));
 
-    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String,String3'")
-        .is("<<PropertyEnumString> has <olingo.odata.test1.ENString<String,String3>>>")
-        .isBinary(BinaryOperatorKind.HAS)
-        .root().left().goPath()
-        .first().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
-        .goUpFilterValidator()
-        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String", "String3"));
-
-    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has null")
-        .is("<<PropertyEnumString> has <null>>")
-        .root()
+    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String1,String3'")
+        .is("<<PropertyEnumString> has <olingo.odata.test1.ENString<String1,String3>>>")
         .isBinary(BinaryOperatorKind.HAS)
         .root().left().goPath()
         .first().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
         .goUpFilterValidator()
-        .root().right().isNull();
-
-    testFilter.runOnETTwoKeyNav("endswith(PropertyComp/PropertyComp/PropertyString,'dorf')")
-        .is("<endswith(<PropertyComp/PropertyComp/PropertyString>,<'dorf'>)>")
-        .isMethod(MethodKind.ENDSWITH, 2)
-        .goParameter(0).goPath()
-        .first().isComplex("PropertyComp")
-        .n().isComplex("PropertyComp")
-        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
-        .root().goParameter(1).isLiteral("'dorf'");
-
-    testFilter.runOnETTwoKeyNav("endswith(PropertyComp/PropertyComp/PropertyString,'dorf') eq true")
-        .is("<<endswith(<PropertyComp/PropertyComp/PropertyString>,<'dorf'>)> eq <true>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .left().isMethod(MethodKind.ENDSWITH, 2)
-        .goParameter(0).goPath()
-        .first().isComplex("PropertyComp")
-        .n().isComplex("PropertyComp")
-        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
-        .root().left().goParameter(1).isLiteral("'dorf'");
-
-    testFilter.runOnETTwoKeyNav("endswith('Walldorf','dorf')")
-        .is("<endswith(<'Walldorf'>,<'dorf'>)>")
-        .isMethod(MethodKind.ENDSWITH, 2)
-        .goParameter(0).isLiteral("'Walldorf'")
-        .root().goParameter(1).isLiteral("'dorf'");
-
-    testFilter.runOnETTwoKeyNav("endswith('Walldorf','dorf') eq true")
-        .is("<<endswith(<'Walldorf'>,<'dorf'>)> eq <true>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .left().isMethod(MethodKind.ENDSWITH, 2)
-        .goParameter(0).isLiteral("'Walldorf'")
-        .root().left().goParameter(1).isLiteral("'dorf'");
-
-    testFilter.runOnETKeyNav("startswith(PropertyCompAllPrim/PropertyString,'Wall')")
-        .is("<startswith(<PropertyCompAllPrim/PropertyString>,<'Wall'>)>")
-        .isMethod(MethodKind.STARTSWITH, 2)
-        .goParameter(0).goPath()
-        .first().isComplex("PropertyCompAllPrim")
-        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
-        .root().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETKeyNav("startswith(PropertyCompAllPrim/PropertyString,'Wall') eq true")
-        .is("<<startswith(<PropertyCompAllPrim/PropertyString>,<'Wall'>)> eq <true>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .left().isMethod(MethodKind.STARTSWITH, 2)
-        .goParameter(0).goPath()
-        .first().isComplex("PropertyCompAllPrim")
-        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
-        .root().left().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETKeyNav("startswith('Walldorf','Wall')")
-        .is("<startswith(<'Walldorf'>,<'Wall'>)>")
-        .isMethod(MethodKind.STARTSWITH, 2)
-        .goParameter(0).isLiteral("'Walldorf'")
-        .root().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETKeyNav("startswith('Walldorf','Wall') eq true")
-        .is("<<startswith(<'Walldorf'>,<'Wall'>)> eq <true>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .left().isMethod(MethodKind.STARTSWITH, 2)
-        .goParameter(0).isLiteral("'Walldorf'")
-        .root().left().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETTwoKeyNav("contains(PropertyComp/PropertyComp/PropertyString,'Wall')")
-        .is("<contains(<PropertyComp/PropertyComp/PropertyString>,<'Wall'>)>")
-        .isMethod(MethodKind.CONTAINS, 2)
-        .goParameter(0).goPath()
-        .first().isComplex("PropertyComp")
-        .n().isComplex("PropertyComp")
-        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
-        .root().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETTwoKeyNav("contains(PropertyComp/PropertyComp/PropertyString,'Wall') eq true")
-        .is("<<contains(<PropertyComp/PropertyComp/PropertyString>,<'Wall'>)> eq <true>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .left().isMethod(MethodKind.CONTAINS, 2)
-        .goParameter(0).goPath()
-        .first().isComplex("PropertyComp")
-        .n().isComplex("PropertyComp")
-        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
-        .root().left().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETTwoKeyNav("contains('Walldorf','Wall')")
-        .is("<contains(<'Walldorf'>,<'Wall'>)>")
-        .isMethod(MethodKind.CONTAINS, 2)
-        .goParameter(0).isLiteral("'Walldorf'")
-        .root().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETTwoKeyNav("contains('Walldorf','Wall') eq true")
-        .is("<<contains(<'Walldorf'>,<'Wall'>)> eq <true>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .left().isMethod(MethodKind.CONTAINS, 2)
-        .goParameter(0).isLiteral("'Walldorf'")
-        .root().left().goParameter(1).isLiteral("'Wall'");
-
-    testFilter.runOnETAllPrim("olingo.odata.test1.UFCRTCTTwoPrimTwoParam(ParameterInt16=null,ParameterString=null)")
-        .goPath()
-        .isFunction("UFCRTCTTwoPrimTwoParam")
-        .isParameter(0, "ParameterInt16", null)
-        .isParameter(1, "ParameterString", null);
-
-    testFilter.runOnETAllPrim("PropertyBoolean eq true")
-        .is("<<PropertyBoolean> eq <true>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyBoolean", PropertyProvider.nameBoolean, false)
-        .goUpFilterValidator()
-        .root().right().isTrue();
-
-    testFilter.runOnETAllPrim("PropertyBoolean eq 2")
-        .is("<<PropertyBoolean> eq <2>>");
-
-    testFilter.runOnETAllPrim("PropertyDecimal eq 1.25")
-        .is("<<PropertyDecimal> eq <1.25>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyDecimal", PropertyProvider.nameDecimal, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("1.25");
-
-    testFilter.runOnETAllPrim("PropertyDouble eq 1.5")
-        .is("<<PropertyDouble> eq <1.5>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyDouble", PropertyProvider.nameDouble, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("1.5");
-
-    testFilter.runOnETAllPrim("PropertySingle eq 1.5")
-        .is("<<PropertySingle> eq <1.5>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertySingle", PropertyProvider.nameSingle, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("1.5");
-
-    testFilter.runOnETAllPrim("PropertySByte eq -128")
-        .is("<<PropertySByte> eq <-128>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertySByte", PropertyProvider.nameSByte, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("-128");
-
-    testFilter.runOnETAllPrim("PropertyByte eq 255")
-        .is("<<PropertyByte> eq <255>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyByte",
-            PropertyProvider.nameByte, false).goUpFilterValidator()
-        .root().right().isLiteral("255");
-
-    testFilter.runOnETAllPrim("PropertyInt16 eq 32767")
-        .is("<<PropertyInt16> eq <32767>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("32767");
-
-    testFilter.runOnETAllPrim("PropertyInt32 eq 2147483647")
-        .is("<<PropertyInt32> eq <2147483647>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyInt32", PropertyProvider.nameInt32, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("2147483647");
-
-    testFilter.runOnETAllPrim("PropertyInt64 eq 9223372036854775807")
-        .is("<<PropertyInt64> eq <9223372036854775807>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyInt64", PropertyProvider.nameInt64, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("9223372036854775807");
-
-    testFilter.runOnETAllPrim("PropertyDate eq 2013-09-25")
-        .is("<<PropertyDate> eq <2013-09-25>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("2013-09-25");
-
-    testFilter.runOnETAllPrim("PropertyDateTimeOffset eq 2013-09-25T12:34:56.123456789012-10:24")
-        .is("<<PropertyDateTimeOffset> eq <2013-09-25T12:34:56.123456789012-10:24>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath()
-        .isPrimitiveProperty("PropertyDateTimeOffset", PropertyProvider.nameDateTimeOffset, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("2013-09-25T12:34:56.123456789012-10:24");
-
-    testFilter.runOnETAllPrim("PropertyDuration eq duration'P10DT5H34M21.123456789012S'")
-        .is("<<PropertyDuration> eq <duration'P10DT5H34M21.123456789012S'>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyDuration", PropertyProvider.nameDuration, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("duration'P10DT5H34M21.123456789012S'");
-
-    testFilter.runOnETAllPrim("PropertyGuid eq 005056A5-09B1-1ED3-89BD-FB81372CCB33")
-        .is("<<PropertyGuid> eq <005056A5-09B1-1ED3-89BD-FB81372CCB33>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyGuid", PropertyProvider.nameGuid, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("005056A5-09B1-1ED3-89BD-FB81372CCB33");
-
-    testFilter.runOnETAllPrim("PropertyString eq 'somestring'")
-        .is("<<PropertyString> eq <'somestring'>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("'somestring'");
-
-    testFilter.runOnETAllPrim("PropertyTimeOfDay eq 12:34:55.12345678901")
-        .is("<<PropertyTimeOfDay> eq <12:34:55.12345678901>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyTimeOfDay", PropertyProvider.nameTimeOfDay, false)
-        .goUpFilterValidator()
-        .root().right().isLiteral("12:34:55.12345678901");
-
-    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1'")
-        .is("<<PropertyEnumString> eq <olingo.odata.test1.ENString<String1>>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
-        .goUpFilterValidator()
-        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1"));
-
-    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String2'")
-        .is("<<PropertyEnumString> eq <olingo.odata.test1.ENString<String2>>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
-        .goUpFilterValidator()
-        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String2"));
-
-    testFilter.runOnETMixEnumDefCollComp(
-        "PropertyCompMixedEnumDef/PropertyEnumString eq olingo.odata.test1.ENString'String3'")
-        .is("<<PropertyCompMixedEnumDef/PropertyEnumString> eq <olingo.odata.test1.ENString<String3>>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath()
-        .first().isComplex("PropertyCompMixedEnumDef")
-        .n().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
-        .goUpFilterValidator()
-        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String3"));
-
-    testFilter
-        .runOnETMixEnumDefCollComp(
-            "PropertyCompMixedEnumDef/PropertyEnumString eq " +
-                "PropertyCompMixedEnumDef/PropertyEnumString")
-        .is("<<PropertyCompMixedEnumDef/PropertyEnumString> eq " +
-            "<PropertyCompMixedEnumDef/PropertyEnumString>>")
-        .isBinary(BinaryOperatorKind.EQ)
-        .root().left().goPath()
-        .first().isComplex("PropertyCompMixedEnumDef")
-        .n().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false)
-        .goUpFilterValidator()
-        .root().right().goPath()
-        .first().isComplex("PropertyCompMixedEnumDef")
-        .n().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false);
+        .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1", "String3"));
 
+    testFilter.runUriEx("ESMixEnumDefCollComp", "$filter=PropertyEnumString has null")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testFilter.runUriEx("ESMixEnumDefCollComp", "$filter=PropertyEnumString has ENString'String1'")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testFilter.runUriEx("ESMixEnumDefCollComp", "$filter=PropertyEnumString has wrongNamespace.ENString'String1'")
@@ -5192,6 +5159,28 @@ public class TestFullResourcePath {
 
   @Test
   public void orderby() throws Exception {
+    testFilter.runOrderByOnETTwoKeyNav("PropertyString")
+        .isSortOrder(0, false)
+        .goOrder(0).goPath()
+        .first().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    testFilter.runOrderByOnETTwoKeyNav("PropertyComp")
+        .isSortOrder(0, false)
+        .goOrder(0).goPath()
+        .first().isComplex("PropertyComp");
+
+    testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp")
+        .isSortOrder(0, false)
+        .goOrder(0).goPath()
+        .first().isComplex("PropertyComp")
+        .n().isComplex("PropertyComp");
+
+    testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyDate")
+        .isSortOrder(0, false)
+        .goOrder(0).goPath()
+        .first().isComplex("PropertyComp")
+        .n().isComplex("PropertyComp")
+        .n().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
 
     testFilter.runOrderByOnETTwoKeyNav("olingo.odata.test1.UFCRTETAllPrimTwoParam("
         + "ParameterString=@ParamStringAlias,ParameterInt16=@ParamInt16Alias)/PropertyString eq 'SomeString'")
@@ -5215,8 +5204,8 @@ public class TestFullResourcePath {
         .goOrder(0).right().isLiteral("'SomeString'");
 
     testFilter.runOrderByOnETTwoKeyNav("olingo.odata.test1.UFCRTETAllPrimTwoParam("
-        + "ParameterString=@ParamStringAlias,ParameterInt16=@ParamInt16Alias)/PropertyString eq 'SomeString' desc"
-        + ", PropertyString eq '1'")
+        + "ParameterString=@ParamStringAlias,ParameterInt16=@ParamInt16Alias)/PropertyString eq 'SomeString' desc,"
+        + "PropertyString eq '1'")
         .isSortOrder(0, true)
         .goOrder(0).isBinary(BinaryOperatorKind.EQ).left().goPath()
         .first().isFunction("UFCRTETAllPrimTwoParam").goUpFilterValidator()
@@ -5241,20 +5230,8 @@ public class TestFullResourcePath {
         .n().isComplex("PropertyComp")
         .n().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
 
-    testFilter.runOrderByOnETTwoKeyNav("PropertyString")
-        .isSortOrder(0, false)
-        .goOrder(0).goPath()
-        .first().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
-    testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyDate")
-        .isSortOrder(0, false)
-        .goOrder(0).goPath()
-        .first().isComplex("PropertyComp")
-        .n().isComplex("PropertyComp")
-        .n().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
-
-    testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyDate "
-        + "eq 2013-11-12 desc, PropertyString eq 'SomeString' desc")
+    testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyDate eq 2013-11-12 desc,"
+        + "PropertyString eq 'SomeString' desc")
         .isSortOrder(0, true)
         .goOrder(0).isBinary(BinaryOperatorKind.EQ)
         .left().goPath()
@@ -5267,17 +5244,7 @@ public class TestFullResourcePath {
         .goUpFilterValidator()
         .goOrder(1).right().isLiteral("'SomeString'");
 
-    testFilter.runOrderByOnETTwoKeyNav("PropertyComp")
-        .isSortOrder(0, false)
-        .goOrder(0).goPath()
-        .first().isComplex("PropertyComp");
-    testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp")
-        .isSortOrder(0, false)
-        .goOrder(0).goPath()
-        .first().isComplex("PropertyComp")
-        .n().isComplex("PropertyComp");
-
-    testFilter.runOrderByOnETTwoKeyNav("PropertyComp desc, PropertyComp/PropertyInt16 eq 1")
+    testFilter.runOrderByOnETTwoKeyNav("PropertyComp desc,PropertyComp/PropertyInt16 eq 1")
         .isSortOrder(0, true)
         .goOrder(0).goPath()
         .first().isComplex("PropertyComp").goUpFilterValidator()
@@ -5419,17 +5386,17 @@ public class TestFullResourcePath {
         .goUpFilterValidator()
         .goOrder(0).right().isLiteral("9223372036854775807");
 
-    testFilter.runOrderByOnETAllPrim("PropertyBinary eq binary'0FAB7B'")
+    testFilter.runOrderByOnETAllPrim("PropertyBinary eq binary'VGVzdA=='")
         .isSortOrder(0, false)
         .goOrder(0).left().goPath().isPrimitiveProperty("PropertyBinary", PropertyProvider.nameBinary, false)
         .goUpFilterValidator()
-        .goOrder(0).right().isLiteral("binary'0FAB7B'");
+        .goOrder(0).right().isLiteral("binary'VGVzdA=='");
 
-    testFilter.runOrderByOnETAllPrim("PropertyBinary eq binary'0FAB7B' desc")
+    testFilter.runOrderByOnETAllPrim("PropertyBinary eq binary'VGVzdA==' desc")
         .isSortOrder(0, true)
         .goOrder(0).left().goPath().isPrimitiveProperty("PropertyBinary", PropertyProvider.nameBinary, false)
         .goUpFilterValidator()
-        .goOrder(0).right().isLiteral("binary'0FAB7B'");
+        .goOrder(0).right().isLiteral("binary'VGVzdA=='");
 
     testFilter.runOrderByOnETAllPrim("PropertyDate eq 2013-09-25")
         .isSortOrder(0, false)
@@ -5518,15 +5485,15 @@ public class TestFullResourcePath {
         .goOrder(0).right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1"));
 
     testFilter.runOrderByOnETTwoKeyNavEx("PropertyInt16 1")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
     testFilter.runOrderByOnETTwoKeyNavEx("PropertyInt16, PropertyInt32 PropertyDuration")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testFilter.runOrderByOnETTwoKeyNavEx("PropertyInt16 PropertyInt32, PropertyDuration desc")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
     testFilter.runOrderByOnETTwoKeyNavEx("PropertyInt16 asc, PropertyInt32 PropertyDuration desc")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testFilter.runOrderByOnETTwoKeyNavEx("PropertyInt16 asc desc")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
     testFilter.runOrderByOnETTwoKeyNavEx("undefined")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOrderByOnETTwoKeyNavEx("PropertyComp/undefined")
@@ -5779,7 +5746,7 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void KeyPredicatesInDoubleExpandedFilter() throws Exception {
+  public void keyPredicatesInDoubleExpandedFilter() throws Exception {
     testUri.run("ESKeyNav(0)", "$expand=NavPropertyETTwoKeyNavMany($expand=NavPropertyETTwoKeyNavMany"
         + "($filter=NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')/PropertyInt16 eq 1))")
         .goPath().goExpand()
@@ -5791,15 +5758,15 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void filterSystemQueryOptionAnyWithKeyAny() throws Exception {
-    testUri.runEx("ESAllPrim", "$filter=NavPropertyETTwoPrimMany(1)/any(d:d/PropertyInt16 eq 0)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+  public void filterSystemQueryOptionManyWithKeyAny() throws Exception {
+    testFilter.runUriEx("ESAllPrim", "$filter=NavPropertyETTwoPrimMany(1)/any(d:d/PropertyInt16 eq 0)")
+        .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
   }
 
   @Test
-  public void filterSystemQueryOptionAnyWithKeyAll() throws Exception {
-    testUri.runEx("ESAllPrim", "$filter=NavPropertyETTwoPrimMany(1)/all(d:d/PropertyInt16 eq 0)")
-        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+  public void filterSystemQueryOptionManyWithKeyAll() throws Exception {
+    testFilter.runUriEx("ESAllPrim", "$filter=NavPropertyETTwoPrimMany(1)/all(d:d/PropertyInt16 eq 0)")
+        .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
   }
 
   @Test
@@ -5896,87 +5863,103 @@ public class TestFullResourcePath {
         .at(3).isNavProperty(entitySetName, nameETNavProp, true);
   }
 
+  // TODO: Better type determination for literal numbers.
   @Test
+  @Ignore
   public void filterLiteralTypes() throws Exception {
-    testUri.run("ESAllPrim", "$filter='1' eq 42")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
-        .left().isLiteral("'1'").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.String))
+    testFilter.runOnETAllPrim("-1000 eq 42")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isLiteral("-1000").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int16))
         .root()
         .right().isLiteral("42").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.SByte));
 
-    testUri.run("ESAllPrim", "$filter=127 eq 128")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim("127 eq 128")
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral("127").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.SByte))
         .root()
         .right().isLiteral("128").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Byte));
 
-    testUri.run("ESAllPrim", "$filter=null eq 42.1")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim("null eq 42.1")
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral("null").isNullLiteralType()
         .root()
         .right().isLiteral("42.1").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal));
 
-    testUri.run("ESAllPrim", "$filter=15.6E300 eq 3.4E37")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim("15.6E300 eq 3.4E37")
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral("15.6E300")
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double))
         .root()
         .right().isLiteral("3.4E37").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double));
 
-    testUri.run("ESAllPrim", "$filter=15.55555555555555555555555555555555555555555555 eq 3.1")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim("15.55555555555555555555555555555555555555555555 eq 3.1")
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral("15.55555555555555555555555555555555555555555555")
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal))
         .root()
         .right().isLiteral("3.1").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal));
 
-    testUri.run("ESAllPrim", "$filter=duration'PT1H2S' eq 2012-12-03")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim("duration'PT1H2S' eq duration'PT3602S'")
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral("duration'PT1H2S'")
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Duration))
         .root()
+        .right().isLiteral("duration'PT3602S'")
+        .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Duration));
+
+    testFilter.runOnETAllPrim("2013-11-02 ne 2012-12-03")
+        .isBinary(BinaryOperatorKind.NE)
+        .left().isLiteral("2013-11-02").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Date))
+        .root()
         .right().isLiteral("2012-12-03").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Date));
 
-    testUri.run("ESAllPrim", "$filter=true eq 2012-12-03T07:16:23Z")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
-        .left().isLiteral("true").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean))
+    testFilter.runOnETAllPrim("null eq 2012-12-03T07:16:23Z")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isLiteral("null")
+        .isNullLiteralType()
         .root()
         .right().isLiteral("2012-12-03T07:16:23Z")
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.DateTimeOffset));
 
-    testUri.run("ESAllPrim", "$filter=07:59:59.999 eq 01234567-89ab-cdef-0123-456789abcdef")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim("07:59:59.999 eq null")
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral("07:59:59.999")
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.TimeOfDay))
         .root()
+        .right().isLiteral("null").isNullLiteralType();
+
+    testFilter.runOnETAllPrim("null eq 01234567-89ab-cdef-0123-456789abcdef")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isLiteral("null").isNullLiteralType()
+        .root()
         .right().isLiteral("01234567-89ab-cdef-0123-456789abcdef")
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Guid));
 
-    testUri.run("ESAllPrim", "$filter=binary'0FAB7B' eq true")
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
-        .left().isLiteral("binary'0FAB7B'").isLiteralType(
+    testFilter.runOnETAllPrim("binary'VGVzdA==' eq null")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isLiteral("binary'VGVzdA=='").isLiteralType(
             oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Binary))
         .root()
-        .right().isLiteral("true").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean));
+        .right().isLiteral("null").isNullLiteralType();
 
-    testUri.run("ESAllPrim", "$filter=" + Short.MIN_VALUE + " eq " + Short.MAX_VALUE)
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim(Short.MIN_VALUE + " eq " + Short.MAX_VALUE)
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral(Short.toString(Short.MIN_VALUE))
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int16))
         .root()
         .right().isLiteral(Short.toString(Short.MAX_VALUE))
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int16));
 
-    testUri.run("ESAllPrim", "$filter=" + Integer.MIN_VALUE + " eq " + Integer.MAX_VALUE)
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim(Integer.MIN_VALUE + " eq " + Integer.MAX_VALUE)
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral(Integer.toString(Integer.MIN_VALUE))
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int32))
         .root()
         .right().isLiteral(Integer.toString(Integer.MAX_VALUE))
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int32));
 
-    testUri.run("ESAllPrim", "$filter=" + Long.MIN_VALUE + " eq " + Long.MAX_VALUE)
-        .goFilter().isBinary(BinaryOperatorKind.EQ)
+    testFilter.runOnETAllPrim(Long.MIN_VALUE + " eq " + Long.MAX_VALUE)
+        .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral(Long.toString(Long.MIN_VALUE))
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Int64))
         .root()
@@ -6016,34 +5999,35 @@ public class TestFullResourcePath {
         .at(1).isFunction("BFCESTwoKeyNavRTStringParam").isParameterAlias(0, "ParameterComp", "@p1")
         .isInAliasToValueMap("@p1", "{\"PropertyInt16\":1,\"PropertyString\":\"" + stringValueDecoded + "\"}");
 
-    testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
+    testFilter.runOnETTwoKeyNav("olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
         + "(ParameterComp={\"PropertyString\":\"Test\",\"PropertyInt16\":1}) eq 'Test'")
-        .goFilter().left().is("<<BFCESTwoKeyNavRTStringParam> eq <'Test'>>")
-        .isParameterText(0, "{\"PropertyString\":\"Test\",\"PropertyInt16\":1}");
+        .is("<<BFCESTwoKeyNavRTStringParam> eq <'Test'>>")
+        .isBinary(BinaryOperatorKind.EQ)
+        .left().isParameterText(0, "{\"PropertyString\":\"Test\",\"PropertyInt16\":1}");
 
-    testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
+    testFilter.runOnETTwoKeyNav("olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
         + "(ParameterComp={\"PropertyString\":\"" + stringValueEncoded + "\",\"PropertyInt16\":1}) eq 'Test'")
-        .goFilter().left().is("<<BFCESTwoKeyNavRTStringParam> eq <'Test'>>")
-        .isParameterText(0, "{\"PropertyString\":\"" + stringValueDecoded + "\",\"PropertyInt16\":1}");
+        .is("<<BFCESTwoKeyNavRTStringParam> eq <'Test'>>")
+        .left().isParameterText(0, "{\"PropertyString\":\"" + stringValueDecoded + "\",\"PropertyInt16\":1}");
 
     testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":1,\"PropertyString\":\"1\"}");
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":1,\"PropertyString\":\"1\"}");
 
     testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":1,\"PropertyString\":null}")
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":1,\"PropertyString\":null}")
         .goFilter().left().isParameterText(0, null);
 
     testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={}");
+        + "(ParameterComp=@p1) eq '0'&@p1={}");
 
     testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":[1,2,3],\"PropertyString\":\"1\"}");
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":[1,2,3],\"PropertyString\":\"1\"}");
 
     testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":[\"1\",\"2\",\"3\"],\"PropertyString\":\"1\"}");
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":[\"1\",\"2\",\"3\"],\"PropertyString\":\"1\"}");
 
     testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":[{\"Prop1\":123,\"Prop2\":\"Test\",\"Prop3\":[1,2,3]},"
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":[{\"Prop1\":123,\"Prop2\":\"Test\",\"Prop3\":[1,2,3]},"
         + "{\"Prop1\":{\"Prop1\":[\"Prop\\\":{]\"]}}],\"PropertyString\":\"1\"}");
 
     testUri.run("FINRTByteNineParam(ParameterEnum=null,ParameterDef='x',ParameterComp=@c,"
@@ -6057,7 +6041,7 @@ public class TestFullResourcePath {
 
     testUri.runEx("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
         + "(ParameterComp={\"PropertyInt16\":1,\"PropertyString\":\"Test\"})")
-        .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+        .isExSemantic(MessageKeys.COMPLEX_PARAMETER_IN_RESOURCE_PATH);
 
     testUri.runEx("FICRTCTTwoPrimTwoParam(ParameterInt16=1,ParameterString=null)")
         .isExValidation(UriValidationException.MessageKeys.MISSING_PARAMETER);
@@ -6081,34 +6065,33 @@ public class TestFullResourcePath {
     testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString=@test)", "@test=null&@test='1'")
         .isExSyntax(UriParserSyntaxException.MessageKeys.DUPLICATED_ALIAS);
 
-    testUri.runEx("ESAllPrim", "$filter=FINRTInt16() eq 0")
-        .isExSemantic(MessageKeys.FUNCTION_IMPORT_NOT_ALLOWED);
+    testFilter.runOnETKeyNavEx("FINRTInt16() eq 0")
+        .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
 
     testUri.runEx("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":1,\"PropertyString\":\"1\"")
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":1,\"PropertyString\":\"1\"")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
 
     testUri.runEx("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":1,\"PropertyString\":\"1\"}}")
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":1,\"PropertyString\":\"1\"}}")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
 
     testUri.runEx("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":[1,2,3]],\"PropertyString\":\"1\"}")
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":[1,2,3]],\"PropertyString\":\"1\"}")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
 
     testUri.runEx("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":[1,2,3,\"PropertyString\":\"1\"}")
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":[1,2,3,\"PropertyString\":\"1\"}")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
 
     testUri.runEx("ESTwoKeyNav", "$filter=olingo.odata.test1.BFCESTwoKeyNavRTStringParam"
-        + "(ParameterComp=@p1) eq 0&@p1={\"PropertyInt16\":[1,2,3},\"PropertyString\":\"1\"}")
+        + "(ParameterComp=@p1) eq '0'&@p1={\"PropertyInt16\":[1,2,3},\"PropertyString\":\"1\"}")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
   }
 
   @Test
-  @Ignore("Key predicates in filter/orderby expression are not validated currently")
-  public void testKeyPredicatesInExpressions() throws Exception {
-    testUri.run("ESTwoKeyNav", "$filter=NavPropertyETTwoKeyNavMany(PropertyString='1',PropertyInt16=1)"
+  public void keyPredicatesInExpressions() throws Exception {
+    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavMany(PropertyString='1',PropertyInt16=1)"
         + "/PropertyInt16 eq 1");
     testUri.runEx("ESTwoKeyNav", "$filter=NavPropertyETTwoKeyNavMany(Prop='22',P=2)/PropertyInt16 eq 0")
         .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
index 19f5946..8790766 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
@@ -38,6 +38,7 @@ import org.apache.olingo.server.tecsvc.provider.ContainerProvider;
 import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
 import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
 import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class TestUriParserImpl {
@@ -561,11 +562,12 @@ public class TestUriParserImpl {
   @Test
   public void unary() throws Exception {
     testFilter.runOnETAllPrim("not PropertyBoolean").isCompr("<not <PropertyBoolean>>");
-    testFilter.runOnETAllPrim("- PropertyInt16 eq PropertyInt16").isCompr("<<- <PropertyInt16>> eq <PropertyInt16>>");
     testFilter.runOnETAllPrim("-PropertyInt16 eq PropertyInt16").isCompr("<<- <PropertyInt16>> eq <PropertyInt16>>");
   }
 
+  // TODO: Use correct types.
   @Test
+  @Ignore
   public void filterComplexMixedPriority() throws Exception {
     testFilter.runOnETAllPrim("PropertyInt16 or PropertyInt32 and PropertyInt64")
         .isCompr("<<PropertyInt16> or <<PropertyInt32> and <PropertyInt64>>>");
@@ -1069,28 +1071,21 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testLambda() throws Exception {
-    testUri.run("ESTwoKeyNav", "$filter=CollPropertyComp/all( l : true )")
-    .goFilter().is("<CollPropertyComp/<ALL;<true>>>");
-
-    testUri.run("ESTwoKeyNav", "$filter=CollPropertyComp/all( x : x/PropertyInt16 eq 2)")
-        .goFilter().is("<CollPropertyComp/<ALL;<<x/PropertyInt16> eq <2>>>>");
-
-    testUri.run("ESTwoKeyNav", "$filter=CollPropertyComp/any( l : true )")
-    .goFilter().is("<CollPropertyComp/<ANY;<true>>>");
-    testUri.run("ESTwoKeyNav", "$filter=CollPropertyComp/any( )")
-    .goFilter().is("<CollPropertyComp/<ANY;>>");
-
-    testUri.run("ESTwoKeyNav", "$filter=all( l : true )")
-    .goFilter().is("<<ALL;<true>>>");
-    testUri.run("ESTwoKeyNav", "$filter=any( l : true )")
-    .goFilter().is("<<ANY;<true>>>");
-    testUri.run("ESTwoKeyNav", "$filter=any( )")
-    .goFilter().is("<<ANY;>>");
+  public void lambda() throws Exception {
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/all(l:true)")
+        .is("<CollPropertyComp/<ALL;<true>>>");
+
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/all(x:x/PropertyInt16 eq 2)")
+        .is("<CollPropertyComp/<ALL;<<x/PropertyInt16> eq <2>>>>");
+
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/any(l:true)")
+        .is("<CollPropertyComp/<ANY;<true>>>");
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/any()")
+        .is("<CollPropertyComp/<ANY;>>");
   }
 
   @Test
-  public void testCustomQueryOption() throws Exception {
+  public void customQueryOption() throws Exception {
     testUri.run("ESTwoKeyNav", "custom")
     .isCustomParameter(0, "custom", "");
     testUri.run("ESTwoKeyNav", "custom=ABC")
@@ -1098,6 +1093,7 @@ public class TestUriParserImpl {
   }
 
   @Test
+  @Ignore("Geo types are not supported yet.")
   public void geo() throws Exception {
     testFilter.runOnETAllPrim("geo.distance(PropertySByte,PropertySByte)")
     .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
index 864b17a..fad718b 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
@@ -128,7 +128,7 @@ public class ExpressionTest {
     // UriResourceImpl
     EdmAction action = edm.getUnboundAction(ActionProvider.nameUARTString);
     UriInfoResource uriInfo = new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
-        new UriResourceActionImpl().setAction(action)).asUriInfoResource();
+        new UriResourceActionImpl(action)).asUriInfoResource();
     MemberImpl expression = new MemberImpl(uriInfo, null);
     assertEquals(action.getReturnType().getType(), expression.getType());
 
@@ -142,7 +142,7 @@ public class ExpressionTest {
     // UriResourceImplTyped check collection = true case
     action = edm.getUnboundAction(ActionProvider.nameUARTCollStringTwoParam);
     expression = new MemberImpl(new UriInfoImpl().setKind(UriInfoKind.resource)
-        .addResourcePart(new UriResourceActionImpl().setAction(action))
+        .addResourcePart(new UriResourceActionImpl(action))
         .asUriInfoResource(),
         null);
     assertTrue(expression.isCollection());
@@ -150,7 +150,7 @@ public class ExpressionTest {
     // UriResourceImplTyped with filter
     EdmFunction function = edm.getUnboundFunction(FunctionProvider.nameUFCRTETKeyNav, null);
     expression = new MemberImpl(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
-        new UriResourceFunctionImpl().setFunction(function).setEntryTypeFilter(entityType))
+        new UriResourceFunctionImpl(null, function, null).setEntryTypeFilter(entityType))
         .asUriInfoResource(),
         null);
     assertEquals(entityType, expression.getType());
@@ -158,7 +158,7 @@ public class ExpressionTest {
     // UriResourceImplKeyPred
     function = edm.getUnboundFunction(FunctionProvider.nameUFCRTETKeyNav, null);
     expression = new MemberImpl(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
-        new UriResourceFunctionImpl().setFunction(function))
+        new UriResourceFunctionImpl(null, function, null))
         .asUriInfoResource(),
         null);
     assertEquals(function.getReturnType().getType(), expression.getType());
@@ -167,7 +167,7 @@ public class ExpressionTest {
     EdmEntityType entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
     function = edm.getUnboundFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam, Arrays.asList("ParameterInt16"));
     expression = new MemberImpl(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
-        new UriResourceFunctionImpl().setFunction(function).setEntryTypeFilter(entityBaseType))
+        new UriResourceFunctionImpl(null, function, null).setEntryTypeFilter(entityBaseType))
         .asUriInfoResource(),
         null);
     assertEquals(entityBaseType, expression.getType());
@@ -176,7 +176,7 @@ public class ExpressionTest {
     entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
     function = edm.getUnboundFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam, Arrays.asList("ParameterInt16"));
     expression = new MemberImpl(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
-        new UriResourceFunctionImpl().setFunction(function).setCollectionTypeFilter(entityBaseType))
+        new UriResourceFunctionImpl(null, function, null).setCollectionTypeFilter(entityBaseType))
         .asUriInfoResource(),
         null);
     assertEquals(entityBaseType, expression.getType());


[05/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp ServerCore

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java
index d9147e5..35c789f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java
index 84549e4..aa63b87 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java
index d440781..44b58e0 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SkipTokenOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java
index ac27a59..c0f700f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SystemQueryOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java
index aa33120..c53c1ae 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/TopOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
index 09af93f..9489d0d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java
index a28f92c..c5a9fc9 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
index 8f7df3a..90530f4 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
index c9cc707..e64a363 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
index 8198204..0bf09fd 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java
index 1dd9fa7..bd93440 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LiteralImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
index 5f6162f..307e17c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MemberImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java
index 7104a9f..bd982cd 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
index f5f6f06..549db33 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java
index 796191f..4268d08 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/UnaryImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
index 01af75d..2d8f842 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -54,13 +54,12 @@ public class UriValidationException extends ODataLibraryException {
     /** parameter: unallowed kind before $value */
     UNALLOWED_KIND_BEFORE_VALUE,
     /** parameter: unallowed kind before $count */
-    UNALLOWED_KIND_BEFORE_COUNT, 
+    UNALLOWED_KIND_BEFORE_COUNT,
     /** parameter: unallowed resource path */
     UNALLOWED_RESOURCE_PATH,
     /** parameter: missing parameter name */
     MISSING_PARAMETER;
 
-    
     @Override
     public String getKey() {
       return name();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
index f840e8e..9ffe696 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -223,14 +223,14 @@ public class UriValidator {
 
   private RowIndexForUriType rowIndexForResourceKind(final UriInfo uriInfo) throws UriValidationException {
     RowIndexForUriType idx;
-    
+
     final int nonComposableFunctionIndex = getIndexOfLastNonComposableFunction(uriInfo);
-    if(nonComposableFunctionIndex != -1 && (uriInfo.getUriResourceParts().size() - 1) > nonComposableFunctionIndex) {
-      throw new UriValidationException("Non composable functions followed by further resource parts are not allowed", 
-          UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH, 
+    if (nonComposableFunctionIndex != -1 && (uriInfo.getUriResourceParts().size() - 1) > nonComposableFunctionIndex) {
+      throw new UriValidationException("Non composable functions followed by further resource parts are not allowed",
+          UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH,
           uriInfo.getUriResourceParts().get(nonComposableFunctionIndex + 1).getSegmentValue());
     }
-    
+
     int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1;
     UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
 
@@ -249,7 +249,7 @@ public class UriValidator {
       idx = rowIndexForEntitySet(lastPathSegment);
       break;
     case function:
-      if(nonComposableFunctionIndex == -1) {
+      if (nonComposableFunctionIndex == -1) {
         idx = rowIndexForFunction(lastPathSegment);
       } else {
         idx = RowIndexForUriType.none;
@@ -279,17 +279,17 @@ public class UriValidator {
   }
 
   private int getIndexOfLastNonComposableFunction(final UriInfo uriInfo) {
-    for(int i = 0; i < uriInfo.getUriResourceParts().size(); i++) {
+    for (int i = 0; i < uriInfo.getUriResourceParts().size(); i++) {
       final UriResource resourcePath = uriInfo.getUriResourceParts().get(i);
-      
-      if(resourcePath instanceof UriResourceFunction) {
+
+      if (resourcePath instanceof UriResourceFunction) {
         final UriResourceFunction resourceFuntion = (UriResourceFunction) resourcePath;
-        if(!resourceFuntion.getFunction().isComposable()) {
+        if (!resourceFuntion.getFunction().isComposable()) {
           return i;
         }
       }
     }
-    
+
     return -1;
   }
 
@@ -312,9 +312,9 @@ public class UriValidator {
       final EdmFunctionImport functionImport = uriFunction.getFunctionImport();
       final EdmFunction function = functionImport == null ?
           uriFunction.getFunction() : functionImport.getUnboundFunctions().get(0);
-      idx = function.getReturnType().getType().getKind() == EdmTypeKind.ENTITY ?
-          RowIndexForUriType.mediaStream : RowIndexForUriType.propertyPrimitiveValue;
-      break;
+          idx = function.getReturnType().getType().getKind() == EdmTypeKind.ENTITY ?
+              RowIndexForUriType.mediaStream : RowIndexForUriType.propertyPrimitiveValue;
+          break;
     default:
       throw new UriValidationException("Unexpected kind in path segment before $value: "
           + secondLastPathSegment.getKind(), UriValidationException.MessageKeys.UNALLOWED_KIND_BEFORE_VALUE,
@@ -355,11 +355,10 @@ public class UriValidator {
     UriResourceFunction urf = (UriResourceFunction) lastPathSegment;
     EdmReturnType rt = urf.getFunction().getReturnType();
 
-    if(!urf.getFunction().isComposable()) {
+    if (!urf.getFunction().isComposable()) {
       return RowIndexForUriType.none;
     }
-    
-    
+
     switch (rt.getType().getKind()) {
     case ENTITY:
       idx = rt.isCollection() && urf.getKeyPredicates().isEmpty() ?
@@ -450,24 +449,24 @@ public class UriValidator {
       final EdmFunctionImport functionImport = uriFunction.getFunctionImport();
       final EdmFunction function = functionImport == null ?
           uriFunction.getFunction() : functionImport.getUnboundFunctions().get(0);
-      final EdmType returnType = function.getReturnType().getType();
-      switch (returnType.getKind()) {
-      case ENTITY:
-        idx = RowIndexForUriType.entitySetCount;
-        break;
-      case COMPLEX:
-        idx = RowIndexForUriType.propertyComplexCollectionCount;
-        break;
-      case PRIMITIVE:
-      case ENUM:
-      case DEFINITION:
-        idx = RowIndexForUriType.propertyPrimitiveCollectionCount;
-        break;
-      default:
-        throw new UriValidationException("Unsupported return type: " + returnType.getKind(),
-            UriValidationException.MessageKeys.UNSUPPORTED_FUNCTION_RETURN_TYPE, returnType.getKind().toString());
-      }
-      break;
+          final EdmType returnType = function.getReturnType().getType();
+          switch (returnType.getKind()) {
+          case ENTITY:
+            idx = RowIndexForUriType.entitySetCount;
+            break;
+          case COMPLEX:
+            idx = RowIndexForUriType.propertyComplexCollectionCount;
+            break;
+          case PRIMITIVE:
+          case ENUM:
+          case DEFINITION:
+            idx = RowIndexForUriType.propertyPrimitiveCollectionCount;
+            break;
+          default:
+            throw new UriValidationException("Unsupported return type: " + returnType.getKind(),
+                UriValidationException.MessageKeys.UNSUPPORTED_FUNCTION_RETURN_TYPE, returnType.getKind().toString());
+          }
+          break;
     default:
       throw new UriValidationException("Illegal path part kind before $count: " + secondLastPathSegment.getKind(),
           UriValidationException.MessageKeys.UNALLOWED_KIND_BEFORE_COUNT, secondLastPathSegment.toString());
@@ -560,136 +559,136 @@ public class UriValidator {
   private void validateParameters(final UriInfo uriInfo) throws UriValidationException {
     for (UriResource pathSegment : uriInfo.getUriResourceParts()) {
       final boolean isFunction = pathSegment.getKind() == UriResourceKind.function;
-      
-      if(isFunction) {
+
+      if (isFunction) {
         final UriResourceFunction functionPathSegement = (UriResourceFunction) pathSegment;
         final EdmFunction edmFuntion = functionPathSegement.getFunction();
-        
+
         final Map<String, UriParameter> parameters = new HashMap<String, UriParameter>();
-        for(final UriParameter parameter : functionPathSegement.getParameters()) {
+        for (final UriParameter parameter : functionPathSegement.getParameters()) {
           parameters.put(parameter.getName(), parameter);
         }
-        
+
         boolean firstParameter = true;
-        for(final String parameterName : edmFuntion.getParameterNames()) {
+        for (final String parameterName : edmFuntion.getParameterNames()) {
           final UriParameter parameter = parameters.get(parameterName);
           final boolean isNullable = edmFuntion.getParameter(parameterName).isNullable();
-          
-          if(parameter != null) {
+
+          if (parameter != null) {
             /** No alias, value explicit null */
-            if(parameter.getText() == null 
+            if (parameter.getText() == null
                 && parameter.getAlias() == null && !isNullable) {
-              throw new UriValidationException("Missing non nullable parameter " + parameterName, 
+              throw new UriValidationException("Missing non nullable parameter " + parameterName,
                   UriValidationException.MessageKeys.MISSING_PARAMETER, parameterName);
-            } else if(parameter.getText() == null && parameter.getAlias() != null) {
+            } else if (parameter.getText() == null && parameter.getAlias() != null) {
               final String valueForAlias = uriInfo.getValueForAlias(parameter.getAlias());
               /** Alias value is missing or explicit null **/
-              if(valueForAlias == null && !isNullable) {
-                throw new UriValidationException("Missing non nullable parameter " + parameterName, 
+              if (valueForAlias == null && !isNullable) {
+                throw new UriValidationException("Missing non nullable parameter " + parameterName,
                     UriValidationException.MessageKeys.MISSING_PARAMETER, parameterName);
               }
             }
-            
+
             parameters.remove(parameterName);
-          } else if(!isNullable && !(firstParameter && edmFuntion.isBound())) {
+          } else if (!isNullable && !(firstParameter && edmFuntion.isBound())) {
             // The first parameter of bound functions is implicit provided by the preceding path segment
-            throw new UriValidationException("Missing non nullable parameter " + parameterName, 
+            throw new UriValidationException("Missing non nullable parameter " + parameterName,
                 UriValidationException.MessageKeys.MISSING_PARAMETER, parameterName);
           }
-          
+
           firstParameter = false;
         }
-        
-        if(!parameters.isEmpty()) {
+
+        if (!parameters.isEmpty()) {
           final String parameterName = parameters.keySet().iterator().next();
-          throw new UriValidationException("Unsupported parameter " + parameterName, 
+          throw new UriValidationException("Unsupported parameter " + parameterName,
               UriValidationException.MessageKeys.UNSUPPORTED_PARAMETER, parameterName);
         }
       }
     }
   }
-  
+
   private void validateKeyPredicates(final UriInfo uriInfo) throws UriValidationException {
     for (UriResource pathSegment : uriInfo.getUriResourceParts()) {
       final boolean isEntitySet = pathSegment.getKind() == UriResourceKind.entitySet;
       final boolean isEntityColFunction = isEntityColFunction(pathSegment);
-      
+
       if (isEntitySet || pathSegment.getKind() == UriResourceKind.navigationProperty || isEntityColFunction) {
         final List<UriParameter> keyPredicates = isEntitySet ?
             ((UriResourceEntitySet) pathSegment).getKeyPredicates() :
-              isEntityColFunction ? ((UriResourceFunction) pathSegment).getKeyPredicates()
-              : ((UriResourceNavigation) pathSegment).getKeyPredicates();
-            
-        if (keyPredicates != null) {
+            isEntityColFunction ? ((UriResourceFunction) pathSegment).getKeyPredicates()
+                : ((UriResourceNavigation) pathSegment).getKeyPredicates();
 
-          final EdmEntityType entityType = isEntitySet ?
-              ((UriResourceEntitySet) pathSegment).getEntityType() :
-              isEntityColFunction ? (EdmEntityType) ((UriResourceFunction) pathSegment).getType() 
-              : (EdmEntityType) ((UriResourceNavigation) pathSegment).getType();
-          final List<String> keyPredicateNames = entityType.getKeyPredicateNames();
-          Map<String, EdmKeyPropertyRef> edmKeys = new HashMap<String, EdmKeyPropertyRef>();
-          for (EdmKeyPropertyRef key : entityType.getKeyPropertyRefs()) {
-            edmKeys.put(key.getName(), key);
-            final String alias = key.getAlias();
-            if (alias != null) {
-              edmKeys.put(alias, key);
-            }
-          }
-
-          for (UriParameter keyPredicate : keyPredicates) {
-            final String name = keyPredicate.getName();
-            final String alias = keyPredicate.getAlias();
-
-            if (keyPredicate.getReferencedProperty() == null) {
-              final String value = alias == null ?
-                  keyPredicate.getText() :
-                  uriInfo.getValueForAlias(alias);
-
-              EdmKeyPropertyRef edmKey = edmKeys.get(name);
-              if (edmKey == null) {
-                if (keyPredicateNames.contains(name)) {
-                  throw new UriValidationException("Double key property: " + name,
-                      UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY, name);
-                } else {
-                  throw new UriValidationException("Unknown key property: " + name,
-                      UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
-                }
-              }
+        if (keyPredicates != null) {
 
-              final EdmProperty property = edmKey.getProperty();
-              final EdmPrimitiveType edmPrimitiveType = (EdmPrimitiveType) property.getType();
-              try {
-                if (!edmPrimitiveType.validate(edmPrimitiveType.fromUriLiteral(value),
-                    property.isNullable(), property.getMaxLength(),
-                    property.getPrecision(), property.getScale(), property.isUnicode())) {
-                  throw new UriValidationException("PrimitiveTypeException",
-                      UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
-                }
-              } catch (EdmPrimitiveTypeException e) {
-                throw new UriValidationException("PrimitiveTypeException", e,
-                    UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
+                final EdmEntityType entityType = isEntitySet ?
+                    ((UriResourceEntitySet) pathSegment).getEntityType() :
+                      isEntityColFunction ? (EdmEntityType) ((UriResourceFunction) pathSegment).getType()
+                  : (EdmEntityType) ((UriResourceNavigation) pathSegment).getType();
+                      final List<String> keyPredicateNames = entityType.getKeyPredicateNames();
+                      Map<String, EdmKeyPropertyRef> edmKeys = new HashMap<String, EdmKeyPropertyRef>();
+                      for (EdmKeyPropertyRef key : entityType.getKeyPropertyRefs()) {
+                        edmKeys.put(key.getName(), key);
+                        final String alias = key.getAlias();
+                        if (alias != null) {
+                          edmKeys.put(alias, key);
+                        }
+                      }
+
+                      for (UriParameter keyPredicate : keyPredicates) {
+                        final String name = keyPredicate.getName();
+                        final String alias = keyPredicate.getAlias();
+
+                        if (keyPredicate.getReferencedProperty() == null) {
+                          final String value = alias == null ?
+                              keyPredicate.getText() :
+                                uriInfo.getValueForAlias(alias);
+
+                              EdmKeyPropertyRef edmKey = edmKeys.get(name);
+                              if (edmKey == null) {
+                                if (keyPredicateNames.contains(name)) {
+                                  throw new UriValidationException("Double key property: " + name,
+                                      UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY, name);
+                                } else {
+                                  throw new UriValidationException("Unknown key property: " + name,
+                                      UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
+                                }
+                              }
+
+                              final EdmProperty property = edmKey.getProperty();
+                              final EdmPrimitiveType edmPrimitiveType = (EdmPrimitiveType) property.getType();
+                              try {
+                                if (!edmPrimitiveType.validate(edmPrimitiveType.fromUriLiteral(value),
+                                    property.isNullable(), property.getMaxLength(),
+                                    property.getPrecision(), property.getScale(), property.isUnicode())) {
+                                  throw new UriValidationException("PrimitiveTypeException",
+                                      UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
+                                }
+                              } catch (EdmPrimitiveTypeException e) {
+                                throw new UriValidationException("PrimitiveTypeException", e,
+                                    UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
+                              }
+                        }
+
+                        edmKeys.remove(name);
+                        edmKeys.remove(alias);
+                      }
               }
-            }
-
-            edmKeys.remove(name);
-            edmKeys.remove(alias);
-          }
-        }
       }
     }
   }
 
   private boolean isEntityColFunction(final UriResource pathSegment) {
-    if(pathSegment.getKind() == UriResourceKind.function) {
+    if (pathSegment.getKind() == UriResourceKind.function) {
       final UriResourceFunction resourceFunction = (UriResourceFunction) pathSegment;
       final EdmReturnType returnType = resourceFunction.getFunction().getReturnType();
-      
+
       return returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY;
     } else {
       return false;
     }
   }
-  
+
   private void validatePropertyOperations(final UriInfo uriInfo, final HttpMethod method)
       throws UriValidationException {
     final List<UriResource> parts = uriInfo.getUriResourceParts();
@@ -697,9 +696,9 @@ public class UriValidator {
     final UriResource previous = parts.size() > 1 ? parts.get(parts.size() - 2) : null;
     if (last != null
         && (last.getKind() == UriResourceKind.primitiveProperty
-            || last.getKind() == UriResourceKind.complexProperty
-            || (last.getKind() == UriResourceKind.value
-                          && previous != null && previous.getKind() == UriResourceKind.primitiveProperty))) {
+        || last.getKind() == UriResourceKind.complexProperty
+        || (last.getKind() == UriResourceKind.value
+            && previous != null && previous.getKind() == UriResourceKind.primitiveProperty))) {
       final EdmProperty property = ((UriResourceProperty)
           (last.getKind() == UriResourceKind.value ? previous : last)).getProperty();
       if (method == HttpMethod.PATCH && property.isCollection()) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java
index 999a20c..ce0abe7 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -77,7 +77,7 @@ public class ContentNegotiatorTest {
       { ACCEPT_CASE_MIN_UTF8_IEEE754, null,             ACCEPT_CASE_MIN_UTF8_IEEE754,   null                  },
       { ACCEPT_CASE_MIN_IEEE754,      ACCEPT_CASE_MIN_IEEE754, ACCEPT_CASE_MIN ,        null                  },
       { ACCEPT_CASE_XML,              "xml",            null,                           null                  },
-      { ACCEPT_CASE_XML,              null,             ACCEPT_CASE_XML,                null                  }      
+      { ACCEPT_CASE_XML,              null,             ACCEPT_CASE_XML,                null                  }
   };
 
   String[][] casesMetadata = {
@@ -191,7 +191,7 @@ public class ContentNegotiatorTest {
     }
 
     final CustomContentTypeSupport customContentTypeSupport = useCase[3] == null ? null :
-        createCustomContentTypeSupport(useCase[3]);
+      createCustomContentTypeSupport(useCase[3]);
 
     final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(
         formatOption, request, customContentTypeSupport, representationType);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java
index b3d59da..c4eb24c 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ExceptionHelperTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,8 +22,8 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import org.apache.olingo.commons.api.http.HttpStatusCode;
-import org.apache.olingo.server.api.ODataLibraryException.MessageKey;
 import org.apache.olingo.server.api.ODataLibraryException;
+import org.apache.olingo.server.api.ODataLibraryException.MessageKey;
 import org.apache.olingo.server.api.ODataServerError;
 import org.apache.olingo.server.api.deserializer.DeserializerException;
 import org.apache.olingo.server.api.etag.PreconditionException;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java
index 1fcef84..1a66609 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,8 +26,8 @@ import static org.mockito.Mockito.when;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.olingo.commons.api.http.HttpMethod;
-import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.ODataLibraryException;
+import org.apache.olingo.server.api.ODataRequest;
 import org.junit.Test;
 
 public class ODataHttpHandlerImplTest {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java
index 3954a5a..c289b93 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataImplTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java
index 2df68aa..ce7c4c0 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/TranslatedExceptionSubclassesTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
index 8b49bd2..8b5513e 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java
index 13a690f..95a3ba1 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/AbstractDebugTabTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,14 +26,14 @@ import com.fasterxml.jackson.core.JsonGenerator;
 
 public abstract class AbstractDebugTabTest {
 
-  protected String createHtml(DebugTab tab) throws IOException {
+  protected String createHtml(final DebugTab tab) throws IOException {
     StringWriter writer = new StringWriter();
     tab.appendHtml(writer);
     writer.flush();
     return writer.toString();
   }
 
-  protected String createJson(DebugTab tab) throws IOException {
+  protected String createJson(final DebugTab tab) throws IOException {
     StringWriter writer = new StringWriter();
     JsonGenerator gen = new JsonFactory().createGenerator(writer);
     tab.appendJson(gen);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java
index 16f0e15..088e398 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabBodyTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java
index 24732ba..3ae565c 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabRequestTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java
index 8ca5306..b268545 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabResponseTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java
index fa54c3d..53a5693 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/DebugTabServerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -64,7 +64,7 @@ public class DebugTabServerTest extends AbstractDebugTabTest {
     assertTrue(html.contains("<tr><td class=\"name\">key2</td><td class=\"value\">value2</td></tr>"));
     assertTrue(html.endsWith("</table>\n"));
   }
-  
+
   @Test
   public void twoParametersWithNull() throws Exception {
     Map<String, String> env = new LinkedHashMap<String, String>();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java
index 3d994a9..280ff38 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -49,7 +49,7 @@ public class ServerCoreDebuggerTest {
     DebugSupport processor = mock(DebugSupport.class);
     when(processor.isUserAuthorized()).thenReturn(true);
     when(processor.createDebugResponse(anyString(), any(DebugInformation.class)))
-        .thenThrow(new ODataRuntimeException("Test"));
+    .thenThrow(new ODataRuntimeException("Test"));
     debugger.setDebugSupportProcessor(processor);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java
index e1d129f..77be67f 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/FixedFormatDeserializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java
index 9861b7f..ea202db 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReaderTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java
index 137c89a..276c5b2 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommonTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java
index 008fdbe..059b32f 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -474,30 +474,30 @@ public class BatchRequestParserTest {
         + CRLF
         + CRLF
         + "--batch_8194-cf13-1f56--";
-    
+
     List<BatchRequestPart> requests = parse(batch);
     assertEquals(HttpMethod.POST, requests.get(0).getRequests().get(0).getMethod());
     assertEquals("/Employees", requests.get(0).getRequests().get(0).getRawODataPath());
     assertEquals("{ \"Name\": \"Foo\" }", IOUtils.toString(requests.get(0).getRequests().get(0).getBody()));
-    
+
     requests = parse(batch);
     assertEquals(HttpMethod.DELETE, requests.get(1).getRequests().get(0).getMethod());
     assertEquals("/Employees('1')", requests.get(1).getRequests().get(0).getRawODataPath());
-    
+
     requests = parse(batch);
     assertEquals(HttpMethod.PATCH, requests.get(2).getRequests().get(0).getMethod());
     assertEquals("{ \"Name\": \"Foo\" }", IOUtils.toString(requests.get(0).getRequests().get(0).getBody()));
     assertEquals("/Employees('1')", requests.get(2).getRequests().get(0).getRawODataPath());
-    
+
     requests = parse(batch);
     assertEquals(HttpMethod.PUT, requests.get(3).getRequests().get(0).getMethod());
     assertEquals("{ \"Name\": \"Foo\" }", IOUtils.toString(requests.get(0).getRequests().get(0).getBody()));
     assertEquals("/Employees('1')", requests.get(3).getRequests().get(0).getRawODataPath());
-    
+
     requests = parse(batch);
     assertEquals(HttpMethod.GET, requests.get(4).getRequests().get(0).getMethod());
     assertEquals("/Employees('1')", requests.get(4).getRequests().get(0).getRawODataPath());
-    
+
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java
index e808cb1..f87ffca 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HeaderTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
index 1d3bb1f..eb87baa 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
index 8160165..419ab80 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java
index e992a5c..58a8457 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagHelperTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java
index 3e68af6..06a432b 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/etag/ETagParserTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java
index b0e8d74..9f4a45e 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/prefer/PreferencesTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -53,8 +53,8 @@ public class PreferencesTest {
   public void all() {
     final Preferences preferences = new PreferencesImpl(Collections.singleton(
         "odata.allow-entityreferences, odata.callback;url=\"callbackURI\","
-        + "odata.continue-on-error, odata.include-annotations=\"*\", odata.maxpagesize=42,"
-        + "odata.track-changes, return=representation, respond-async, wait=12345"));
+            + "odata.continue-on-error, odata.include-annotations=\"*\", odata.maxpagesize=42,"
+            + "odata.track-changes, return=representation, respond-async, wait=12345"));
     assertTrue(preferences.hasAllowEntityReferences());
     assertEquals(URI.create("callbackURI"), preferences.getCallback());
     assertNotNull(preferences.getPreference("odata.callback"));

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java
index d70de62..1095fb3 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/AsyncResponseSerializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,6 +18,11 @@
  */
 package org.apache.olingo.server.core.serializer;
 
+import static org.junit.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.util.Random;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.http.HttpHeader;
@@ -25,11 +30,6 @@ import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.apache.olingo.server.api.ODataResponse;
 import org.junit.Test;
 
-import java.io.InputStream;
-import java.util.Random;
-
-import static org.junit.Assert.assertEquals;
-
 public class AsyncResponseSerializerTest {
   private static final String CRLF = "\r\n";
 
@@ -70,11 +70,11 @@ public class AsyncResponseSerializerTest {
         + testData, result);
   }
 
-  private String testData(int amount) {
+  private String testData(final int amount) {
     StringBuilder result = new StringBuilder();
     Random r = new Random();
     for (int i = 0; i < amount; i++) {
-      result.append((char)(r.nextInt(26) + 'a'));
+      result.append((char) (r.nextInt(26) + 'a'));
     }
 
     return result.toString();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java
index b57340d..1f0d7a3 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/BatchResponseSerializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -106,7 +106,7 @@ public class BatchResponseSerializerTest {
     ODataResponse response = new ODataResponse();
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
     response.setHeader(HttpHeader.CONTENT_TYPE,
-            ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=UTF-8");
+        ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=UTF-8");
     response.setContent(IOUtils.toInputStream("Wälter Winter" + CRLF));
 
     List<ODataResponse> responses = new ArrayList<ODataResponse>(1);
@@ -124,7 +124,7 @@ public class BatchResponseSerializerTest {
     final InputStream content = serializer.serialize(parts, BOUNDARY);
     assertNotNull(content);
     final BatchLineReader reader =
-            new BatchLineReader(content);
+        new BatchLineReader(content);
     final List<String> body = reader.toList();
     reader.close();
 
@@ -233,8 +233,8 @@ public class BatchResponseSerializerTest {
     changeSetResponse.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode());
     changeSetResponse.setHeader(HttpHeader.CONTENT_ID, "1");
 
-//    byte[] umlauts = "äüö".getBytes(CS_UTF_8);
-//    changeSetResponse.setHeader("Custom-Header", new String(umlauts, CS_UTF_8));
+    //    byte[] umlauts = "äüö".getBytes(CS_UTF_8);
+    //    changeSetResponse.setHeader("Custom-Header", new String(umlauts, CS_UTF_8));
     changeSetResponse.setHeader("Custom-Header", "äüö");
     responses = new ArrayList<ODataResponse>(1);
     responses.add(changeSetResponse);
@@ -251,7 +251,7 @@ public class BatchResponseSerializerTest {
     assertEquals(25, body.size());
     // TODO: check: with latest change in BatchResponseSerializer is not possible
     // to set header values with UTF-8 (only iso-8859-1)
-//    assertEquals("Custom-Header: äüö" + CRLF, body.get(19));
+    //    assertEquals("Custom-Header: äüö" + CRLF, body.get(19));
     assertEquals("Custom-Header: äüö" + CRLF, body.get(19));
   }
 
@@ -261,7 +261,7 @@ public class BatchResponseSerializerTest {
     ODataResponse response = new ODataResponse();
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
     response.setHeader(HttpHeader.CONTENT_TYPE,
-            ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=iso-8859-1");
+        ContentType.APPLICATION_JSON.toContentTypeString() + "; charset=iso-8859-1");
     byte[] payload = ("Wälter Winter" + CRLF).getBytes("iso-8859-1");
     response.setContent(new ByteArrayInputStream(payload));
 
@@ -280,7 +280,7 @@ public class BatchResponseSerializerTest {
     final InputStream content = serializer.serialize(parts, BOUNDARY);
     assertNotNull(content);
     final BatchLineReader reader =
-            new BatchLineReader(content);
+        new BatchLineReader(content);
     final List<String> body = reader.toList();
     reader.close();
 
@@ -419,7 +419,7 @@ public class BatchResponseSerializerTest {
 
     assertNotNull(content);
     final BatchLineReader reader =
-            new BatchLineReader(content);
+        new BatchLineReader(content);
     final List<String> body = reader.toList();
     reader.close();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java
index 21c7677..a0586e3 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
index febd3eb..c0e2121 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -111,8 +111,8 @@ public class ServerErrorSerializerTest {
   public void verifiedWithJacksonParser() throws Exception {
     ODataServerError error =
         new ODataServerError().setCode("Code").setMessage("Message").setTarget("Target")
-            .setDetails(Collections.singletonList(
-                new ODataErrorDetail().setCode("detailCode").setMessage("detailMessage").setTarget("detailTarget")));
+        .setDetails(Collections.singletonList(
+            new ODataErrorDetail().setCode("detailCode").setMessage("detailMessage").setTarget("detailTarget")));
     InputStream stream = ser.error(error).getContent();
     JsonNode tree = new ObjectMapper().readTree(stream);
     assertNotNull(tree);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java
index b5c28bc..e6d45c2 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBufferTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -159,7 +159,6 @@ public class CircleStreamBufferTest {
     assertEquals(testData, result);
   }
 
-
   @Test
   public void testSimpleWriteMoreThenDefaultBufferSize() throws Exception {
     CircleStreamBuffer csb = new CircleStreamBuffer();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java
index ee53bc3..3928985 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY


[42/51] [abbrv] olingo-odata4 git commit: [OLINGO-852] reduced usage of Serializable and org.apache.commons.lang3 in commons

Posted by mi...@apache.org.
[OLINGO-852] reduced usage of Serializable and org.apache.commons.lang3 in commons

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 36e6dc9295399cecd502030b316c20fea13150e2
Parents: 58ead74
Author: Klaus Straubinger <kl...@sap.com>
Authored: Tue Jan 19 15:19:10 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Wed Jan 20 13:27:21 2016 +0100

----------------------------------------------------------------------
 lib/client-api/pom.xml                          |  4 ++
 .../client/core/edm/ClientCsdlXMLMetadata.java  |  3 +-
 .../client/core/edm/xml/ClientCsdlAction.java   |  4 +-
 .../core/edm/xml/ClientCsdlActionImport.java    |  4 +-
 .../core/edm/xml/ClientCsdlAnnotation.java      |  3 +-
 .../core/edm/xml/ClientCsdlAnnotations.java     |  4 +-
 .../core/edm/xml/ClientCsdlComplexType.java     |  4 +-
 .../core/edm/xml/ClientCsdlDataServices.java    |  4 +-
 .../client/core/edm/xml/ClientCsdlEdmx.java     |  4 +-
 .../core/edm/xml/ClientCsdlEntityContainer.java |  4 +-
 .../core/edm/xml/ClientCsdlEntityKey.java       |  4 +-
 .../core/edm/xml/ClientCsdlEntitySet.java       |  4 +-
 .../core/edm/xml/ClientCsdlEntityType.java      |  4 +-
 .../core/edm/xml/ClientCsdlEnumMember.java      |  4 +-
 .../client/core/edm/xml/ClientCsdlEnumType.java |  4 +-
 .../client/core/edm/xml/ClientCsdlFunction.java |  4 +-
 .../core/edm/xml/ClientCsdlFunctionImport.java  |  4 +-
 .../client/core/edm/xml/ClientCsdlInclude.java  |  4 +-
 .../edm/xml/ClientCsdlIncludeAnnotations.java   |  4 +-
 .../edm/xml/ClientCsdlNavigationProperty.java   |  4 +-
 .../ClientCsdlNavigationPropertyBinding.java    |  4 +-
 .../client/core/edm/xml/ClientCsdlOnDelete.java |  4 +-
 .../core/edm/xml/ClientCsdlParameter.java       |  4 +-
 .../client/core/edm/xml/ClientCsdlProperty.java |  4 +-
 .../core/edm/xml/ClientCsdlPropertyRef.java     |  4 +-
 .../core/edm/xml/ClientCsdlReference.java       |  4 +-
 .../xml/ClientCsdlReferentialConstraint.java    |  4 +-
 .../core/edm/xml/ClientCsdlReturnType.java      |  4 +-
 .../client/core/edm/xml/ClientCsdlSchema.java   |  4 +-
 .../core/edm/xml/ClientCsdlSingleton.java       |  4 +-
 .../client/core/edm/xml/ClientCsdlTerm.java     |  4 +-
 .../core/edm/xml/ClientCsdlTypeDefinition.java  |  4 +-
 .../edm/xml/annotation/ClientCsdlApply.java     |  3 +-
 .../core/edm/xml/annotation/ClientCsdlCast.java |  3 +-
 .../xml/annotation/ClientCsdlCollection.java    |  3 +-
 .../annotation/ClientCsdlDynamicExpression.java |  3 +-
 .../core/edm/xml/annotation/ClientCsdlIsOf.java |  3 +-
 .../annotation/ClientCsdlLabeledElement.java    |  3 +-
 .../core/edm/xml/annotation/ClientCsdlNull.java |  3 +-
 .../xml/annotation/ClientCsdlPropertyValue.java |  3 +-
 .../edm/xml/annotation/ClientCsdlRecord.java    |  3 +-
 .../edm/xml/annotation/ClientCsdlUrlRef.java    |  3 +-
 lib/commons-api/pom.xml                         |  5 --
 .../commons/api/data/AbstractODataObject.java   | 25 ++++++++++
 .../olingo/commons/api/data/Annotatable.java    | 30 ------------
 .../olingo/commons/api/data/Annotation.java     | 18 +++++++
 .../olingo/commons/api/data/ComplexValue.java   | 17 +++++++
 .../apache/olingo/commons/api/data/Delta.java   | 17 +++++++
 .../olingo/commons/api/data/DeltaLink.java      | 25 ++++++++++
 .../apache/olingo/commons/api/data/Entity.java  | 40 ++++++++++++++++
 .../commons/api/data/EntityCollection.java      | 27 +++++++++--
 .../apache/olingo/commons/api/data/Link.java    | 37 +++++++++++++++
 .../apache/olingo/commons/api/data/Linked.java  | 17 +++++++
 .../olingo/commons/api/data/Parameter.java      | 18 +++++++
 .../olingo/commons/api/data/Property.java       | 18 +++++++
 .../olingo/commons/api/data/Valuable.java       | 30 ++++++++++++
 .../api/edm/provider/CsdlAbstractEdmItem.java   | 25 +---------
 .../commons/api/edm/provider/CsdlAction.java    |  2 -
 .../api/edm/provider/CsdlActionImport.java      |  2 -
 .../api/edm/provider/CsdlAnnotation.java        |  2 -
 .../api/edm/provider/CsdlAnnotations.java       |  2 -
 .../api/edm/provider/CsdlBindingTarget.java     |  2 -
 .../api/edm/provider/CsdlComplexType.java       |  2 -
 .../api/edm/provider/CsdlEntityContainer.java   |  2 -
 .../commons/api/edm/provider/CsdlEntitySet.java |  2 -
 .../api/edm/provider/CsdlEntityType.java        |  2 -
 .../api/edm/provider/CsdlEnumMember.java        |  2 -
 .../commons/api/edm/provider/CsdlEnumType.java  |  2 -
 .../commons/api/edm/provider/CsdlFunction.java  |  2 -
 .../api/edm/provider/CsdlFunctionImport.java    |  2 -
 .../edm/provider/CsdlNavigationProperty.java    |  2 -
 .../provider/CsdlNavigationPropertyBinding.java |  2 -
 .../commons/api/edm/provider/CsdlOnDelete.java  |  2 -
 .../commons/api/edm/provider/CsdlOperation.java |  2 -
 .../api/edm/provider/CsdlOperationImport.java   |  2 -
 .../commons/api/edm/provider/CsdlParameter.java |  2 -
 .../commons/api/edm/provider/CsdlProperty.java  |  2 -
 .../api/edm/provider/CsdlPropertyRef.java       |  2 -
 .../edm/provider/CsdlReferentialConstraint.java |  2 -
 .../api/edm/provider/CsdlReturnType.java        |  2 -
 .../commons/api/edm/provider/CsdlSchema.java    |  2 -
 .../commons/api/edm/provider/CsdlSingleton.java |  2 -
 .../api/edm/provider/CsdlStructuralType.java    |  2 -
 .../commons/api/edm/provider/CsdlTerm.java      |  2 -
 .../api/edm/provider/CsdlTypeDefinition.java    |  2 -
 .../provider/annotation/CsdlAnnotationPath.java |  1 -
 .../api/edm/provider/annotation/CsdlApply.java  |  3 +-
 .../api/edm/provider/annotation/CsdlCast.java   |  1 -
 .../edm/provider/annotation/CsdlCollection.java |  1 -
 .../annotation/CsdlConstantExpression.java      |  3 --
 .../annotation/CsdlDynamicExpression.java       |  2 -
 .../edm/provider/annotation/CsdlExpression.java |  2 -
 .../api/edm/provider/annotation/CsdlIf.java     |  2 -
 .../api/edm/provider/annotation/CsdlIsOf.java   |  2 -
 .../provider/annotation/CsdlLabeledElement.java |  4 +-
 .../annotation/CsdlLabeledElementReference.java |  1 -
 .../CsdlLogicalOrComparisonExpression.java      |  2 -
 .../annotation/CsdlNavigationPropertyPath.java  |  1 -
 .../api/edm/provider/annotation/CsdlNull.java   |  2 -
 .../api/edm/provider/annotation/CsdlPath.java   |  1 -
 .../provider/annotation/CsdlPropertyPath.java   |  1 -
 .../provider/annotation/CsdlPropertyValue.java  |  5 +-
 .../api/edm/provider/annotation/CsdlRecord.java |  1 -
 .../api/edm/provider/annotation/CsdlUrlRef.java |  3 +-
 .../primitivetype/AbstractGeospatialType.java   | 49 +++++++++++++-------
 105 files changed, 438 insertions(+), 210 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-api/pom.xml b/lib/client-api/pom.xml
index 64a3793..0f14bdf 100644
--- a/lib/client-api/pom.xml
+++ b/lib/client-api/pom.xml
@@ -50,6 +50,10 @@
       <artifactId>commons-io</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java
index b4f7743..ac4f3e1 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java
@@ -18,6 +18,7 @@
  */
 package org.apache.olingo.client.core.edm;
 
+import java.io.Serializable;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -32,7 +33,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
 /**
  * Entry point for access information about EDM metadata.
  */
-public class ClientCsdlXMLMetadata extends CsdlAbstractEdmItem implements XMLMetadata {
+public class ClientCsdlXMLMetadata extends CsdlAbstractEdmItem implements Serializable, XMLMetadata {
 
   private static final long serialVersionUID = 6025723060298454901L;
   protected final Edmx edmx;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java
index 4514564..9d5ea15 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlAction;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlAction.ActionDeserializer.class)
-class ClientCsdlAction extends CsdlAction {
+class ClientCsdlAction extends CsdlAction implements Serializable {
 
   private static final long serialVersionUID = 5321541275349234088L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java
index ee6c69d..1ec869a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java
@@ -22,12 +22,14 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlActionImport.ActionImportDeserializer.class)
-class ClientCsdlActionImport extends CsdlActionImport {
+class ClientCsdlActionImport extends CsdlActionImport implements Serializable {
 
   private static final long serialVersionUID = 2971468441177647068L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java
index 131b6c9..8491626 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.annotation.ClientCsdlDynamicExpression;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
@@ -29,7 +30,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlAnnotation.AnnotationDeserializer.class)
-public class ClientCsdlAnnotation extends CsdlAnnotation {
+public class ClientCsdlAnnotation extends CsdlAnnotation implements Serializable {
 
   private static final long serialVersionUID = 5464714417411058033L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java
index c710a42..b870e48 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java
@@ -21,14 +21,16 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlAnnotations.AnnotationsDeserializer.class)
-class ClientCsdlAnnotations extends CsdlAnnotations {
+class ClientCsdlAnnotations extends CsdlAnnotations implements Serializable {
 
   private static final long serialVersionUID = -5961207981571644200L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java
index 0b59e99..c56d5b9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlComplexType.ComplexTypeDeserializer.class)
-class ClientCsdlComplexType extends CsdlComplexType {
+class ClientCsdlComplexType extends CsdlComplexType implements Serializable {
 
   private static final long serialVersionUID = 4076944306925840115L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java
index 072ad0f..86606fb 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java
@@ -19,12 +19,14 @@
 package org.apache.olingo.client.core.edm.xml;
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.client.api.edm.xml.DataServices;
 import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
@@ -32,7 +34,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlDataServices.DataServicesDeserializer.class)
-class ClientCsdlDataServices extends CsdlAbstractEdmItem implements DataServices {
+class ClientCsdlDataServices extends CsdlAbstractEdmItem implements Serializable, DataServices {
 
   private static final long serialVersionUID = 4200317286476885204L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java
index ba0d26d..9c675b9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java
@@ -19,12 +19,14 @@
 package org.apache.olingo.client.core.edm.xml;
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.client.api.edm.xml.DataServices;
 import org.apache.olingo.client.api.edm.xml.Edmx;
 import org.apache.olingo.client.api.edm.xml.Reference;
@@ -33,7 +35,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlEdmx.EdmxDeserializer.class)
-public class ClientCsdlEdmx extends CsdlAbstractEdmItem implements Edmx {
+public class ClientCsdlEdmx extends CsdlAbstractEdmItem implements Serializable, Edmx {
 
   private static final long serialVersionUID = -6293476719276092572L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java
index de83325..ba3c945 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java
@@ -21,14 +21,16 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlEntityContainer.EntityContainerDeserializer.class)
-class ClientCsdlEntityContainer extends CsdlEntityContainer {
+class ClientCsdlEntityContainer extends CsdlEntityContainer implements Serializable {
 
   private static final long serialVersionUID = 5631432527646955795L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java
index 7be9a90..574a6b9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java
@@ -19,19 +19,21 @@
 package org.apache.olingo.client.core.edm.xml;
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlEntityKey.EntityKeyDeserializer.class)
-class ClientCsdlEntityKey extends CsdlAbstractEdmItem {
+class ClientCsdlEntityKey extends CsdlAbstractEdmItem implements Serializable {
 
   private static final long serialVersionUID = 520227585458843347L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java
index 6973a27..1896f6d 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlEntitySet.EntitySetDeserializer.class)
-class ClientCsdlEntitySet extends CsdlEntitySet {
+class ClientCsdlEntitySet extends CsdlEntitySet implements Serializable {
 
   private static final long serialVersionUID = -5553885465204370676L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java
index f08bcbe..5f6644a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlEntityType.EntityTypeDeserializer.class)
-class ClientCsdlEntityType extends CsdlEntityType {
+class ClientCsdlEntityType extends CsdlEntityType implements Serializable {
 
   private static final long serialVersionUID = -3986417775876689669L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java
index 057a678..70aba5d 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java
@@ -22,12 +22,14 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlEnumMember.EnumMemberDeserializer.class)
-class ClientCsdlEnumMember extends CsdlEnumMember {
+class ClientCsdlEnumMember extends CsdlEnumMember implements Serializable {
 
   private static final long serialVersionUID = -6138606817225829791L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java
index a49f3ff..e6a6970 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlEnumType;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlEnumType.EnumTypeDeserializer.class)
-class ClientCsdlEnumType extends CsdlEnumType {
+class ClientCsdlEnumType extends CsdlEnumType implements Serializable {
 
   private static final long serialVersionUID = 9191189755592743333L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java
index 97fd637..c4caaba 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlFunction;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlFunction.FunctionDeserializer.class)
-class ClientCsdlFunction extends CsdlFunction {
+class ClientCsdlFunction extends CsdlFunction implements Serializable {
 
   private static final long serialVersionUID = -5494898295282843362L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java
index 6b6a044..61564d2 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlFunctionImport.FunctionImportDeserializer.class)
-class ClientCsdlFunctionImport extends CsdlFunctionImport {
+class ClientCsdlFunctionImport extends CsdlFunctionImport implements Serializable {
 
   private static final long serialVersionUID = -1686801084142932402L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java
index 541f037..5a21efc 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java
@@ -22,13 +22,15 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.client.api.edm.xml.Include;
 import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlInclude.IncludeDeserializer.class)
-class ClientCsdlInclude extends CsdlAbstractEdmItem implements Include {
+class ClientCsdlInclude extends CsdlAbstractEdmItem implements Serializable, Include {
 
   private static final long serialVersionUID = -5450008299655584221L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java
index 87150ea..d230f54 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java
@@ -22,13 +22,15 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
 import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlIncludeAnnotations.IncludeAnnotationsDeserializer.class)
-class ClientCsdlIncludeAnnotations extends CsdlAbstractEdmItem implements IncludeAnnotations {
+class ClientCsdlIncludeAnnotations extends CsdlAbstractEdmItem implements Serializable, IncludeAnnotations {
 
   private static final long serialVersionUID = -8157841387011422396L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java
index 2fca830..b456505 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java
@@ -21,15 +21,17 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlNavigationProperty.NavigationPropertyDeserializer.class)
-class ClientCsdlNavigationProperty extends CsdlNavigationProperty {
+class ClientCsdlNavigationProperty extends CsdlNavigationProperty implements Serializable {
 
   private static final long serialVersionUID = 6240231735592427582L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java
index d9da5b0..6f9a749 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java
@@ -22,12 +22,14 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlNavigationPropertyBinding.NavigationPropertyBindingDeserializer.class)
-class ClientCsdlNavigationPropertyBinding extends CsdlNavigationPropertyBinding {
+class ClientCsdlNavigationPropertyBinding extends CsdlNavigationPropertyBinding implements Serializable {
 
   private static final long serialVersionUID = -7056978592235483660L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java
index 6fa992f..68ac862 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java
@@ -22,13 +22,15 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete;
 import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlOnDelete.OnDeleteDeserializer.class)
-class ClientCsdlOnDelete extends CsdlOnDelete {
+class ClientCsdlOnDelete extends CsdlOnDelete implements Serializable {
 
   private static final long serialVersionUID = -7130889202653716784L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java
index 4df4377..dc4f41e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java
@@ -21,6 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.geo.SRID;
 import org.apache.olingo.commons.api.edm.provider.CsdlParameter;
@@ -28,9 +29,10 @@ import org.apache.olingo.commons.api.edm.provider.CsdlParameter;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlParameter.ParameterDeserializer.class)
-class ClientCsdlParameter extends CsdlParameter {
+class ClientCsdlParameter extends CsdlParameter implements Serializable {
 
   private static final long serialVersionUID = 7119478691341167904L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java
index 647f386..0fc7507 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java
@@ -21,6 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.geo.SRID;
 import org.apache.olingo.commons.api.edm.provider.CsdlProperty;
@@ -28,9 +29,10 @@ import org.apache.olingo.commons.api.edm.provider.CsdlProperty;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlProperty.PropertyDeserializer.class)
-class ClientCsdlProperty extends CsdlProperty {
+class ClientCsdlProperty extends CsdlProperty implements Serializable {
 
   private static final long serialVersionUID = -4521766603286651372L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java
index 6e32473..e9e694e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java
@@ -22,12 +22,14 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlPropertyRef.PropertyRefDeserializer.class)
-class ClientCsdlPropertyRef extends CsdlPropertyRef {
+class ClientCsdlPropertyRef extends CsdlPropertyRef implements Serializable {
 
   private static final long serialVersionUID = 1504095609268590326L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java
index b0b71e7..1e6c5f5 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml;
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
@@ -26,6 +27,7 @@ import java.util.List;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.client.api.edm.xml.Include;
 import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
 import org.apache.olingo.client.api.edm.xml.Reference;
@@ -35,7 +37,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlReference.ReferenceDeserializer.class)
-class ClientCsdlReference extends CsdlAbstractEdmItem implements Reference {
+class ClientCsdlReference extends CsdlAbstractEdmItem implements Serializable, Reference {
 
   private static final long serialVersionUID = 7720274712545267654L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java
index 1327766..2bb3083 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java
@@ -22,12 +22,14 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlReferentialConstraint.ReferentialConstraintDeserializer.class)
-class ClientCsdlReferentialConstraint extends CsdlReferentialConstraint {
+class ClientCsdlReferentialConstraint extends CsdlReferentialConstraint implements Serializable {
 
   private static final long serialVersionUID = -5822115908069878139L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java
index 302bd9f..21f1183 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java
@@ -21,6 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.geo.SRID;
 import org.apache.olingo.commons.api.edm.provider.CsdlReturnType;
@@ -28,9 +29,10 @@ import org.apache.olingo.commons.api.edm.provider.CsdlReturnType;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlReturnType.ReturnTypeDeserializer.class)
-class ClientCsdlReturnType extends CsdlReturnType {
+class ClientCsdlReturnType extends CsdlReturnType implements Serializable {
 
   private static final long serialVersionUID = 6261092793901735110L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java
index bc141c5..7e0c4f5 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java
@@ -21,14 +21,16 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlSchema.SchemaDeserializer.class)
-class ClientCsdlSchema extends CsdlSchema {
+class ClientCsdlSchema extends CsdlSchema implements Serializable {
 
   private static final long serialVersionUID = 1911087363912024939L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java
index 7a2d097..472c9e9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java
@@ -21,14 +21,16 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlSingleton.SingletonDeserializer.class)
-class ClientCsdlSingleton extends CsdlSingleton {
+class ClientCsdlSingleton extends CsdlSingleton implements Serializable {
 
   private static final long serialVersionUID = 1656749615107151921L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java
index b2cef22..48b514e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java
@@ -21,6 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.commons.api.edm.geo.SRID;
@@ -29,10 +30,11 @@ import org.apache.olingo.commons.api.edm.provider.CsdlTerm;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.Arrays;
 
 @JsonDeserialize(using = ClientCsdlTerm.TermDeserializer.class)
-class ClientCsdlTerm extends CsdlTerm {
+class ClientCsdlTerm extends CsdlTerm implements Serializable {
 
   private static final long serialVersionUID = -8350072064720586186L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java
index 420f226..136f30e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java
@@ -21,6 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
+
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.olingo.commons.api.edm.geo.SRID;
 import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition;
@@ -28,9 +29,10 @@ import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 @JsonDeserialize(using = ClientCsdlTypeDefinition.TypeDefinitionDeserializer.class)
-class ClientCsdlTypeDefinition extends CsdlTypeDefinition {
+class ClientCsdlTypeDefinition extends CsdlTypeDefinition implements Serializable {
 
   private static final long serialVersionUID = -902407149079419602L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java
index 4e2a000..6458cae 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
@@ -30,7 +31,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlApply.ApplyDeserializer.class)
-class ClientCsdlApply extends CsdlApply {
+class ClientCsdlApply extends CsdlApply implements Serializable {
 
   private static final long serialVersionUID = 4358398303405059879L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java
index 7880fb8..8756d93 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
@@ -31,7 +32,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlCast.CastDeserializer.class)
-class ClientCsdlCast extends CsdlCast {
+class ClientCsdlCast extends CsdlCast implements Serializable {
 
   private static final long serialVersionUID = 3312415984116005313L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java
index e76dddd..677fa69 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlCollection;
@@ -29,7 +30,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlCollection.CollectionDeserializer.class)
-class ClientCsdlCollection extends CsdlCollection  {
+class ClientCsdlCollection extends CsdlCollection implements Serializable  {
 
   private static final long serialVersionUID = -724749123749715643L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java
index d332649..e4f85e2 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlDynamicExpression;
@@ -38,7 +39,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlDynamicExpression.DynamicExpressionDeserializer.class)
-public abstract class ClientCsdlDynamicExpression extends CsdlDynamicExpression {
+public abstract class ClientCsdlDynamicExpression extends CsdlDynamicExpression implements Serializable {
 
   private static final long serialVersionUID = 1093411847477874348L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java
index 31ec91a..411d6dd 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
@@ -31,7 +32,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlIsOf.IsOfDeserializer.class)
-class ClientCsdlIsOf extends CsdlIsOf{
+class ClientCsdlIsOf extends CsdlIsOf implements Serializable {
 
   private static final long serialVersionUID = -893355856129761174L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java
index fdef249..b07a57b 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
@@ -30,7 +31,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlLabeledElement.LabeledElementDeserializer.class)
-class ClientCsdlLabeledElement extends CsdlLabeledElement {
+class ClientCsdlLabeledElement extends CsdlLabeledElement implements Serializable {
 
   private static final long serialVersionUID = 4909387630253341824L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java
index d8ebb0c..0b0d979 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
@@ -30,7 +31,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlNull.NullDeserializer.class)
-class ClientCsdlNull extends CsdlNull {
+class ClientCsdlNull extends CsdlNull implements Serializable {
 
   private static final long serialVersionUID = -3148516847180393142L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java
index 078f66c..0d3fd45 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
@@ -30,7 +31,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlPropertyValue.PropertyValueDeserializer.class)
-class ClientCsdlPropertyValue extends CsdlPropertyValue {
+class ClientCsdlPropertyValue extends CsdlPropertyValue implements Serializable {
 
   private static final long serialVersionUID = -8437649215282645228L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java
index 10d2f50..a2a1b07 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
@@ -30,7 +31,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlRecord.RecordDeserializer.class)
-class ClientCsdlRecord extends CsdlRecord {
+class ClientCsdlRecord extends CsdlRecord implements Serializable {
 
   private static final long serialVersionUID = 4275271751615410709L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java
index 2a4ebc8..fa41141 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.client.core.edm.xml.annotation;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlUrlRef;
@@ -29,7 +30,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ClientCsdlUrlRef.UrlRefDeserializer.class)
-class ClientCsdlUrlRef extends CsdlUrlRef  {
+class ClientCsdlUrlRef extends CsdlUrlRef implements Serializable  {
 
   private static final long serialVersionUID = -7693224811739000440L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-api/pom.xml b/lib/commons-api/pom.xml
index dabf9c8..64ea2fa 100644
--- a/lib/commons-api/pom.xml
+++ b/lib/commons-api/pom.xml
@@ -36,11 +36,6 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-lang3</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/AbstractODataObject.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/AbstractODataObject.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/AbstractODataObject.java
index 15e50bf..a39ce56 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/AbstractODataObject.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/AbstractODataObject.java
@@ -81,4 +81,29 @@ public abstract class AbstractODataObject extends Annotatable {
       title = value;
     }
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    final AbstractODataObject other = (AbstractODataObject) o;
+    return getAnnotations().equals(other.getAnnotations())
+        && (baseURI == null ? other.baseURI == null : baseURI.equals(other.baseURI))
+        && (id == null ? other.id == null : id.equals(other.id))
+        && (title == null ? other.title == null : title.equals(other.title));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = getAnnotations().hashCode();
+    result = 31 * result + (baseURI == null ? 0 : baseURI.hashCode());
+    result = 31 * result + (id == null ? 0 : id.hashCode());
+    result = 31 * result + (title == null ? 0 : title.hashCode());
+    return result;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java
index e372aca..f42f10c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java
@@ -21,11 +21,6 @@ package org.apache.olingo.commons.api.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;
-
 /**
  * An element with instance annotations.
  */
@@ -41,29 +36,4 @@ public abstract class Annotatable {
   public List<Annotation> getAnnotations() {
     return annotations;
   }
-
-  /**
-   * Compare for equality.
-   *
-   * @param obj to compared with
-   * @return <code>true</code> if equal, otherwise <code>false</code>
-   */
-  @Override
-  public boolean equals(final Object obj) {
-    return EqualsBuilder.reflectionEquals(this, obj);
-  }
-
-  /**
-   * Create the hash code.
-   * @return hash code for this instance.
-   */
-  @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/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java
index 759666b..a3014c1 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java
@@ -40,4 +40,22 @@ public class Annotation extends Valuable {
   public void setTerm(final String term) {
     this.term = term;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    return super.equals(o)
+        && (term == null ? ((Annotation) o).term == null : term.equals(((Annotation) o).term));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + (term == null ? 0 : term.hashCode());
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return term == null ? "null" : term;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/ComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/ComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/ComplexValue.java
index c146645..0054777 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/ComplexValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/ComplexValue.java
@@ -36,4 +36,21 @@ public class ComplexValue extends Linked {
   public List<Property> getValue() {
     return value;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    return super.equals(o) && value.equals(((ComplexValue) o).value);
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + value.hashCode();
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return value.toString();
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Delta.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Delta.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Delta.java
index 1030082..72cef4c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Delta.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Delta.java
@@ -53,4 +53,21 @@ public class Delta extends EntityCollection {
   public List<DeltaLink> getDeletedLinks() {
     return deletedLinks;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    return super.equals(o)
+        && deletedEntities.equals(((Delta) o).deletedEntities)
+        && addedLinks.equals(((Delta) o).addedLinks)
+        && deletedLinks.equals(((Delta) o).deletedLinks);
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + deletedEntities.hashCode();
+    result = 31 * result + addedLinks.hashCode();
+    result = 31 * result + deletedLinks.hashCode();
+    return result;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/DeltaLink.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/DeltaLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/DeltaLink.java
index 052e71c..fe36c10 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/DeltaLink.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/DeltaLink.java
@@ -76,4 +76,29 @@ public class DeltaLink extends Annotatable {
   public void setTarget(final URI target) {
     this.target = target;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    final DeltaLink other = (DeltaLink) o;
+    return getAnnotations().equals(other.getAnnotations())
+        && (source == null ? other.source == null : source.equals(other.source))
+        && (relationship == null ? other.relationship == null : relationship.equals(other.relationship))
+        && (target == null ? other.target == null : target.equals(other.target));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = getAnnotations().hashCode();
+    result = 31 * result + (source == null ? 0 : source.hashCode());
+    result = 31 * result + (relationship == null ? 0 : relationship.hashCode());
+    result = 31 * result + (target == null ? 0 : target.hashCode());
+    return result;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
index f5be18c..9742daf 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
@@ -232,4 +232,44 @@ public class Entity extends Linked {
   public boolean isMediaEntity() {
     return mediaContentSource != null;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    return super.equals(o)
+        && (eTag == null ? ((Entity) o).eTag == null : eTag.equals(((Entity) o).eTag))
+        && (type == null ? ((Entity) o).type == null : type.equals(((Entity) o).type))
+        && (readLink == null ? ((Entity) o).readLink == null : readLink.equals(((Entity) o).readLink))
+        && (editLink == null ? ((Entity) o).editLink == null : editLink.equals(((Entity) o).editLink))
+        && mediaEditLinks.equals(((Entity) o).mediaEditLinks)
+        && operations.equals(((Entity) o).operations)
+        && properties.equals(((Entity) o).properties)
+        && (mediaContentSource == null ?
+            ((Entity) o).mediaContentSource == null :
+            mediaContentSource.equals(((Entity) o).mediaContentSource))
+        && (mediaContentType == null ?
+            ((Entity) o).mediaContentType == null :
+            mediaContentType.equals(((Entity) o).mediaContentType))
+        && (mediaETag == null ? ((Entity) o).mediaETag == null : mediaETag.equals(((Entity) o).mediaETag));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + (eTag == null ? 0 : eTag.hashCode());
+    result = 31 * result + (type == null ? 0 : type.hashCode());
+    result = 31 * result + (readLink == null ? 0 : readLink.hashCode());
+    result = 31 * result + (editLink == null ? 0 : editLink.hashCode());
+    result = 31 * result + mediaEditLinks.hashCode();
+    result = 31 * result + operations.hashCode();
+    result = 31 * result + properties.hashCode();
+    result = 31 * result + (mediaContentSource == null ? 0 : mediaContentSource.hashCode());
+    result = 31 * result + (mediaContentType == null ? 0 : mediaContentType.hashCode());
+    result = 31 * result + (mediaETag == null ? 0 : mediaETag.hashCode());
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return properties.toString();
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
index adb43dc..743d437 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
@@ -27,12 +27,9 @@ import java.util.List;
  */
 public class EntityCollection extends AbstractODataObject {
 
-  private Integer count;
-
   private final List<Entity> entities = new ArrayList<Entity>();
-
+  private Integer count;
   private URI next;
-
   private URI deltaLink;
 
   /**
@@ -97,4 +94,26 @@ public class EntityCollection extends AbstractODataObject {
   public void setDeltaLink(final URI deltaLink) {
     this.deltaLink = deltaLink;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (!super.equals(o)) {
+      return false;
+    }
+    final EntityCollection other = (EntityCollection) o;
+    return entities.equals(other.entities)
+        && (count == null ? other.count == null : count.equals(other.count))
+        && (next == null ? other.next == null : next.equals(other.next))
+        && (deltaLink == null ? other.deltaLink == null : deltaLink.equals(other.deltaLink));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + entities.hashCode();
+    result = 31 * result + (count == null ? 0 : count.hashCode());
+    result = 31 * result + (next == null ? 0 : next.hashCode());
+    result = 31 * result + (deltaLink == null ? 0 : deltaLink.hashCode());
+    return result;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
index cde7dc5..0bf8237 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
@@ -193,4 +193,41 @@ public class Link extends Annotatable {
   public void setBindingLinks(final List<String> bindingLinks) {
     this.bindingLinks = bindingLinks;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    final Link other = (Link) o;
+    return getAnnotations().equals(other.getAnnotations())
+        && (title == null ? other.title == null : title.equals(other.title))
+        && (rel == null ? other.rel == null : rel.equals(other.rel))
+        && (href == null ? other.href == null : href.equals(other.href))
+        && (type == null ? other.type == null : type.equals(other.type))
+        && (mediaETag == null ? other.mediaETag == null : mediaETag.equals(other.mediaETag))
+        && (entity == null ? other.entity == null : entity.equals(other.entity))
+        && (entitySet == null ? other.entitySet == null : entitySet.equals(other.entitySet))
+        && (bindingLink == null ? other.bindingLink == null : bindingLink.equals(other.bindingLink))
+        && bindingLinks.equals(other.bindingLinks);
+  }
+
+  @Override
+  public int hashCode() {
+    int result = getAnnotations().hashCode();
+    result = 31 * result + (title == null ? 0 : title.hashCode());
+    result = 31 * result + (rel == null ? 0 : rel.hashCode());
+    result = 31 * result + (href == null ? 0 : href.hashCode());
+    result = 31 * result + (type == null ? 0 : type.hashCode());
+    result = 31 * result + (mediaETag == null ? 0 : mediaETag.hashCode());
+    result = 31 * result + (entity == null ? 0 : entity.hashCode());
+    result = 31 * result + (entitySet == null ? 0 : entitySet.hashCode());
+    result = 31 * result + (bindingLink == null ? 0 : bindingLink.hashCode());
+    result = 31 * result + bindingLinks.hashCode();
+    return result;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Linked.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Linked.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Linked.java
index ccc081b..d3c736b 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Linked.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Linked.java
@@ -97,4 +97,21 @@ public abstract class Linked extends AbstractODataObject {
   public List<Link> getNavigationBindings() {
     return bindingLinks;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    return super.equals(o)
+        && associationLinks.equals(((Linked) o).associationLinks)
+        && navigationLinks.equals(((Linked) o).navigationLinks)
+        && bindingLinks.equals(((Linked) o).bindingLinks);
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + associationLinks.hashCode();
+    result = 31 * result + navigationLinks.hashCode();
+    result = 31 * result + bindingLinks.hashCode();
+    return result;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Parameter.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Parameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Parameter.java
index 2937f25..0b2ed33 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Parameter.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Parameter.java
@@ -56,4 +56,22 @@ public class Parameter extends Valuable {
   public Entity asEntity() {
     return isEntity() && !isCollection() ? (Entity) getValue() : null;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    return super.equals(o)
+        && (name == null ? ((Parameter) o).name == null : name.equals(((Parameter) o).name));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + (name == null ? 0 : name.hashCode());
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return (name == null ? "null" : name) + '=' + (getValue() == null ? "null" : getValue());
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
index 153bdd9..2117241 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
@@ -79,4 +79,22 @@ public class Property extends Valuable {
   public boolean isNull() {
     return getValue() == null || "Edm.Null".equals(getType());
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    return super.equals(o)
+        && (name == null ? ((Property) o).name == null : name.equals(((Property) o).name));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = super.hashCode();
+    result = 31 * result + (name == null ? 0 : name.hashCode());
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return (name == null ? "null" : name) + '=' + (getValue() == null ? "null" : getValue());
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/36e6dc92/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
index a2cb509..ccc95cd 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
@@ -171,4 +171,34 @@ public abstract class Valuable extends Annotatable {
   public ValueType getValueType() {
     return valueType;
   }
+
+  @Override
+  public boolean equals(final Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    final Valuable other = (Valuable) o;
+    return getAnnotations().equals(other.getAnnotations())
+        && (valueType == null ? other.valueType == null : valueType.equals(other.valueType))
+        && (value == null ? other.value == null : value.equals(other.value))
+        && (type == null ? other.type == null : type.equals(other.type));
+  }
+
+  @Override
+  public int hashCode() {
+    int result = getAnnotations().hashCode();
+    result = 31 * result + (valueType == null ? 0 : valueType.hashCode());
+    result = 31 * result + (value == null ? 0 : value.hashCode());
+    result = 31 * result + (type == null ? 0 : type.hashCode());
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return value == null ? "null" : value.toString();
+  }
 }


[12/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] ExpressionParser parses path expressions

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
index 1b2d508..af45e80 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
@@ -55,7 +55,7 @@ public class UriTokenizerTest {
 
   @Test
   public void sequence() {
-    final UriTokenizer tokenizer = new UriTokenizer("(A=1,B=2);.*/+-");
+    UriTokenizer tokenizer = new UriTokenizer("(A=1,B=2);.*/+-");
     assertTrue(tokenizer.next(TokenKind.OPEN));
     assertFalse(tokenizer.next(TokenKind.OPEN));
     assertTrue(tokenizer.next(TokenKind.ODataIdentifier));
@@ -78,6 +78,22 @@ public class UriTokenizerTest {
     assertTrue(tokenizer.next(TokenKind.PLUS));
     assertTrue(tokenizer.next(TokenKind.MINUS));
     assertTrue(tokenizer.next(TokenKind.EOF));
+
+    tokenizer = new UriTokenizer("any(a:true) or all(b:false)");
+    assertTrue(tokenizer.next(TokenKind.ANY));
+    assertTrue(tokenizer.next(TokenKind.OPEN));
+    assertTrue(tokenizer.next(TokenKind.ODataIdentifier));
+    assertTrue(tokenizer.next(TokenKind.COLON));
+    assertTrue(tokenizer.next(TokenKind.BooleanValue));
+    assertTrue(tokenizer.next(TokenKind.CLOSE));
+    assertTrue(tokenizer.next(TokenKind.OrOperator));
+    assertTrue(tokenizer.next(TokenKind.ALL));
+    assertTrue(tokenizer.next(TokenKind.OPEN));
+    assertTrue(tokenizer.next(TokenKind.ODataIdentifier));
+    assertTrue(tokenizer.next(TokenKind.COLON));
+    assertTrue(tokenizer.next(TokenKind.BooleanValue));
+    assertTrue(tokenizer.next(TokenKind.CLOSE));
+    assertTrue(tokenizer.next(TokenKind.EOF));
   }
 
   @Test
@@ -455,6 +471,19 @@ public class UriTokenizerTest {
     }
   }
 
+  @Test
+  public void suffixes() {
+    UriTokenizer tokenizer = new UriTokenizer("p1 asc,p2 desc");
+    assertTrue(tokenizer.next(TokenKind.ODataIdentifier));
+    assertTrue(tokenizer.next(TokenKind.AscSuffix));
+    assertTrue(tokenizer.next(TokenKind.COMMA));
+    assertTrue(tokenizer.next(TokenKind.ODataIdentifier));
+    assertTrue(tokenizer.next(TokenKind.DescSuffix));
+    assertTrue(tokenizer.next(TokenKind.EOF));
+
+    wrongToken(TokenKind.DescSuffix, " desc", 'D');
+  }
+
   private void wrongToken(final TokenKind kind, final String value, final char disturbCharacter) {
     assertFalse(new UriTokenizer(disturbCharacter + value).next(kind));
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
index a945d11..72f3eb9 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
@@ -57,7 +57,7 @@ public class UriResourceImplTest {
       new EdmTechProvider(), Collections.<EdmxReference> emptyList()).getEdm();
 
   @Test
-  public void testUriParameterImpl() {
+  public void uriParameterImpl() {
     UriParameterImpl impl = new UriParameterImpl();
     Expression expression = new LiteralImpl("Expression", null);
 
@@ -73,21 +73,20 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceActionImpl() {
-    UriResourceActionImpl impl = new UriResourceActionImpl();
+  public void uriResourceActionImpl() {
+    UriResourceActionImpl impl = new UriResourceActionImpl((EdmAction) null);
     assertEquals(UriResourceKind.action, impl.getKind());
     assertEquals("", impl.toString());
 
     // action
     EdmAction action = edm.getUnboundAction(ActionProvider.nameUARTETTwoKeyTwoPrimParam);
-    impl.setAction(action);
+    impl = new UriResourceActionImpl(action);
     assertEquals(action, impl.getAction());
     assertEquals(ActionProvider.nameUARTETTwoKeyTwoPrimParam.getName(), impl.toString());
 
     // action import
-    impl = new UriResourceActionImpl();
     EdmActionImport actionImport = edm.getEntityContainer().getActionImport("AIRTCTTwoPrimParam");
-    impl.setActionImport(actionImport);
+    impl = new UriResourceActionImpl(actionImport);
     assertEquals(actionImport, impl.getActionImport());
     assertEquals(actionImport.getUnboundAction(), impl.getAction());
     assertFalse(impl.isCollection());
@@ -95,20 +94,16 @@ public class UriResourceImplTest {
     assertEquals(actionImport.getUnboundAction().getReturnType().getType(), impl.getType());
 
     actionImport = edm.getEntityContainer().getActionImport("AIRT");
-    impl.setActionImport(actionImport);
+    impl = new UriResourceActionImpl(actionImport);
     assertFalse(impl.isCollection());
     assertNull(impl.getType());
   }
 
   @Test
-  public void testUriResourceLambdaAllImpl() {
-    UriResourceLambdaAllImpl impl = new UriResourceLambdaAllImpl();
-    assertEquals(UriResourceKind.lambdaAll, impl.getKind());
-
+  public void uriResourceLambdaAllImpl() {
     Expression expression = new LiteralImpl("Expression", null);
-    impl.setExpression(expression);
-    impl.setLamdaVariable("A");
-
+    UriResourceLambdaAllImpl impl = new UriResourceLambdaAllImpl("A", expression);
+    assertEquals(UriResourceKind.lambdaAll, impl.getKind());
     assertFalse(impl.isCollection());
     assertEquals(expression, impl.getExpression());
     assertEquals("A", impl.getLambdaVariable());
@@ -117,14 +112,10 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceLambdaAnyImpl() {
-    UriResourceLambdaAnyImpl impl = new UriResourceLambdaAnyImpl();
-    assertEquals(UriResourceKind.lambdaAny, impl.getKind());
-
+  public void uriResourceLambdaAnyImpl() {
     Expression expression = new LiteralImpl("Expression", null);
-    impl.setExpression(expression);
-    impl.setLamdaVariable("A");
-
+    UriResourceLambdaAnyImpl impl = new UriResourceLambdaAnyImpl("A", expression);
+    assertEquals(UriResourceKind.lambdaAny, impl.getKind());
     assertFalse(impl.isCollection());
     assertEquals(expression, impl.getExpression());
     assertEquals("A", impl.getLambdaVariable());
@@ -133,14 +124,11 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceComplexPropertyImpl() {
-    UriResourceComplexPropertyImpl impl = new UriResourceComplexPropertyImpl();
-    assertEquals(UriResourceKind.complexProperty, impl.getKind());
-
+  public void uriResourceComplexPropertyImpl() {
     EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
     EdmProperty property = (EdmProperty) entityType.getProperty("PropertyCompNav");
-    impl.setProperty(property);
-
+    UriResourceComplexPropertyImpl impl = new UriResourceComplexPropertyImpl(property);
+    assertEquals(UriResourceKind.complexProperty, impl.getKind());
     assertEquals(property, impl.getProperty());
     assertEquals(property.getName(), impl.toString());
     assertFalse(impl.isCollection());
@@ -158,14 +146,11 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourcePrimitivePropertyImpl() {
-    UriResourcePrimitivePropertyImpl impl = new UriResourcePrimitivePropertyImpl();
-    assertEquals(UriResourceKind.primitiveProperty, impl.getKind());
-
+  public void uriResourcePrimitivePropertyImpl() {
     EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
     EdmProperty property = (EdmProperty) entityType.getProperty("PropertyInt16");
-    impl.setProperty(property);
-
+    UriResourcePrimitivePropertyImpl impl = new UriResourcePrimitivePropertyImpl(property);
+    assertEquals(UriResourceKind.primitiveProperty, impl.getKind());
     assertEquals(property, impl.getProperty());
     assertEquals(property.getName(), impl.toString());
     assertFalse(impl.isCollection());
@@ -173,20 +158,17 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceCountImpl() {
+  public void uriResourceCountImpl() {
     UriResourceCountImpl impl = new UriResourceCountImpl();
     assertEquals(UriResourceKind.count, impl.getKind());
     assertEquals("$count", impl.toString());
   }
 
   @Test
-  public void testUriResourceEntitySetImpl() {
-    UriResourceEntitySetImpl impl = new UriResourceEntitySetImpl();
-    assertEquals(UriResourceKind.entitySet, impl.getKind());
-
+  public void uriResourceEntitySetImpl() {
     EdmEntitySet entitySet = edm.getEntityContainer().getEntitySet("ESAllPrim");
-    impl.setEntitSet(entitySet);
-
+    UriResourceEntitySetImpl impl = new UriResourceEntitySetImpl(entitySet);
+    assertEquals(UriResourceKind.entitySet, impl.getKind());
     assertEquals("ESAllPrim", impl.toString());
     assertEquals(entitySet, impl.getEntitySet());
 
@@ -201,8 +183,8 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceFunctionImpl() {
-    UriResourceFunctionImpl impl = new UriResourceFunctionImpl();
+  public void uriResourceFunctionImpl() {
+    UriResourceFunctionImpl impl = new UriResourceFunctionImpl(null, null, null);
     assertEquals(UriResourceKind.function, impl.getKind());
     assertEquals("", impl.toString());
 
@@ -210,39 +192,38 @@ public class UriResourceImplTest {
     EdmFunction function = edm.getEntityContainer().getFunctionImport("FINRTInt16")
         .getUnboundFunction(Collections.<String> emptyList());
     assertNotNull(function);
-    impl.setFunction(function);
+    impl = new UriResourceFunctionImpl(null, function, null);
 
     assertEquals(function, impl.getFunction());
     assertEquals("UFNRTInt16", impl.toString());
     assertEquals(function.getReturnType().getType(), impl.getType());
-    assertFalse(impl.isParameterListFilled());
+    assertTrue(impl.getParameters().isEmpty());
 
     // function import
-    impl = new UriResourceFunctionImpl();
     EdmFunctionImport functionImport = edm.getEntityContainer().getFunctionImport("FINRTInt16");
-    impl.setFunctionImport(functionImport, Collections.<UriParameter> emptyList());
+    impl = new UriResourceFunctionImpl(functionImport, functionImport.getUnboundFunctions().get(0),
+        Collections.<UriParameter> emptyList());
     assertEquals(functionImport, impl.getFunctionImport());
     assertEquals("FINRTInt16", impl.toString());
 
     // function collection
-    impl = new UriResourceFunctionImpl();
     functionImport = edm.getEntityContainer().getFunctionImport("FICRTCollESTwoKeyNavParam");
-    assertNotNull(function);
     UriParameter parameter = new UriParameterImpl().setName("ParameterInt16");
-    impl.setFunctionImport(functionImport, Collections.singletonList(parameter));
+    impl = new UriResourceFunctionImpl(functionImport,
+        functionImport.getUnboundFunction(Collections.singletonList("ParameterInt16")),
+        Collections.singletonList(parameter));
     assertEquals("FICRTCollESTwoKeyNavParam", impl.toString());
 
-    impl.setFunction(functionImport.getUnboundFunction(Collections.singletonList("ParameterInt16")));
     assertTrue(impl.isCollection());
     impl.setKeyPredicates(Collections.<UriParameter> emptyList());
     assertFalse(impl.isCollection());
 
+    assertFalse(impl.getParameters().isEmpty());
     assertEquals(parameter, impl.getParameters().get(0));
-    assertTrue(impl.isParameterListFilled());
   }
 
   @Test
-  public void testUriResourceImplKeyPred() {
+  public void uriResourceImplKeyPred() {
     final EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
     class Mock extends UriResourceWithKeysImpl {
 
@@ -306,7 +287,7 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceImplTyped() {
+  public void uriResourceImplTyped() {
     final EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
     class Mock extends UriResourceTypedImpl {
 
@@ -344,18 +325,15 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceItImpl() {
-    UriResourceItImpl impl = new UriResourceItImpl();
-    assertEquals(UriResourceKind.it, impl.getKind());
-
+  public void uriResourceItImpl() {
     EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+    UriResourceItImpl impl = new UriResourceItImpl(entityType, false);
+    assertEquals(UriResourceKind.it, impl.getKind());
     assertEquals("$it", impl.toString());
-
-    impl.setType(entityType);
     assertEquals(entityType, impl.getType());
-
     assertFalse(impl.isCollection());
-    impl.setCollection(true);
+
+    impl = new UriResourceItImpl(entityType, true);
     assertTrue(impl.isCollection());
     impl.setKeyPredicates(Collections.singletonList(
         (UriParameter) new UriParameterImpl().setName("ParameterInt16")));
@@ -363,15 +341,13 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceNavigationPropertyImpl() {
-    UriResourceNavigationPropertyImpl impl = new UriResourceNavigationPropertyImpl();
-    assertEquals(UriResourceKind.navigationProperty, impl.getKind());
-
+  public void uriResourceNavigationPropertyImpl() {
     EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
     EdmNavigationProperty property = (EdmNavigationProperty) entityType.getProperty("NavPropertyETKeyNavMany");
     assertNotNull(property);
 
-    impl.setNavigationProperty(property);
+    UriResourceNavigationPropertyImpl impl = new UriResourceNavigationPropertyImpl(property);
+    assertEquals(UriResourceKind.navigationProperty, impl.getKind());
     assertEquals(property, impl.getProperty());
 
     assertEquals("NavPropertyETKeyNavMany", impl.toString());
@@ -384,25 +360,22 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceRefImpl() {
+  public void uriResourceRefImpl() {
     UriResourceRefImpl impl = new UriResourceRefImpl();
     assertEquals(UriResourceKind.ref, impl.getKind());
     assertEquals("$ref", impl.toString());
   }
 
   @Test
-  public void testUriResourceRootImpl() {
-    UriResourceRootImpl impl = new UriResourceRootImpl();
-    assertEquals(UriResourceKind.root, impl.getKind());
-
+  public void uriResourceRootImpl() {
     EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+    UriResourceRootImpl impl = new UriResourceRootImpl(entityType, false);
+    assertEquals(UriResourceKind.root, impl.getKind());
     assertEquals("$root", impl.toString());
-
-    impl.setType(entityType);
     assertEquals(entityType, impl.getType());
-
     assertFalse(impl.isCollection());
-    impl.setCollection(true);
+
+    impl = new UriResourceRootImpl(entityType, true);
     assertTrue(impl.isCollection());
     impl.setKeyPredicates(Collections.singletonList(
         (UriParameter) new UriParameterImpl().setName("ParameterInt16")));
@@ -410,14 +383,11 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceSingletonImpl() {
-    UriResourceSingletonImpl impl = new UriResourceSingletonImpl();
-    assertEquals(UriResourceKind.singleton, impl.getKind());
-
+  public void uriResourceSingletonImpl() {
     EdmSingleton singleton = edm.getEntityContainer().getSingleton("SINav");
     EdmEntityType entityTypeBaseColl = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
-    impl.setSingleton(singleton);
-
+    UriResourceSingletonImpl impl = new UriResourceSingletonImpl(singleton);
+    assertEquals(UriResourceKind.singleton, impl.getKind());
     assertEquals("SINav", impl.toString());
     assertEquals(singleton, impl.getSingleton());
 
@@ -433,41 +403,33 @@ public class UriResourceImplTest {
   }
 
   @Test
-  public void testUriResourceValueImpl() {
+  public void uriResourceValueImpl() {
     UriResourceValueImpl impl = new UriResourceValueImpl();
     assertEquals(UriResourceKind.value, impl.getKind());
     assertEquals("$value", impl.toString());
   }
 
   @Test
-  public void testUriResourceLambdaVarImpl() {
-    UriResourceLambdaVarImpl impl = new UriResourceLambdaVarImpl();
-    assertEquals(UriResourceKind.lambdaVariable, impl.getKind());
-
+  public void uriResourceLambdaVarImpl() {
     EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
-    impl.setType(entityType);
-    impl.setVariableText("A");
-
+    UriResourceLambdaVarImpl impl = new UriResourceLambdaVarImpl("A", entityType);
+    assertEquals(UriResourceKind.lambdaVariable, impl.getKind());
     assertEquals("A", impl.toString());
     assertEquals(entityType, impl.getType());
     assertEquals("A", impl.getVariableName());
     assertFalse(impl.isCollection());
-    impl.setCollection(true);
-    assertTrue(impl.isCollection());
   }
 
   @Test
-  public void testUriResourceStartingTypeFilterImpl() {
-    UriResourceStartingTypeFilterImpl impl = new UriResourceStartingTypeFilterImpl();
-
+  public void uriResourceStartingTypeFilterImpl() {
     EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
 
-    impl.setType(entityType);
+    UriResourceStartingTypeFilterImpl impl = new UriResourceStartingTypeFilterImpl(entityType, false);
     assertEquals("olingo.odata.test1.ETTwoKeyNav", impl.toString());
     assertEquals(entityType, impl.getType());
-
     assertFalse(impl.isCollection());
-    impl.setCollection(true);
+
+    impl = new UriResourceStartingTypeFilterImpl(entityType, true);
     assertTrue(impl.isCollection());
     impl.setKeyPredicates(Collections.singletonList(
         (UriParameter) new UriParameterImpl().setName("ParameterInt16")));


[44/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] small URI parser improvements

Posted by mi...@apache.org.
[OLINGO-834] small URI parser improvements

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 8537f3a5127519555bf5e5fb8b1fb7b6e2ad3c9c
Parents: 27e17ab
Author: Klaus Straubinger <kl...@sap.com>
Authored: Wed Jan 20 15:22:42 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Wed Jan 20 15:30:39 2016 +0100

----------------------------------------------------------------------
 .../core/uri/parser/ExpressionParser.java       |  13 +-
 .../olingo/server/core/uri/parser/Parser.java   |  32 ++---
 .../server/core/uri/parser/ParserHelper.java    |  14 +-
 .../server/core/uri/parser/UriTokenizer.java    | 124 +++++++++++++++---
 .../core/uri/parser/search/SearchTokenizer.java |  49 +++----
 .../core/uri/parser/ExpressionParserTest.java   | 129 ++++++-------------
 .../core/uri/parser/UriTokenizerTest.java       |  15 +++
 .../core/uri/parser/TestFullResourcePath.java   |   5 +-
 .../core/uri/parser/TestUriParserImpl.java      |  46 +++----
 .../core/uri/validator/UriValidatorTest.java    |   4 +-
 10 files changed, 230 insertions(+), 201 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
index 8b28f6a..1cf279e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
@@ -343,7 +343,7 @@ public class ExpressionParser {
     }
 
     if (tokenizer.next(TokenKind.jsonArrayOrObject)) {
-      // TODO: Can the type be determined?
+      // There is no obvious way how the type could be determined.
       return new LiteralImpl(tokenizer.getText(), null);
     }
 
@@ -417,9 +417,9 @@ public class ExpressionParser {
         typeKind = EdmPrimitiveTypeKind.Int64;
       }
     } catch (final NumberFormatException e) {
-      // This should never happen because the tokenizer has figured out that the literal is an integer.
-      throw new UriParserSyntaxException("'" + intValueAsString + "' is not an integer.", e,
-          UriParserSyntaxException.MessageKeys.SYNTAX);
+      // The number cannot be formatted wrongly because the tokenizer already checked the format
+      // but it is too large for Long and therefore too large for Edm.Int64.
+      typeKind = EdmPrimitiveTypeKind.Decimal;
     }
     return typeKind;
   }
@@ -686,7 +686,7 @@ public class ExpressionParser {
       }
     } else {
       // Must be a property.
-      parseMemberExpression(TokenKind.ODataIdentifier, uriInfo, null, true); // TODO: Find last resource.
+      parseMemberExpression(TokenKind.ODataIdentifier, uriInfo, null, true);
     }
   }
 
@@ -996,9 +996,10 @@ public class ExpressionParser {
     ParserHelper.requireNext(tokenizer, TokenKind.COLON);
     lambdaVariables.addFirst(new UriResourceLambdaVarImpl(lambbdaVariable,
         lastResource == null ? referringType : lastResource.getType()));
+    // The ABNF suggests that the "lambaPredicateExpr" must contain at least one lambdaVariable,
+    // so arguably this could be checked in expression parsing or later in validation.
     final Expression lambdaPredicateExpr = parseExpression();
     lambdaVariables.removeFirst();
-    // TODO: The ABNF suggests that the "lambaPredicateExpr" must contain at least one lambdaVariable.
     ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
     if (lastTokenKind == TokenKind.ALL) {
       return new UriResourceLambdaAllImpl(lambbdaVariable, lambdaPredicateExpr);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
index 34944c8..586cb10 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
@@ -18,13 +18,10 @@
  */
 package org.apache.olingo.server.core.uri.parser;
 
-import java.util.ArrayDeque;
 import java.util.Collections;
-import java.util.Deque;
 import java.util.List;
 
 import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntitySet;
 import org.apache.olingo.commons.api.edm.EdmStructuredType;
 import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.api.ex.ODataRuntimeException;
@@ -77,7 +74,7 @@ public class Parser {
       throws UriParserException, UriValidationException {
 
     UriInfoImpl contextUriInfo = new UriInfoImpl();
-    Deque<EdmType> contextTypes = new ArrayDeque<EdmType>();
+    EdmType contextType = null;
     boolean contextIsCollection = false;
 
     List<String> pathSegmentsDecoded = UriDecoder.splitAndDecodePath(path);
@@ -107,10 +104,6 @@ public class Parser {
     } else if (firstSegment.equals("$all")) {
       ensureLastSegment(firstSegment, 1, numberOfSegments);
       contextUriInfo.setKind(UriInfoKind.all);
-      // This loads nearly the whole schema, but sooner or later '$all' needs all entity sets anyway.
-      for (final EdmEntitySet entitySet : edm.getEntityContainer().getEntitySets()) {
-        contextTypes.push(entitySet.getEntityType());
-      }
       contextIsCollection = true;
 
     } else if (firstSegment.equals("$entity")) {
@@ -118,11 +111,9 @@ public class Parser {
         final String typeCastSegment = pathSegmentsDecoded.get(1);
         ensureLastSegment(typeCastSegment, 2, numberOfSegments);
         contextUriInfo = new ResourcePathParser(edm).parseDollarEntityTypeCast(typeCastSegment);
-        contextTypes.push(contextUriInfo.getEntityTypeCast());
+        contextType = contextUriInfo.getEntityTypeCast();
       } else {
         contextUriInfo.setKind(UriInfoKind.entityId);
-        // The type of the entity is not known until the $id query option has been parsed.
-        // TODO: Set the type (needed for the evaluation of system query options).
       }
       contextIsCollection = false;
 
@@ -166,10 +157,7 @@ public class Parser {
 
       if (lastSegment instanceof UriResourcePartTyped) {
         final UriResourcePartTyped typed = (UriResourcePartTyped) lastSegment;
-        final EdmType type = ParserHelper.getTypeInformation(typed);
-        if (type != null) { // could be null for, e.g., actions without return type
-          contextTypes.push(type);
-        }
+        contextType = ParserHelper.getTypeInformation(typed);
         contextIsCollection = typed.isCollection();
       }
     }
@@ -186,7 +174,7 @@ public class Parser {
           UriTokenizer filterTokenizer = new UriTokenizer(optionValue);
           // The referring type could be a primitive type or a structured type.
           systemOption = new FilterParser(edm, odata).parse(filterTokenizer,
-              contextTypes.peek(),
+              contextType,
               contextUriInfo.getEntitySetNames());
           checkOptionEOF(filterTokenizer, optionName, optionValue);
 
@@ -205,12 +193,12 @@ public class Parser {
           systemOption = formatOption;
 
         } else if (optionName.equals(SystemQueryOptionKind.EXPAND.toString())) {
-          if (contextTypes.peek() instanceof EdmStructuredType
+          if (contextType instanceof EdmStructuredType
               || !contextUriInfo.getEntitySetNames().isEmpty()
-              || contextUriInfo.getKind() == UriInfoKind.entityId) { // TODO: Remove once the type has been set above.
+              || contextUriInfo.getKind() == UriInfoKind.all) {
             UriTokenizer expandTokenizer = new UriTokenizer(optionValue);
             systemOption = new ExpandParser(edm, odata).parse(expandTokenizer,
-                contextTypes.peek() instanceof EdmStructuredType ? (EdmStructuredType) contextTypes.peek() : null);
+                contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null);
             checkOptionEOF(expandTokenizer, optionName, optionValue);
           } else {
             throw new UriValidationException("Expand is only allowed on structured types!",
@@ -235,7 +223,7 @@ public class Parser {
         } else if (optionName.equals(SystemQueryOptionKind.ORDERBY.toString())) {
           UriTokenizer orderByTokenizer = new UriTokenizer(optionValue);
           systemOption = new OrderByParser(edm, odata).parse(orderByTokenizer,
-              contextTypes.peek() instanceof EdmStructuredType ? (EdmStructuredType) contextTypes.peek() : null,
+              contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null,
               contextUriInfo.getEntitySetNames());
           checkOptionEOF(orderByTokenizer, optionName, optionValue);
 
@@ -245,7 +233,7 @@ public class Parser {
         } else if (optionName.equals(SystemQueryOptionKind.SELECT.toString())) {
           UriTokenizer selectTokenizer = new UriTokenizer(optionValue);
           systemOption = new SelectParser(edm).parse(selectTokenizer,
-              contextTypes.peek() instanceof EdmStructuredType ? (EdmStructuredType) contextTypes.peek() : null,
+              contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null,
               contextIsCollection);
           checkOptionEOF(selectTokenizer, optionName, optionValue);
 
@@ -297,7 +285,7 @@ public class Parser {
 
       } else if (optionName.startsWith(AT)) {
         if (contextUriInfo.getAlias(optionName) == null) {
-          // TODO: Create a proper alias-value parser that can parse also common expressions.
+          // TODO: Aliases can only be parsed in the context of their usage.
           Expression expression = null;
           UriTokenizer aliasTokenizer = new UriTokenizer(optionValue);
           if (aliasTokenizer.next(TokenKind.jsonArrayOrObject)) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
index 0ac888f..b0c2972 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
@@ -58,7 +58,7 @@ public class ParserHelper {
     Map<TokenKind, EdmPrimitiveTypeKind> temp = new HashMap<TokenKind, EdmPrimitiveTypeKind>();
     temp.put(TokenKind.BooleanValue, EdmPrimitiveTypeKind.Boolean);
     temp.put(TokenKind.StringValue, EdmPrimitiveTypeKind.String);
-    // TODO: Check if int64 is correct here or if it has to be decimal or single or double instead.
+    // Very large integer values are of type Edm.Decimal but this is handled elsewhere.
     temp.put(TokenKind.IntegerValue, EdmPrimitiveTypeKind.Int64);
     temp.put(TokenKind.GuidValue, EdmPrimitiveTypeKind.Guid);
     temp.put(TokenKind.DateValue, EdmPrimitiveTypeKind.Date);
@@ -81,9 +81,8 @@ public class ParserHelper {
     temp.put(TokenKind.GeometryMultiLineString, EdmPrimitiveTypeKind.GeometryMultiLineString);
     temp.put(TokenKind.GeographyMultiPolygon, EdmPrimitiveTypeKind.GeographyMultiPolygon);
     temp.put(TokenKind.GeometryMultiPolygon, EdmPrimitiveTypeKind.GeometryMultiPolygon);
-    // TODO: Geo collections
-//    temp.put(TokenKind.GeographyCollection, EdmPrimitiveTypeKind.GeographyCollection);
-//    temp.put(TokenKind.GeometryCollection, EdmPrimitiveTypeKind.GeometryCollection);
+    temp.put(TokenKind.GeographyCollection, EdmPrimitiveTypeKind.GeographyCollection);
+    temp.put(TokenKind.GeometryCollection, EdmPrimitiveTypeKind.GeometryCollection);
 
     tokenToPrimitiveType = Collections.unmodifiableMap(temp);
   }
@@ -141,10 +140,9 @@ public class ParserHelper {
         TokenKind.GeographyMultiLineString,
         TokenKind.GeometryMultiLineString,
         TokenKind.GeographyMultiPolygon,
-        TokenKind.GeometryMultiPolygon);
-        // TODO: Geo collections
-//        TokenKind.GeographyCollection,
-//        TokenKind.GeometryCollection);
+        TokenKind.GeometryMultiPolygon,
+        TokenKind.GeographyCollection,
+        TokenKind.GeometryCollection);
   }
 
   protected static List<UriParameter> parseFunctionParameters(UriTokenizer tokenizer,

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
index 5a48cc1..0504473 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
@@ -96,6 +96,8 @@ public class UriTokenizer {
     GeometryMultiLineString,
     GeographyMultiPolygon,
     GeometryMultiPolygon,
+    GeographyCollection,
+    GeometryCollection,
 
     jsonArrayOrObject,
 
@@ -372,6 +374,12 @@ public class UriTokenizer {
     case GeometryMultiPolygon:
       found = nextGeoMultiPolygon(false);
       break;
+    case GeographyCollection:
+      found = nextGeoCollection(true);
+      break;
+    case GeometryCollection:
+      found = nextGeoCollection(false);
+      break;
 
     // Complex or Collection Value
     case jsonArrayOrObject:
@@ -1057,10 +1065,13 @@ public class UriTokenizer {
     }
   }
 
+  private boolean nextPoint() {
+    return nextConstantIgnoreCase("Point") && nextPointData();
+  }
+
   private boolean nextGeoPoint(final boolean isGeography) {
     return nextGeoPrefix(isGeography) && nextCharacter('\'')
-        && nextSrid() && nextCharacter(';')
-        && nextConstantIgnoreCase("Point") && nextPointData()
+        && nextSrid() && nextCharacter(';') && nextPoint()
         && nextCharacter('\'');
   }
 
@@ -1074,7 +1085,10 @@ public class UriTokenizer {
     final int lastGoodIndex = index;
     if (nextCharacter('(') && nextPosition()) {
       int count = 1;
+      final String firstPosition = isRing ? parseString.substring(lastGoodIndex + 1, index) : null;
+      int positionStart = -1;
       while (nextCharacter(',')) {
+        positionStart = index;
         if (nextPosition()) {
           count++;
         } else {
@@ -1082,11 +1096,17 @@ public class UriTokenizer {
           return false;
         }
       }
-      // TODO: Check that the first and last ring positions are identical.
       if (count < (isRing ? 4 : 2)) {
         index = lastGoodIndex;
         return false;
       }
+      if (isRing) {
+        final String lastPosition = parseString.substring(positionStart, index);
+        if (!lastPosition.equals(firstPosition)) {
+          index = lastGoodIndex;
+          return false;
+        }
+      }
       if (!nextCharacter(')')) {
         index = lastGoodIndex;
         return false;
@@ -1098,10 +1118,13 @@ public class UriTokenizer {
     }
   }
 
+  private boolean nextLineString() {
+    return nextConstantIgnoreCase("LineString") && nextLineStringData(false);
+  }
+
   private boolean nextGeoLineString(final boolean isGeography) {
     return nextGeoPrefix(isGeography) && nextCharacter('\'')
-        && nextSrid() && nextCharacter(';')
-        && nextConstantIgnoreCase("LineString") && nextLineStringData(false)
+        && nextSrid() && nextCharacter(';') && nextLineString() 
         && nextCharacter('\'');
   }
 
@@ -1130,66 +1153,125 @@ public class UriTokenizer {
     }
   }
 
+  private boolean nextPolygon() {
+    return nextConstantIgnoreCase("Polygon") && nextPolygonData();
+  }
+
   private boolean nextGeoPolygon(final boolean isGeography) {
     return nextGeoPrefix(isGeography) && nextCharacter('\'')
-        && nextSrid() && nextCharacter(';')
-        && nextConstantIgnoreCase("Polygon") && nextPolygonData()
+        && nextSrid() && nextCharacter(';') && nextPolygon() 
         && nextCharacter('\'');
   }
 
   private boolean nextMultiPoint() {
-    if (nextPointData()) {
+    if (nextConstantIgnoreCase("MultiPoint") && nextCharacter('(') && nextPointData()) {
       while (nextCharacter(',')) {
         if (!nextPointData()) {
           return false;
         }
       }
     }
-    return true;
+    return nextCharacter(')');
   }
 
   private boolean nextGeoMultiPoint(final boolean isGeography) {
     return nextGeoPrefix(isGeography) && nextCharacter('\'')
-        && nextSrid() && nextCharacter(';')
-        && nextConstantIgnoreCase("MultiPoint") && nextCharacter('(') && nextMultiPoint() && nextCharacter(')')
+        && nextSrid() && nextCharacter(';') && nextMultiPoint()
         && nextCharacter('\'');
   }
 
   private boolean nextMultiLineString() {
-    if (nextLineStringData(false)) {
+    if (nextConstantIgnoreCase("MultiLineString") && nextCharacter('(') && nextLineStringData(false)) {
       while (nextCharacter(',')) {
         if (!nextLineStringData(false)) {
           return false;
         }
       }
     }
-    return true;
+    return nextCharacter(')');
   }
 
   private boolean nextGeoMultiLineString(final boolean isGeography) {
     return nextGeoPrefix(isGeography) && nextCharacter('\'')
-        && nextSrid() && nextCharacter(';')
-        && nextConstantIgnoreCase("MultiLineString")
-        && nextCharacter('(') && nextMultiLineString() && nextCharacter(')')
+        && nextSrid() && nextCharacter(';') && nextMultiLineString()
         && nextCharacter('\'');
   }
 
   private boolean nextMultiPolygon() {
-    if (nextPolygonData()) {
+    if (nextConstantIgnoreCase("MultiPolygon") && nextCharacter('(') && nextPolygonData()) {
       while (nextCharacter(',')) {
         if (!nextPolygonData()) {
           return false;
         }
       }
     }
-    return true;
+    return nextCharacter(')');
   }
 
   private boolean nextGeoMultiPolygon(final boolean isGeography) {
     return nextGeoPrefix(isGeography) && nextCharacter('\'')
-        && nextSrid() && nextCharacter(';')
-        && nextConstantIgnoreCase("MultiPolygon")
-        && nextCharacter('(') && nextMultiPolygon() && nextCharacter(')')
+        && nextSrid() && nextCharacter(';') && nextMultiPolygon()
+        && nextCharacter('\'');
+  }
+
+  /**
+   * Moves past geo data if found; otherwise leaves the index unchanged.
+   * @return whether geo data has been found at the current index
+   */
+  private boolean nextGeo() {
+    final int lastGoodIndex = index;
+    if (nextPoint()) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+    }
+    if (nextLineString()) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+    }
+    if (nextPolygon()) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+    }
+    if (nextMultiPoint()) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+    }
+    if (nextMultiLineString()) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+    }
+    if (nextMultiPolygon()) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+    }
+    if (nextCollection()) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+      return false;
+    }
+  }
+
+  private boolean nextCollection() {
+    if (nextConstantIgnoreCase("Collection") && nextCharacter('(') && nextGeo()) {
+      while (nextCharacter(',')) {
+        if (!nextGeo()) {
+          return false;
+        }
+      }
+    }
+    return nextCharacter(')');
+  }
+
+  private boolean nextGeoCollection(final boolean isGeography) {
+    return nextGeoPrefix(isGeography) && nextCharacter('\'')
+        && nextSrid() && nextCharacter(';') && nextCollection()
         && nextCharacter('\'');
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
index 4b88869..5d7c948 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
@@ -22,28 +22,20 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * <code>
- * searchExpr = ( OPEN BWS searchExpr BWS CLOSE
- * / searchTerm
- * ) [ searchOrExpr
- * / searchAndExpr
- * ]
- *
- * searchOrExpr = RWS 'OR' RWS searchExpr
+ * <pre>
+ * searchExpr    = ( OPEN BWS searchExpr BWS CLOSE / searchTerm )
+ *                 [ searchOrExpr / searchAndExpr ]
+ * searchOrExpr  = RWS 'OR' RWS searchExpr
  * searchAndExpr = RWS [ 'AND' RWS ] searchExpr
+ * searchTerm    = [ 'NOT' RWS ] ( searchPhrase / searchWord )
+ * searchPhrase  = quotation-mark 1*qchar-no-AMP-DQUOTE quotation-mark
+ * searchWord    = 1*ALPHA ; Actually: any character from the Unicode categories L or Nl,
+ *                                     but not the words AND, OR, and NOT
+ * </pre>
  *
- * searchTerm = [ 'NOT' RWS ] ( searchPhrase / searchWord )
- * searchPhrase = quotation-mark 1*qchar-no-AMP-DQUOTE quotation-mark
- * searchWord = 1*ALPHA ; Actually: any character from the Unicode categories L or Nl,
- * ; but not the words AND, OR, and NOT
- * </code>
- *
- * <b>ATTENTION:</b> For a <code>searchPhrase</code> the percent encoding is not supported by the
- * <code>SearchTokenizer</code>.<br/>
- * This was a decision based on that the <code>org.apache.olingo.server.core.uri.parser.Parser</code>
- * already handles in his <code>parseUri</code> method each query as <code>percent decoded</code> strings (see
- * line <i>177ff</i> (<code>for (RawUri.QueryOption option : uri.queryOptionListDecoded)</code>).
- *
+ * <b>ATTENTION:</b> This class does not support a percent-encoded <code>searchPhrase</code> because the URI parser's
+ * {@link org.apache.olingo.server.core.uri.parser.Parser#parseUri(String, String, String) parseUri} method
+ * <em>percent decodes</em> each query before calling parsers of query options.
  */
 public class SearchTokenizer {
 
@@ -75,17 +67,18 @@ public class SearchTokenizer {
 
     protected abstract State nextChar(char c) throws SearchTokenizerException;
 
+    /** @param c allowed character */
     public State allowed(final char c) {
       return this;
     }
 
     public State forbidden(final char c) throws SearchTokenizerException {
-      throw new SearchTokenizerException("Forbidden character in state " + getToken() + "->" + c,
+      throw new SearchTokenizerException("Forbidden character in state " + token + "->" + c,
           SearchTokenizerException.MessageKeys.FORBIDDEN_CHARACTER, "" + c);
     }
 
     public State invalid() throws SearchTokenizerException {
-      throw new SearchTokenizerException("Token " + getToken() + " is in invalid state.",
+      throw new SearchTokenizerException("Token " + token + " is in invalid state.",
           SearchTokenizerException.MessageKeys.INVALID_TOKEN_STATE);
     }
 
@@ -243,7 +236,7 @@ public class SearchTokenizer {
 
     @Override
     public String toString() {
-      return getToken() + "=>{" + getLiteral() + "}";
+      return token + "=>{" + getLiteral() + "}";
     }
   }
 
@@ -597,16 +590,14 @@ public class SearchTokenizer {
   }
 
   /**
-   * Take the search query and split into according SearchQueryToken.
-   * Before split into tokens the given search query is 'trimmed'.
+   * Takes the search query and splits it into a list of corresponding {@link SearchQueryToken}s.
+   * Before splitting it into tokens, leading and trailing whitespace in the given search query string is removed.
    *
    * @param searchQuery search query to be tokenized
    * @return list of tokens
-   * @throws SearchTokenizerException if something in query is not valid
-   * (based on OData search query ABNF)
+   * @throws SearchTokenizerException if something in query is not valid (based on OData search query ABNF)
    */
-  public List<SearchQueryToken> tokenize(final String searchQuery)
-      throws SearchTokenizerException {
+  public List<SearchQueryToken> tokenize(final String searchQuery) throws SearchTokenizerException {
 
     char[] chars = searchQuery.trim().toCharArray();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
index c764999..a5fda50 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
 
+import java.util.Arrays;
 import java.util.Locale;
 
 import org.apache.olingo.commons.api.edm.Edm;
@@ -158,14 +159,9 @@ public class ExpressionParserTest {
 
   @Test
   public void noParameterMethods() throws Exception {
-    Expression expression = parseMethod(TokenKind.NowMethod);
-    assertEquals("{now []}", expression.toString());
-
-    expression = parseMethod(TokenKind.MaxdatetimeMethod);
-    assertEquals("{maxdatetime []}", expression.toString());
-
-    expression = parseMethod(TokenKind.MindatetimeMethod);
-    assertEquals("{mindatetime []}", expression.toString());
+    parseMethod(TokenKind.NowMethod);
+    parseMethod(TokenKind.MaxdatetimeMethod);
+    parseMethod(TokenKind.MindatetimeMethod);
 
     wrongExpression("now(1)");
   }
@@ -176,46 +172,21 @@ public class ExpressionParserTest {
     final String dateValue = "1234-12-25";
     final String dateTimeOffsetValue = "1234-12-25T11:12:13.456Z";
 
-    Expression expression = parseMethod(TokenKind.LengthMethod, stringValue);
-    assertEquals("{length [" + stringValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.TolowerMethod, stringValue);
-    assertEquals("{tolower [" + stringValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.ToupperMethod, stringValue);
-    assertEquals("{toupper [" + stringValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.TrimMethod, stringValue);
-    assertEquals("{trim [" + stringValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.YearMethod, dateValue);
-    assertEquals("{year [" + dateValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.MonthMethod, dateValue);
-    assertEquals("{month [" + dateValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.DayMethod, dateValue);
-    assertEquals("{day [" + dateValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.HourMethod, dateTimeOffsetValue);
-    assertEquals("{hour [" + dateTimeOffsetValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.MinuteMethod, dateTimeOffsetValue);
-    assertEquals("{minute [" + dateTimeOffsetValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.SecondMethod, dateTimeOffsetValue);
-    assertEquals("{second [" + dateTimeOffsetValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.DateMethod, dateTimeOffsetValue);
-    assertEquals("{date [" + dateTimeOffsetValue + "]}", expression.toString());
-
-    expression = parseMethod(TokenKind.TotalsecondsMethod, "duration'PT1H'");
-    assertEquals("{totalseconds [duration'PT1H']}", expression.toString());
-
-    expression = parseMethod(TokenKind.RoundMethod, "3.141592653589793");
-    assertEquals("{round [3.141592653589793]}", expression.toString());
-
-    assertEquals("{hour [null]}", parseMethod(TokenKind.HourMethod, new String[] { null }).toString());
+    parseMethod(TokenKind.LengthMethod, stringValue);
+    parseMethod(TokenKind.TolowerMethod, stringValue);
+    parseMethod(TokenKind.ToupperMethod, stringValue);
+    parseMethod(TokenKind.TrimMethod, stringValue);
+    parseMethod(TokenKind.YearMethod, dateValue);
+    parseMethod(TokenKind.MonthMethod, dateValue);
+    parseMethod(TokenKind.DayMethod, dateValue);
+    parseMethod(TokenKind.HourMethod, dateTimeOffsetValue);
+    parseMethod(TokenKind.MinuteMethod, dateTimeOffsetValue);
+    parseMethod(TokenKind.SecondMethod, dateTimeOffsetValue);
+    parseMethod(TokenKind.DateMethod, dateTimeOffsetValue);
+    parseMethod(TokenKind.TotalsecondsMethod, "duration'PT1H'");
+    parseMethod(TokenKind.RoundMethod, "3.141592653589793");
+    parseMethod(TokenKind.GeoLengthMethod, "geometry'SRID=0;LineString(0 0,4 0,4 4,0 4,0 0)'");
+    parseMethod(TokenKind.HourMethod, new String[] { null });
 
     wrongExpression("trim()");
     wrongExpression("trim(1)");
@@ -224,35 +195,17 @@ public class ExpressionParserTest {
 
   @Test
   public void twoParameterMethods() throws Exception {
-    Expression expression = parseMethod(TokenKind.ContainsMethod, "'a'", "'b'");
-    assertEquals("{contains ['a', 'b']}", expression.toString());
-
-    expression = parseMethod(TokenKind.EndswithMethod, "'a'", "'b'");
-    assertEquals("{endswith ['a', 'b']}", expression.toString());
-
-    expression = parseMethod(TokenKind.StartswithMethod, "'a'", "'b'");
-    assertEquals("{startswith ['a', 'b']}", expression.toString());
-
-    expression = parseMethod(TokenKind.IndexofMethod, "'a'", "'b'");
-    assertEquals("{indexof ['a', 'b']}", expression.toString());
-
-    expression = parseMethod(TokenKind.ConcatMethod, "'a'", "'b'");
-    assertEquals("{concat ['a', 'b']}", expression.toString());
-
-    expression = parseMethod(TokenKind.GeoDistanceMethod,
-        "geography'SRID=0;Point(1.2 3.4)'", "geography'SRID=0;Point(5.6 7.8)'");
-    assertEquals("{geo.distance [geography'SRID=0;Point(1.2 3.4)', geography'SRID=0;Point(5.6 7.8)']}",
-        expression.toString());
-
-    expression = parseMethod(TokenKind.GeoIntersectsMethod,
+    parseMethod(TokenKind.ContainsMethod, "'a'", "'b'");
+    parseMethod(TokenKind.EndswithMethod, "'a'", "'b'");
+    parseMethod(TokenKind.StartswithMethod, "'a'", "'b'");
+    parseMethod(TokenKind.IndexofMethod, "'a'", "'b'");
+    parseMethod(TokenKind.ConcatMethod, "'a'", "'b'");
+    parseMethod(TokenKind.GeoDistanceMethod, "geography'SRID=0;Point(1.2 3.4)'", "geography'SRID=0;Point(5.6 7.8)'");
+    parseMethod(TokenKind.GeoIntersectsMethod,
         "geometry'SRID=0;Point(1.2 3.4)'",
         "geometry'SRID=0;Polygon((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1))'");
-    assertEquals("{geo.intersects [geometry'SRID=0;Point(1.2 3.4)', "
-        + "geometry'SRID=0;Polygon((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1))']}",
-        expression.toString());
-
-    assertEquals("{startswith [null, 'b']}", parseMethod(TokenKind.StartswithMethod, null, "'b'").toString());
-    assertEquals("{indexof ['a', null]}", parseMethod(TokenKind.IndexofMethod, "'a'", null).toString());
+    parseMethod(TokenKind.StartswithMethod, null, "'b'");
+    parseMethod(TokenKind.IndexofMethod, "'a'", null);
 
     wrongExpression("concat('a')");
     wrongExpression("endswith('a',1)");
@@ -260,16 +213,14 @@ public class ExpressionParserTest {
 
   @Test
   public void variableParameterNumberMethods() throws Exception {
-    Expression expression = parseMethod(TokenKind.SubstringMethod, "'abc'", "1", "2");
-    assertEquals("{substring ['abc', 1, 2]}", expression.toString());
-    expression = parseMethod(TokenKind.SubstringMethod, "'abc'", "1");
-    assertEquals("{substring ['abc', 1]}", expression.toString());
+    parseMethod(TokenKind.SubstringMethod, "'abc'", "1", "2");
+    parseMethod(TokenKind.SubstringMethod, "'abc'", "1");
 
-    assertEquals("{cast [Edm.SByte]}", parseMethod(TokenKind.CastMethod, "Edm.SByte").toString());
-    assertEquals("{cast [42, Edm.SByte]}", parseMethod(TokenKind.CastMethod, "42", "Edm.SByte").toString());
+    parseMethod(TokenKind.CastMethod, "Edm.SByte");
+    parseMethod(TokenKind.CastMethod, "42", "Edm.SByte");
 
-    assertEquals("{isof [Edm.SByte]}", parseMethod(TokenKind.IsofMethod, "Edm.SByte").toString());
-    assertEquals("{isof [42, Edm.SByte]}", parseMethod(TokenKind.IsofMethod, "42", "Edm.SByte").toString());
+    parseMethod(TokenKind.IsofMethod, "Edm.SByte");
+    parseMethod(TokenKind.IsofMethod, "42", "Edm.SByte");
 
     wrongExpression("substring('abc')");
     wrongExpression("substring('abc',1,2,3)");
@@ -278,10 +229,10 @@ public class ExpressionParserTest {
     wrongExpression("isof(Edm.Int16,2)");
   }
 
-  private Expression parseMethod(TokenKind kind, String... parameters)
-      throws UriParserException, UriValidationException {
-    String expressionString = kind.name().substring(0, kind.name().indexOf("Method"))
-        .toLowerCase(Locale.ROOT).replace("geo", "geo.") + '(';
+  private void parseMethod(TokenKind kind, String... parameters) throws UriParserException, UriValidationException {
+    final String methodName = kind.name().substring(0, kind.name().indexOf("Method")).toLowerCase(Locale.ROOT)
+        .replace("geo", "geo.");
+    String expressionString = methodName + '(';
     boolean first = true;
     for (final String parameter : parameters) {
       if (first) {
@@ -293,7 +244,9 @@ public class ExpressionParserTest {
     }
     expressionString += ')';
 
-    return parseExpression(expressionString);
+    final Expression expression = parseExpression(expressionString);
+    assertEquals('{' + methodName + ' ' + Arrays.toString(parameters) + '}',
+        expression.toString());
   }
 
   private Expression parseExpression(final String expressionString)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
index 78c6204..3ca49c8 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
@@ -624,6 +624,21 @@ public class UriTokenizerTest {
         'x');
   }
 
+  @Test
+  public void geoCollection() {
+    assertTrue(new UriTokenizer("geography'SRID=4326;Collection(Point(1 2))'").next(TokenKind.GeographyCollection));
+    assertTrue(new UriTokenizer("geography'SRID=4326;Collection(Collection(Point(1 2),Point(3 4)))'")
+        .next(TokenKind.GeographyCollection));
+    assertTrue(new UriTokenizer("geography'SRID=4326;Collection(LineString(1 2,3 4))'")
+        .next(TokenKind.GeographyCollection));
+    assertTrue(new UriTokenizer("geography'SRID=4326;Collection(Polygon((0 0,1 0,0 1,0 0)))'")
+        .next(TokenKind.GeographyCollection));
+    assertTrue(new UriTokenizer("geography'SRID=4326;Collection(MultiPoint(),MultiLineString(),MultiPolygon())'")
+        .next(TokenKind.GeographyCollection));
+
+    wrongToken(TokenKind.GeometryCollection, "geometry'SRID=0;Collection(Point(1 2),Point(3 4))'", 'x');
+  }
+
   private void wrongToken(final TokenKind kind, final String value, final char disturbCharacter) {
     assertFalse(new UriTokenizer(disturbCharacter + value).next(kind));
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java
index 828be80..5a03676 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java
@@ -5698,12 +5698,13 @@ public class TestFullResourcePath {
         .root()
         .right().isLiteral("3.4E37").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double));
 
-    testFilter.runOnETAllPrim("15.55555555555555555555555555555555555555555555 eq 3.1")
+    testFilter.runOnETAllPrim("15.55555555555555555555555555555555555555555555 eq -12345678901234567890")
         .isBinary(BinaryOperatorKind.EQ)
         .left().isLiteral("15.55555555555555555555555555555555555555555555")
         .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal))
         .root()
-        .right().isLiteral("3.1").isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal));
+        .right().isLiteral("-12345678901234567890")
+        .isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal));
 
     testFilter.runOnETAllPrim("duration'PT1H2S' eq duration'PT3602S'")
         .isBinary(BinaryOperatorKind.EQ)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
index 138e598..1b8c398 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
@@ -225,74 +225,74 @@ public class TestUriParserImpl {
   @Test
   public void entityFailOnValidation() throws Exception {
     // simple entity set; with qualifiedentityTypeName; with filter
-    testUri.runEx("$entity/olingo.odata.test1.ETTwoPrim", "$filter=PropertyInt16 eq 123&$id=ESAllKey")
+    testUri.runEx("$entity/olingo.odata.test1.ETTwoPrim", "$filter=PropertyInt16 eq 123&$id=ESAllPrim(1)")
         .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
   }
 
   @Test
   public void entity() throws Exception {
     // simple entity set
-    testUri.run("$entity", "$id=ESAllPrim").isKind(UriInfoKind.entityId)
+    testUri.run("$entity", "$id=ESAllPrim(1)").isKind(UriInfoKind.entityId)
     .isKind(UriInfoKind.entityId)
-    .isIdText("ESAllPrim");
+    .isIdText("ESAllPrim(1)");
 
     // simple entity set; $format before $id
-    testUri.run("$entity", "$format=xml&$id=ETAllPrim").isKind(UriInfoKind.entityId)
+    testUri.run("$entity", "$format=xml&$id=ESAllPrim(1)").isKind(UriInfoKind.entityId)
     .isFormatText("xml")
-    .isIdText("ETAllPrim");
+    .isIdText("ESAllPrim(1)");
 
-    testUri.run("$entity", "$format=xml&abc=123&$id=ESAllKey").isKind(UriInfoKind.entityId)
+    testUri.run("$entity", "$format=xml&abc=123&$id=ESAllPrim(1)").isKind(UriInfoKind.entityId)
     .isFormatText("xml")
     .isCustomParameter(0, "abc", "123")
-    .isIdText("ESAllKey");
+    .isIdText("ESAllPrim(1)");
 
     // simple entity set; $format after $id
-    testUri.run("$entity", "$id=ETAllPrim&$format=xml").isKind(UriInfoKind.entityId)
-    .isIdText("ETAllPrim")
+    testUri.run("$entity", "$id=ESAllPrim(1)&$format=xml").isKind(UriInfoKind.entityId)
+    .isIdText("ESAllPrim(1)")
     .isFormatText("xml");
 
     // simple entity set; $format and custom parameter after $id
-    testUri.run("$entity", "$id=ETAllPrim&$format=xml&abc=123").isKind(UriInfoKind.entityId)
-    .isIdText("ETAllPrim")
+    testUri.run("$entity", "$id=ESAllPrim(1)&$format=xml&abc=123").isKind(UriInfoKind.entityId)
+    .isIdText("ESAllPrim(1)")
     .isFormatText("xml")
     .isCustomParameter(0, "abc", "123");
 
     // simple entity set; $format before $id and custom parameter after $id
-    testUri.run("$entity", "$format=xml&$id=ETAllPrim&abc=123").isKind(UriInfoKind.entityId)
+    testUri.run("$entity", "$format=xml&$id=ESAllPrim(1)&abc=123").isKind(UriInfoKind.entityId)
     .isFormatText("xml")
-    .isIdText("ETAllPrim")
+    .isIdText("ESAllPrim(1)")
     .isCustomParameter(0, "abc", "123");
 
     // simple entity set; with qualifiedentityTypeName
-    testUri.run("$entity/olingo.odata.test1.ETTwoPrim", "$id=ESBase")
+    testUri.run("$entity/olingo.odata.test1.ETTwoPrim", "$id=ESBase(111)")
     .isEntityType(EntityTypeProvider.nameETTwoPrim)
-    .isIdText("ESBase");
+    .isIdText("ESBase(111)");
 
     // simple entity set; with qualifiedentityTypeName;
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim")
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim(1)")
     .isEntityType(EntityTypeProvider.nameETBase)
     .isKind(UriInfoKind.entityId)
-    .isIdText("ESTwoPrim");
+    .isIdText("ESTwoPrim(1)");
 
     // simple entity set; with qualifiedentityTypeName; with format
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$format=atom")
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim(1)&$format=atom")
     .isKind(UriInfoKind.entityId)
     .isEntityType(EntityTypeProvider.nameETBase)
-    .isIdText("ESTwoPrim")
+    .isIdText("ESTwoPrim(1)")
     .isFormatText("atom");
 
     // simple entity set; with qualifiedentityTypeName; with select
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$select=*")
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim(1)&$select=*")
     .isKind(UriInfoKind.entityId)
     .isEntityType(EntityTypeProvider.nameETBase)
-    .isIdText("ESTwoPrim")
+    .isIdText("ESTwoPrim(1)")
     .isSelectItemStar(0);
 
     // simple entity set; with qualifiedentityTypeName; with expand
-    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$expand=*")
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim(1)&$expand=*")
     .isKind(UriInfoKind.entityId)
     .isEntityType(EntityTypeProvider.nameETBase)
-    .isIdText("ESTwoPrim")
+    .isIdText("ESTwoPrim(1)")
     .goExpand().first().isSegmentStar();
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8537f3a5/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
index 868f9b8..673b8ff 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
@@ -52,7 +52,7 @@ public class UriValidatorTest {
   private static final String URI_ALL = "$all";
   private static final String URI_BATCH = "$batch";
   private static final String URI_CROSSJOIN = "$crossjoin(ESAllPrim)";
-  private static final String URI_ENTITY_ID = "$entity";
+  private static final String URI_ENTITY_ID = "$entity/Namespace1_Alias.ETBase";
   private static final String URI_METADATA = "$metadata";
   private static final String URI_SERVICE = "";
   private static final String URI_ENTITY_SET = "ESAllPrim";
@@ -81,7 +81,7 @@ public class UriValidatorTest {
   private static final String QO_FILTER = "$filter='1' eq '1'";
   private static final String QO_FORMAT = "$format=bla/bla";
   private static final String QO_EXPAND = "$expand=*";
-  private static final String QO_ID = "$id=Products(0)";
+  private static final String QO_ID = "$id=ESAllPrim(1)";
   private static final String QO_COUNT = "$count=true";
   private static final String QO_ORDERBY = "$orderby=true";
   private static final String QO_SEARCH = "$search=bla";


[14/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] ExpressionParser parses path expressions

Posted by mi...@apache.org.
[OLINGO-834] ExpressionParser parses path expressions

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: a809165896e8315a04b566e11bd1637c26044c7d
Parents: 104ecf4
Author: Klaus Straubinger <kl...@sap.com>
Authored: Fri Dec 18 16:42:51 2015 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Dec 21 10:10:35 2015 +0100

----------------------------------------------------------------------
 .../deserializer/helper/ExpandTreeBuilder.java  |  14 +-
 .../server/core/uri/UriResourceActionImpl.java  |  44 +-
 .../uri/UriResourceComplexPropertyImpl.java     |  18 +-
 .../server/core/uri/UriResourceCountImpl.java   |  10 +-
 .../core/uri/UriResourceEntitySetImpl.java      |  19 +-
 .../core/uri/UriResourceFunctionImpl.java       |  48 +-
 .../olingo/server/core/uri/UriResourceImpl.java |   6 +-
 .../server/core/uri/UriResourceItImpl.java      |  31 +-
 .../core/uri/UriResourceLambdaAllImpl.java      |  26 +-
 .../core/uri/UriResourceLambdaAnyImpl.java      |  25 +-
 .../core/uri/UriResourceLambdaVarImpl.java      |  32 +-
 .../uri/UriResourceNavigationPropertyImpl.java  |  21 +-
 .../uri/UriResourcePrimitivePropertyImpl.java   |  20 +-
 .../server/core/uri/UriResourceRefImpl.java     |  10 +-
 .../server/core/uri/UriResourceRootImpl.java    |  31 +-
 .../core/uri/UriResourceSingletonImpl.java      |  21 +-
 .../uri/UriResourceStartingTypeFilterImpl.java  |  33 +-
 .../server/core/uri/UriResourceTypedImpl.java   |  11 +-
 .../server/core/uri/UriResourceValueImpl.java   |   9 +-
 .../core/uri/parser/ExpressionParser.java       | 560 ++++++++++-
 .../server/core/uri/parser/FilterParser.java    |  49 +
 .../server/core/uri/parser/OrderByParser.java   |  61 ++
 .../olingo/server/core/uri/parser/Parser.java   | 123 +--
 .../server/core/uri/parser/ParserHelper.java    | 335 ++++++-
 .../core/uri/parser/ResourcePathParser.java     | 323 +-----
 .../server/core/uri/parser/SelectParser.java    |  10 +-
 .../server/core/uri/parser/UriContext.java      |   7 +-
 .../core/uri/parser/UriParseTreeVisitor.java    | 124 +--
 .../server/core/uri/parser/UriTokenizer.java    |  36 +-
 .../uri/queryoption/expression/MemberImpl.java  |   5 +
 .../olingo/server/core/uri/UriInfoImplTest.java |  10 +-
 .../core/uri/parser/ExpressionParserTest.java   |  21 +-
 .../core/uri/parser/UriTokenizerTest.java       |  31 +-
 .../server/core/uri/UriResourceImplTest.java    | 156 ++-
 .../core/uri/antlr/TestFullResourcePath.java    | 979 +++++++++----------
 .../core/uri/antlr/TestUriParserImpl.java       |  36 +-
 .../queryoption/expression/ExpressionTest.java  |  12 +-
 37 files changed, 1816 insertions(+), 1491 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
index 549cf33..7577e7b 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilder.java
@@ -27,14 +27,8 @@ public abstract class ExpandTreeBuilder {
   public abstract ExpandTreeBuilder expand(EdmNavigationProperty edmNavigationProperty);
 
   protected ExpandItemImpl buildExpandItem(final EdmNavigationProperty edmNavigationProperty) {
-    final ExpandItemImpl expandItem = new ExpandItemImpl();
-    final UriInfoImpl uriInfo = new UriInfoImpl();
-    final UriResourceNavigationPropertyImpl resourceNavigation = new UriResourceNavigationPropertyImpl();
-
-    resourceNavigation.setNavigationProperty(edmNavigationProperty);
-    uriInfo.addResourcePart(resourceNavigation);
-    expandItem.setResourcePath(uriInfo);
-
-    return expandItem;
+    return new ExpandItemImpl()
+        .setResourcePath(new UriInfoImpl()
+            .addResourcePart(new UriResourceNavigationPropertyImpl(edmNavigationProperty)));
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
index 4126110..1853942 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java
@@ -31,11 +31,19 @@ import org.apache.olingo.server.api.uri.UriResourceKind;
  */
 public class UriResourceActionImpl extends UriResourceImpl implements UriResourceAction {
 
-  protected EdmAction action;
-  protected EdmActionImport actionImport;
+  private final EdmActionImport actionImport;
+  private final EdmAction action;
 
-  public UriResourceActionImpl() {
+  public UriResourceActionImpl(final EdmActionImport actionImport) {
     super(UriResourceKind.action);
+    this.actionImport = actionImport;
+    this.action = actionImport.getUnboundAction();
+  }
+
+  public UriResourceActionImpl(final EdmAction action) {
+    super(UriResourceKind.action);
+    this.actionImport = null;
+    this.action = action;
   }
 
   @Override
@@ -43,38 +51,21 @@ public class UriResourceActionImpl extends UriResourceImpl implements UriResourc
     return action;
   }
 
-  public UriResourceActionImpl setAction(final EdmAction action) {
-    this.action = action;
-    return this;
-  }
-
   @Override
   public EdmActionImport getActionImport() {
     return actionImport;
   }
 
-  public UriResourceActionImpl setActionImport(final EdmActionImport actionImport) {
-    this.actionImport = actionImport;
-    setAction(actionImport.getUnboundAction());
-    return this;
-  }
-
   @Override
   public boolean isCollection() {
-    if (action.getReturnType() != null) {
-      return action.getReturnType().isCollection();
-    }
-    return false;
+    return action.getReturnType() != null && action.getReturnType().isCollection();
   }
 
   @Override
   public EdmType getType() {
-    if (action.getReturnType() != null) {
-      return action.getReturnType().getType();
-    }
-    return null;
+    return action.getReturnType() == null ? null : action.getReturnType().getType();
   }
-  
+
   @Override
   public String getSegmentValue(final boolean includeFilters) {
     return actionImport == null ? (action == null ? "" : action.getName()) : actionImport.getName();
@@ -84,14 +75,9 @@ public class UriResourceActionImpl extends UriResourceImpl implements UriResourc
   public String getSegmentValue() {
     return getSegmentValue(false);
   }
-  
+
   @Override
   public String toString(final boolean includeFilters) {
     return getSegmentValue(includeFilters);
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
index 63db69c..9c83f24 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java
@@ -26,10 +26,11 @@ import org.apache.olingo.server.api.uri.UriResourceKind;
 
 public class UriResourceComplexPropertyImpl extends UriResourceTypedImpl implements UriResourceComplexProperty {
 
-  protected EdmProperty property;
+  private final EdmProperty property;
 
-  public UriResourceComplexPropertyImpl() {
+  public UriResourceComplexPropertyImpl(final EdmProperty property) {
     super(UriResourceKind.complexProperty);
+    this.property = property;
   }
 
   @Override
@@ -37,11 +38,6 @@ public class UriResourceComplexPropertyImpl extends UriResourceTypedImpl impleme
     return property;
   }
 
-  public UriResourceComplexPropertyImpl setProperty(final EdmProperty property) {
-    this.property = property;
-    return this;
-  }
-
   @Override
   public EdmComplexType getComplexType() {
     return (EdmComplexType) getType();
@@ -63,13 +59,7 @@ public class UriResourceComplexPropertyImpl extends UriResourceTypedImpl impleme
   }
 
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return property.getName();
   }
-  
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
index e1859a6..90dc4f5 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java
@@ -26,15 +26,9 @@ public class UriResourceCountImpl extends UriResourceImpl implements UriResource
   public UriResourceCountImpl() {
     super(UriResourceKind.count);
   }
-  
-  @Override
-  public String getSegmentValue(){
-    return "$count";
-  }
 
   @Override
-  public String toString() {
-    return getSegmentValue();
+  public String getSegmentValue() {
+    return "$count";
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
index 4675964..ea21fe5 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java
@@ -25,10 +25,12 @@ import org.apache.olingo.server.api.uri.UriResourceEntitySet;
 import org.apache.olingo.server.api.uri.UriResourceKind;
 
 public class UriResourceEntitySetImpl extends UriResourceWithKeysImpl implements UriResourceEntitySet {
-  protected EdmEntitySet edmEntitySet = null;
 
-  public UriResourceEntitySetImpl() {
+  private final EdmEntitySet edmEntitySet;
+
+  public UriResourceEntitySetImpl(final EdmEntitySet edmEntitySet) {
     super(UriResourceKind.entitySet);
+    this.edmEntitySet = edmEntitySet;
   }
 
   @Override
@@ -36,11 +38,6 @@ public class UriResourceEntitySetImpl extends UriResourceWithKeysImpl implements
     return edmEntitySet;
   }
 
-  public UriResourceEntitySetImpl setEntitSet(final EdmEntitySet edmES) {
-    edmEntitySet = edmES;
-    return this;
-  }
-
   @Override
   public EdmEntityType getEntityType() {
     return edmEntitySet.getEntityType();
@@ -57,13 +54,7 @@ public class UriResourceEntitySetImpl extends UriResourceWithKeysImpl implements
   }
   
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return edmEntitySet.getName();
   }
-  
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
index a47a6ab..7784062 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java
@@ -33,13 +33,16 @@ import org.apache.olingo.server.api.uri.UriResourceKind;
  */
 public class UriResourceFunctionImpl extends UriResourceWithKeysImpl implements UriResourceFunction {
 
-  protected List<UriParameter> parameters;
-  protected EdmFunction function;
-  protected EdmFunctionImport functionImport;
-  private boolean isParameterListFilled = false;
+  private final EdmFunctionImport functionImport;
+  private final EdmFunction function;
+  private final List<UriParameter> parameters;
 
-  public UriResourceFunctionImpl() {
+  public UriResourceFunctionImpl(final EdmFunctionImport edmFunctionImport, final EdmFunction function,
+      final List<UriParameter> parameters) {
     super(UriResourceKind.function);
+    this.functionImport = edmFunctionImport;
+    this.function = function;
+    this.parameters = parameters;
   }
 
   @Override
@@ -49,34 +52,16 @@ public class UriResourceFunctionImpl extends UriResourceWithKeysImpl implements
         Collections.unmodifiableList(parameters);
   }
 
-  public UriResourceFunctionImpl setParameters(final List<UriParameter> parameters) {
-    isParameterListFilled = true;
-    this.parameters = parameters;
-    return this;
-  }
-
   @Override
   public EdmFunction getFunction() {
     return function;
   }
 
-  public UriResourceFunctionImpl setFunction(final EdmFunction function) {
-    this.function = function;
-    return this;
-  }
-
   @Override
   public EdmFunctionImport getFunctionImport() {
     return functionImport;
   }
 
-  public UriResourceFunctionImpl setFunctionImport(final EdmFunctionImport edmFunctionImport,
-      final List<UriParameter> parameters) {
-    functionImport = edmFunctionImport;
-    setParameters(parameters);
-    return this;
-  }
-
   @Override
   public EdmType getType() {
     return function.getReturnType().getType();
@@ -89,21 +74,6 @@ public class UriResourceFunctionImpl extends UriResourceWithKeysImpl implements
 
   @Override
   public String getSegmentValue() {
-    if (functionImport != null) {
-      return functionImport.getName();
-    } else if (function != null) {
-      return function.getName();
-    }
-    return "";
+    return functionImport == null ? (function == null ? "" : function.getName()) : functionImport.getName();
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
-
-  public boolean isParameterListFilled() {
-    return isParameterListFilled;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
index 9fbcbd0..db991a8 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java
@@ -22,7 +22,7 @@ import org.apache.olingo.server.api.uri.UriResource;
 import org.apache.olingo.server.api.uri.UriResourceKind;
 
 /**
- * Covers Functionimports and BoundFunction in URI
+ * Abstract class for resource-path elements in URI.
  */
 public abstract class UriResourceImpl implements UriResource {
   protected UriResourceKind kind;
@@ -36,4 +36,8 @@ public abstract class UriResourceImpl implements UriResource {
     return kind;
   }
 
+  @Override
+  public String toString() {
+    return getSegmentValue();
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
index fc31910..e7db56c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java
@@ -27,11 +27,13 @@ import org.apache.olingo.server.api.uri.UriResourceKind;
  */
 public class UriResourceItImpl extends UriResourceWithKeysImpl implements UriResourceIt {
 
-  private EdmType type;
-  private boolean isCollection;
+  private final EdmType type;
+  private final boolean isCollection;
 
-  public UriResourceItImpl() {
+  public UriResourceItImpl(final EdmType type, final boolean isCollection) {
     super(UriResourceKind.it);
+    this.type = type;
+    this.isCollection = isCollection;
   }
 
   @Override
@@ -39,32 +41,13 @@ public class UriResourceItImpl extends UriResourceWithKeysImpl implements UriRes
     return type;
   }
 
-  public UriResourceItImpl setType(final EdmType type) {
-    this.type = type;
-    return this;
-  }
-
   @Override
   public boolean isCollection() {
-    if (keyPredicates != null) {
-      return false;
-    }
-    return isCollection;
+    return keyPredicates == null && isCollection;
   }
 
-  public UriResourceItImpl setCollection(final boolean isCollection) {
-    this.isCollection = isCollection;
-    return this;
-  }
-  
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$it";
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
index d980777..4f5a4fa 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java
@@ -19,7 +19,6 @@
 package org.apache.olingo.server.core.uri;
 
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 import org.apache.olingo.server.api.uri.UriResourceKind;
@@ -28,12 +27,13 @@ import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
 
 public class UriResourceLambdaAllImpl extends UriResourceTypedImpl implements UriResourceLambdaAll {
 
-  protected EdmProperty property;
-  private String lambdaVariable;
-  private Expression expression;
+  private final String lambdaVariable;
+  private final Expression expression;
 
-  public UriResourceLambdaAllImpl() {
+  public UriResourceLambdaAllImpl(final String lambdaVariable, final Expression expression) {
     super(UriResourceKind.lambdaAll);
+    this.lambdaVariable = lambdaVariable;
+    this.expression = expression;
   }
 
   @Override
@@ -51,29 +51,13 @@ public class UriResourceLambdaAllImpl extends UriResourceTypedImpl implements Ur
     return lambdaVariable;
   }
 
-  public UriResourceLambdaAllImpl setLamdaVariable(final String lambdaVariable) {
-    this.lambdaVariable = lambdaVariable;
-    return this;
-  }
-
   @Override
   public Expression getExpression() {
     return expression;
   }
 
-  public UriResourceLambdaAllImpl setExpression(final Expression expression) {
-    this.expression = expression;
-    return this;
-  }
-
   @Override
   public String getSegmentValue() {
     return "all";
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
index fe5dfee..b586a09 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java
@@ -19,7 +19,6 @@
 package org.apache.olingo.server.core.uri;
 
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 import org.apache.olingo.server.api.uri.UriResourceKind;
@@ -28,12 +27,13 @@ import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
 
 public class UriResourceLambdaAnyImpl extends UriResourceTypedImpl implements UriResourceLambdaAny {
 
-  protected EdmProperty property;
-  private String lambdaVariable;
-  private Expression expression;
+  private final String lambdaVariable;
+  private final Expression expression;
 
-  public UriResourceLambdaAnyImpl() {
+  public UriResourceLambdaAnyImpl(final String lambdaVariable, final Expression expression) {
     super(UriResourceKind.lambdaAny);
+    this.lambdaVariable = lambdaVariable;
+    this.expression = expression;
   }
 
   @Override
@@ -51,28 +51,13 @@ public class UriResourceLambdaAnyImpl extends UriResourceTypedImpl implements Ur
     return lambdaVariable;
   }
 
-  public UriResourceLambdaAnyImpl setLamdaVariable(final String lambdaVariable) {
-    this.lambdaVariable = lambdaVariable;
-    return this;
-  }
-
   @Override
   public Expression getExpression() {
     return expression;
   }
 
-  public UriResourceLambdaAnyImpl setExpression(final Expression expression) {
-    this.expression = expression;
-    return this;
-  }
-
   @Override
   public String getSegmentValue() {
     return "any";
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
index 2eb7607..306807a 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java
@@ -24,12 +24,13 @@ import org.apache.olingo.server.api.uri.UriResourceLambdaVariable;
 
 public class UriResourceLambdaVarImpl extends UriResourceTypedImpl implements UriResourceLambdaVariable {
 
-  private EdmType type;
-  private boolean isCollection;
-  private String variableText;
+  private final String variableText;
+  private final EdmType type;
 
-  public UriResourceLambdaVarImpl() {
+  public UriResourceLambdaVarImpl(final String variableText, final EdmType type) {
     super(UriResourceKind.lambdaVariable);
+    this.variableText = variableText;
+    this.type = type;
   }
 
   @Override
@@ -37,39 +38,18 @@ public class UriResourceLambdaVarImpl extends UriResourceTypedImpl implements Ur
     return variableText;
   }
 
-  public UriResourceLambdaVarImpl setVariableText(final String variableText) {
-    this.variableText = variableText;
-    return this;
-  }
-
   @Override
   public EdmType getType() {
     return type;
   }
 
-  public UriResourceLambdaVarImpl setType(final EdmType type) {
-    this.type = type;
-    return this;
-
-  }
-
   @Override
   public boolean isCollection() {
-    return isCollection;
-  }
-
-  public UriResourceLambdaVarImpl setCollection(final boolean isCollection) {
-    this.isCollection = isCollection;
-    return this;
+    return false;
   }
 
   @Override
   public String getSegmentValue() {
     return variableText;
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
index f4390b5..1d8b321 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java
@@ -25,10 +25,11 @@ import org.apache.olingo.server.api.uri.UriResourceNavigation;
 
 public class UriResourceNavigationPropertyImpl extends UriResourceWithKeysImpl implements UriResourceNavigation {
 
-  protected EdmNavigationProperty navigationProperty;
+  private final EdmNavigationProperty navigationProperty;
 
-  public UriResourceNavigationPropertyImpl() {
+  public UriResourceNavigationPropertyImpl(final EdmNavigationProperty property) {
     super(UriResourceKind.navigationProperty);
+    navigationProperty = property;
   }
 
   @Override
@@ -36,12 +37,6 @@ public class UriResourceNavigationPropertyImpl extends UriResourceWithKeysImpl i
     return navigationProperty;
   }
 
-  public UriResourceNavigationPropertyImpl setNavigationProperty(final EdmNavigationProperty property) {
-    navigationProperty = property;
-    return this;
-
-  }
-
   @Override
   public EdmType getType() {
     return navigationProperty.getType();
@@ -51,15 +46,9 @@ public class UriResourceNavigationPropertyImpl extends UriResourceWithKeysImpl i
   public boolean isCollection() {
     return navigationProperty.isCollection() && keyPredicates == null;
   }
-  
-  @Override
-  public String getSegmentValue(){
-    return navigationProperty.getName();
-  }
 
   @Override
-  public String toString() {
-    return getSegmentValue();
+  public String getSegmentValue() {
+    return navigationProperty.getName();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
index d470ef4..bb04142 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java
@@ -25,10 +25,11 @@ import org.apache.olingo.server.api.uri.UriResourcePrimitiveProperty;
 
 public class UriResourcePrimitivePropertyImpl extends UriResourceTypedImpl implements UriResourcePrimitiveProperty {
 
-  EdmProperty property;
+  private final EdmProperty property;
 
-  public UriResourcePrimitivePropertyImpl() {
+  public UriResourcePrimitivePropertyImpl(final EdmProperty property) {
     super(UriResourceKind.primitiveProperty);
+    this.property = property;
   }
 
   @Override
@@ -36,11 +37,6 @@ public class UriResourcePrimitivePropertyImpl extends UriResourceTypedImpl imple
     return property;
   }
 
-  public UriResourcePrimitivePropertyImpl setProperty(final EdmProperty property) {
-    this.property = property;
-    return this;
-  }
-
   @Override
   public EdmType getType() {
     return property.getType();
@@ -50,15 +46,9 @@ public class UriResourcePrimitivePropertyImpl extends UriResourceTypedImpl imple
   public boolean isCollection() {
     return property.isCollection();
   }
-  
-  @Override
-  public String getSegmentValue(){
-    return  property.getName();
-  }
 
   @Override
-  public String toString() {
-    return getSegmentValue();
+  public String getSegmentValue() {
+    return property.getName();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
index 0c45f9a..6f01936 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java
@@ -25,16 +25,10 @@ public class UriResourceRefImpl extends UriResourceImpl implements UriResourceRe
 
   public UriResourceRefImpl() {
     super(UriResourceKind.ref);
-
-  }
-  @Override
-  public String getSegmentValue(){
-    return "$ref";
   }
 
   @Override
-  public String toString() {
-    return getSegmentValue();
+  public String getSegmentValue() {
+    return "$ref";
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
index 5d8737f..761899f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java
@@ -24,11 +24,13 @@ import org.apache.olingo.server.api.uri.UriResourceRoot;
 
 public class UriResourceRootImpl extends UriResourceWithKeysImpl implements UriResourceRoot {
 
-  private EdmType type;
-  private boolean isCollection;
+  private final EdmType type;
+  private final boolean isCollection;
 
-  public UriResourceRootImpl() {
+  public UriResourceRootImpl(final EdmType type, final boolean isCollection) {
     super(UriResourceKind.root);
+    this.type = type;
+    this.isCollection = isCollection;
   }
 
   @Override
@@ -36,32 +38,13 @@ public class UriResourceRootImpl extends UriResourceWithKeysImpl implements UriR
     return type;
   }
 
-  public UriResourceRootImpl setType(final EdmType type) {
-    this.type = type;
-    return this;
-  }
-
   @Override
   public boolean isCollection() {
-    if (keyPredicates != null) {
-      return false;
-    }
-    return isCollection;
+    return keyPredicates == null && isCollection;
   }
 
-  public UriResourceRootImpl setCollection(final boolean isCollection) {
-    this.isCollection = isCollection;
-    return this;
-  }
-  
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$root";
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
index 72289f6..381a518 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java
@@ -26,10 +26,11 @@ import org.apache.olingo.server.api.uri.UriResourceSingleton;
 
 public class UriResourceSingletonImpl extends UriResourceTypedImpl implements UriResourceSingleton {
 
-  private EdmSingleton singleton;
+  private final EdmSingleton singleton;
 
-  public UriResourceSingletonImpl() {
+  public UriResourceSingletonImpl(final EdmSingleton singleton) {
     super(UriResourceKind.singleton);
+    this.singleton = singleton;
   }
 
   @Override
@@ -37,12 +38,6 @@ public class UriResourceSingletonImpl extends UriResourceTypedImpl implements Ur
     return singleton;
   }
 
-  public UriResourceSingletonImpl setSingleton(final EdmSingleton singleton) {
-
-    this.singleton = singleton;
-    return this;
-  }
-
   @Override
   public EdmEntityType getEntityTypeFilter() {
     return (EdmEntityType) typeFilter;
@@ -62,15 +57,9 @@ public class UriResourceSingletonImpl extends UriResourceTypedImpl implements Ur
   public boolean isCollection() {
     return false;
   }
-  
-  @Override
-  public String getSegmentValue(){
-    return singleton.getName();
-  }
 
   @Override
-  public String toString() {
-    return getSegmentValue();
+  public String getSegmentValue() {
+    return singleton.getName();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
index 24d3713..09af068 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java
@@ -23,11 +23,13 @@ import org.apache.olingo.server.api.uri.UriResourceKind;
 
 public class UriResourceStartingTypeFilterImpl extends UriResourceWithKeysImpl {
 
-  private EdmType type;
-  private boolean isCollection;
+  private final EdmType type;
+  private final boolean isCollection;
 
-  public UriResourceStartingTypeFilterImpl() {
+  public UriResourceStartingTypeFilterImpl(final EdmType type, final boolean isCollection) {
     super(null);
+    this.type = type;
+    this.isCollection = isCollection;
   }
 
   @Override
@@ -40,32 +42,13 @@ public class UriResourceStartingTypeFilterImpl extends UriResourceWithKeysImpl {
     return type;
   }
 
-  public UriResourceStartingTypeFilterImpl setType(final EdmType type) {
-    this.type = type;
-    return this;
-  }
-
   @Override
   public boolean isCollection() {
-    if (keyPredicates != null) {
-      return false;
-    }
-    return isCollection;
-  }
-
-  public UriResourceStartingTypeFilterImpl setCollection(final boolean isCollection) {
-    this.isCollection = isCollection;
-    return this;
+    return keyPredicates == null && isCollection;
   }
 
   @Override
-  public String getSegmentValue(){
-    return type.getNamespace() + "." + type.getName();
+  public String getSegmentValue() {
+    return type.getFullQualifiedName().getFullQualifiedNameAsString();
   }
-  
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
index d6710ad..9930a7e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java
@@ -41,14 +41,9 @@ public abstract class UriResourceTypedImpl extends UriResourceImpl implements Ur
   }
 
   public String getSegmentValue(final boolean includeFilters) {
-    if (includeFilters) {
-      if (typeFilter != null) {
-        return getSegmentValue() + "/" + typeFilter.getFullQualifiedName().toString();
-      } else {
-        return getSegmentValue();
-      }
-    }
-    return getSegmentValue();
+    return includeFilters && typeFilter != null ?
+        getSegmentValue() + "/" + typeFilter.getFullQualifiedName().getFullQualifiedNameAsString() :
+        getSegmentValue();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
index 73f86c4..d2b70d5 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java
@@ -25,17 +25,10 @@ public class UriResourceValueImpl extends UriResourceImpl implements UriResource
 
   public UriResourceValueImpl() {
     super(UriResourceKind.value);
-
   }
 
   @Override
-  public String getSegmentValue(){
+  public String getSegmentValue() {
     return "$value";
   }
-
-  @Override
-  public String toString() {
-    return getSegmentValue();
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
index 61c023d..2f7fdb2 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
@@ -18,20 +18,41 @@
  */
 package org.apache.olingo.server.core.uri.parser;
 
+import java.util.ArrayDeque;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
+import java.util.Deque;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmElement;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmReturnType;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
 import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
 import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.uri.UriParameter;
+import org.apache.olingo.server.api.uri.UriResourceFunction;
+import org.apache.olingo.server.api.uri.UriResourceLambdaVariable;
+import org.apache.olingo.server.api.uri.UriResourceNavigation;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
 import org.apache.olingo.server.api.uri.queryoption.expression.Alias;
 import org.apache.olingo.server.api.uri.queryoption.expression.Binary;
 import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
@@ -45,12 +66,32 @@ import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.TypeLiteral;
 import org.apache.olingo.server.api.uri.queryoption.expression.Unary;
 import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.UriResourceComplexPropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourceCountImpl;
+import org.apache.olingo.server.core.uri.UriResourceEntitySetImpl;
+import org.apache.olingo.server.core.uri.UriResourceFunctionImpl;
+import org.apache.olingo.server.core.uri.UriResourceItImpl;
+import org.apache.olingo.server.core.uri.UriResourceLambdaAllImpl;
+import org.apache.olingo.server.core.uri.UriResourceLambdaAnyImpl;
+import org.apache.olingo.server.core.uri.UriResourceLambdaVarImpl;
+import org.apache.olingo.server.core.uri.UriResourceNavigationPropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourcePrimitivePropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourceRootImpl;
+import org.apache.olingo.server.core.uri.UriResourceSingletonImpl;
+import org.apache.olingo.server.core.uri.UriResourceStartingTypeFilterImpl;
+import org.apache.olingo.server.core.uri.UriResourceTypedImpl;
+import org.apache.olingo.server.core.uri.UriResourceWithKeysImpl;
 import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
 import org.apache.olingo.server.core.uri.queryoption.expression.AliasImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.BinaryImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.EnumerationImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.MemberImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.MethodImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.TypeLiteralImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.UnaryImpl;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
 
 public class ExpressionParser {
   private static final Map<TokenKind, BinaryOperatorKind> tokenToBinaryOperator;
@@ -129,7 +170,7 @@ public class ExpressionParser {
     Map<TokenKind, EdmPrimitiveTypeKind> temp = new HashMap<TokenKind, EdmPrimitiveTypeKind>();
     temp.put(TokenKind.BooleanValue, EdmPrimitiveTypeKind.Boolean);
     temp.put(TokenKind.StringValue, EdmPrimitiveTypeKind.String);
-    // TODO:Check if int64 is correct here or if it has to be single instead
+    // TODO: Check if int64 is correct here or if it has to be decimal or single or double instead.
     temp.put(TokenKind.IntegerValue, EdmPrimitiveTypeKind.Int64);
     temp.put(TokenKind.GuidValue, EdmPrimitiveTypeKind.Guid);
     temp.put(TokenKind.DateValue, EdmPrimitiveTypeKind.Date);
@@ -147,20 +188,27 @@ public class ExpressionParser {
   private final OData odata;
 
   private UriTokenizer tokenizer;
+  private Deque<UriResourceLambdaVariable> lambdaVariables = new ArrayDeque<UriResourceLambdaVariable>();
+  private EdmType referringType;
+  private Collection<String> crossjoinEntitySetNames;
 
   public ExpressionParser(final Edm edm, final OData odata) {
     this.edm = edm;
     this.odata = odata;
   }
 
-  public Expression parse(UriTokenizer tokenizer) throws UriParserException {
+  public Expression parse(UriTokenizer tokenizer, final EdmType referringType,
+      final Collection<String> crossjoinEntitySetNames)
+      throws UriParserException, UriValidationException {
     // Initialize tokenizer.
     this.tokenizer = tokenizer;
+    this.referringType = referringType;
+    this.crossjoinEntitySetNames = crossjoinEntitySetNames;
 
     return parseExpression();
   }
 
-  private Expression parseExpression() throws UriParserException {
+  private Expression parseExpression() throws UriParserException, UriValidationException {
     Expression left = parseAnd();
     while (tokenizer.next(TokenKind.OrOperator)) {
       final Expression right = parseAnd();
@@ -172,7 +220,7 @@ public class ExpressionParser {
     return left;
   }
 
-  private Expression parseAnd() throws UriParserException {
+  private Expression parseAnd() throws UriParserException, UriValidationException {
     Expression left = parseExprEquality();
     while (tokenizer.next(TokenKind.AndOperator)) {
       final Expression right = parseExprEquality();
@@ -184,7 +232,7 @@ public class ExpressionParser {
     return left;
   }
 
-  private Expression parseExprEquality() throws UriParserException {
+  private Expression parseExprEquality() throws UriParserException, UriValidationException {
     Expression left = parseExprRel();
     TokenKind operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.EqualsOperator, TokenKind.NotEqualsOperator);
     // Null for everything other than EQ or NE
@@ -199,7 +247,7 @@ public class ExpressionParser {
   }
 
   // TODO: The 'isof' method has relational precedence and should appear here.
-  private Expression parseExprRel() throws UriParserException {
+  private Expression parseExprRel() throws UriParserException, UriValidationException {
     Expression left = parseExprAdd();
     TokenKind operatorTokenKind = ParserHelper.next(tokenizer,
         TokenKind.GreaterThanOperator, TokenKind.GreaterThanOrEqualsOperator,
@@ -217,7 +265,7 @@ public class ExpressionParser {
     return left;
   }
 
-  private Expression parseExprAdd() throws UriParserException {
+  private Expression parseExprAdd() throws UriParserException, UriValidationException {
     Expression left = parseExprMul();
     TokenKind operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.AddOperator, TokenKind.SubOperator);
     // Null for everything other than ADD or SUB
@@ -231,7 +279,7 @@ public class ExpressionParser {
     return left;
   }
 
-  private Expression parseExprMul() throws UriParserException {
+  private Expression parseExprMul() throws UriParserException, UriValidationException {
     Expression left = parseExprUnary();
     TokenKind operatorTokenKind = ParserHelper.next(tokenizer,
         TokenKind.MulOperator, TokenKind.DivOperator, TokenKind.ModOperator);
@@ -255,7 +303,22 @@ public class ExpressionParser {
   }
 
   // TODO: The 'cast' method has unary precedence and should appear here.
-  private Expression parseExprUnary() throws UriParserException {
+  private Expression parseExprUnary() throws UriParserException, UriValidationException {
+    // Negative numbers start with a minus indistinguishable from an unary minus operator.
+    // So we read numbers (and primitive values starting with numbers) right here.
+    // TODO: Find a better idea how to solve this problem.
+    final TokenKind numberTokenKind = ParserHelper.next(tokenizer,
+        TokenKind.DoubleValue, TokenKind.DecimalValue, TokenKind.GuidValue,
+        TokenKind.DateTimeOffsetValue, TokenKind.DateValue, TokenKind.TimeOfDayValue,
+        TokenKind.IntegerValue);
+    if (numberTokenKind != null) {
+      final EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(numberTokenKind);
+      final EdmPrimitiveType type = primitiveTypeKind == null ?
+          // Null handling
+          null :
+          odata.createPrimitiveTypeInstance(primitiveTypeKind);
+      return new LiteralImpl(tokenizer.getText(), type);
+    }
     Expression left = null;
     TokenKind operatorTokenKind = ParserHelper.next(tokenizer, TokenKind.MINUS, TokenKind.NotOperator);
     // Null for everything other than - or NOT
@@ -279,13 +342,11 @@ public class ExpressionParser {
     return left;
   }
 
-  private Expression parseExprPrimary() throws UriParserException {
+  private Expression parseExprPrimary() throws UriParserException, UriValidationException {
     final Expression left = parseExprValue();
     if (isEnumType(left) && tokenizer.next(TokenKind.HasOperator)) {
       ParserHelper.requireNext(tokenizer, TokenKind.EnumValue);
-      final String primitiveValueLiteral = tokenizer.getText();
-      final Expression right = new LiteralImpl(primitiveValueLiteral, getEnumType(primitiveValueLiteral));
-      checkEnumLiteral(right);
+      final Expression right = createEnumExpression(tokenizer.getText());
       return new BinaryImpl(left, BinaryOperatorKind.HAS, right,
           odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean));
     } else {
@@ -293,7 +354,7 @@ public class ExpressionParser {
     }
   }
 
-  private Expression parseExprValue() throws UriParserException {
+  private Expression parseExprValue() throws UriParserException, UriValidationException {
     if (tokenizer.next(TokenKind.OPEN)) {
       final Expression expression = parseExpression();
       ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
@@ -310,51 +371,49 @@ public class ExpressionParser {
     }
 
     if (tokenizer.next(TokenKind.ROOT)) {
-      // TODO: Consume $root expression.
+      return parseFirstMemberExpr(TokenKind.ROOT);
     }
 
     if (tokenizer.next(TokenKind.IT)) {
-      // TODO: Consume $it expression.
+      return parseFirstMemberExpr(TokenKind.IT);
     }
 
-    TokenKind nextPrimitive = ParserHelper.nextPrimitive(tokenizer);
+    final TokenKind nextPrimitive = ParserHelper.nextPrimitiveValue(tokenizer);
     if (nextPrimitive != null) {
       final String primitiveValueLiteral = tokenizer.getText();
-      final EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(nextPrimitive);
-      EdmPrimitiveType type;
-      if (primitiveTypeKind == null) {
-        if (nextPrimitive == TokenKind.EnumValue) {
-          type = getEnumType(primitiveValueLiteral);
-        } else {
-          // Null handling
-          type = null;
-        }
+      if (nextPrimitive == TokenKind.EnumValue) {
+        return createEnumExpression(primitiveValueLiteral);
       } else {
-        type = odata.createPrimitiveTypeInstance(primitiveTypeKind);
+        final EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(nextPrimitive);
+        final EdmPrimitiveType type = primitiveTypeKind == null ?
+            // Null handling
+            null :
+            odata.createPrimitiveTypeInstance(primitiveTypeKind);
+        return new LiteralImpl(primitiveValueLiteral, type);
       }
-      return new LiteralImpl(primitiveValueLiteral, type);
     }
 
     // The method token text includes the opening parenthesis so that method calls can be recognized unambiguously.
     // OData identifiers have to be considered after that.
-    TokenKind nextMethod = nextMethod();
+    final TokenKind nextMethod = nextMethod();
     if (nextMethod != null) {
       MethodKind methodKind = tokenToMethod.get(nextMethod);
       return new MethodImpl(methodKind, parseMethodParameters(methodKind));
     }
 
     if (tokenizer.next(TokenKind.QualifiedName)) {
-      // TODO: Consume typecast or bound-function expression.
+      return parseFirstMemberExpr(TokenKind.QualifiedName);
     }
 
     if (tokenizer.next(TokenKind.ODataIdentifier)) {
-      // TODO: Consume property-path or lambda-variable expression.
+      return parseFirstMemberExpr(TokenKind.ODataIdentifier);
     }
 
-    throw new UriParserSyntaxException("Unexpected token", UriParserSyntaxException.MessageKeys.SYNTAX);
+    throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
   }
 
-  private List<Expression> parseMethodParameters(final MethodKind methodKind) throws UriParserException {
+  private List<Expression> parseMethodParameters(final MethodKind methodKind)
+      throws UriParserException, UriValidationException {
     List<Expression> parameters = new ArrayList<Expression>();
     switch (methodKind) {
     // Must have no parameter.
@@ -477,6 +536,411 @@ public class ExpressionParser {
     return parameters;
   }
 
+  private Expression parseFirstMemberExpr(final TokenKind lastTokenKind)
+      throws UriParserException, UriValidationException {
+
+    final UriInfoImpl uriInfo = new UriInfoImpl();
+    EdmType startTypeFilter = null;
+
+    if (lastTokenKind == TokenKind.ROOT) {
+      parseDollarRoot(uriInfo);
+    } else if (lastTokenKind == TokenKind.IT) {
+      parseDollarIt(uriInfo);
+    } else if (lastTokenKind == TokenKind.ODataIdentifier) {
+      parseFirstMemberODataIdentifier(uriInfo);
+    } else if (lastTokenKind == TokenKind.QualifiedName) {
+      // Special handling for leading type casts and type literals
+      final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
+      EdmStructuredType structuredType = edm.getEntityType(fullQualifiedName);
+      if (structuredType == null) {
+        structuredType = edm.getComplexType(fullQualifiedName);
+      }
+
+      if (structuredType != null) {
+        if (tokenizer.next(TokenKind.SLASH)) {
+          // Leading type cast
+          checkStructuredTypeFilter(referringType, structuredType);
+          startTypeFilter = structuredType;
+
+          final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
+          parseMemberExpression(tokenKind, uriInfo, new UriResourceStartingTypeFilterImpl(structuredType, false),
+              false);
+        } else {
+          // Type literal
+          checkStructuredTypeFilter(referringType, structuredType);
+          return new TypeLiteralImpl(structuredType);
+        }
+      } else {
+        // Must be bound or unbound function. // TODO: Is unbound function allowed?
+        parseFunction(fullQualifiedName, uriInfo, referringType, true);
+      }
+    }
+
+    return new MemberImpl(uriInfo, startTypeFilter);
+  }
+
+  private void parseDollarRoot(UriInfoImpl uriInfo) throws UriParserException, UriValidationException {
+    UriResourceRootImpl rootResource = new UriResourceRootImpl(referringType, true);
+    uriInfo.addResourcePart(rootResource);
+    ParserHelper.requireNext(tokenizer, TokenKind.SLASH);
+    ParserHelper.requireNext(tokenizer, TokenKind.ODataIdentifier);
+    final String name = tokenizer.getText();
+    UriResourcePartTyped resource = null;
+    final EdmEntitySet entitySet = edm.getEntityContainer().getEntitySet(name);
+    if (entitySet == null) {
+      final EdmSingleton singleton = edm.getEntityContainer().getSingleton(name);
+      if (singleton == null) {
+        throw new UriParserSemanticException("EntitySet or singleton expected.",
+            UriParserSemanticException.MessageKeys.UNKNOWN_PART, name);
+      } else {
+        resource = new UriResourceSingletonImpl(singleton);
+      }
+    } else {
+      ParserHelper.requireNext(tokenizer, TokenKind.OPEN);
+      final List<UriParameter> keyPredicates =
+          ParserHelper.parseKeyPredicate(tokenizer, entitySet.getEntityType(), null);
+      resource = new UriResourceEntitySetImpl(entitySet).setKeyPredicates(keyPredicates);
+    }
+    uriInfo.addResourcePart(resource);
+    parseSingleNavigationExpr(uriInfo, resource);
+  }
+
+  private void parseDollarIt(UriInfoImpl uriInfo) throws UriParserException, UriValidationException {
+    UriResourceItImpl itResource = new UriResourceItImpl(referringType,
+        referringType instanceof EdmEntityType); // TODO: Determine isCollection.
+    uriInfo.addResourcePart(itResource);
+    if (tokenizer.next(TokenKind.SLASH)) {
+      final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
+      parseMemberExpression(tokenKind, uriInfo, itResource, true);
+    }
+  }
+
+  private void parseFirstMemberODataIdentifier(UriInfoImpl uriInfo) throws UriParserException, UriValidationException {
+    final String name = tokenizer.getText();
+
+    // For a crossjoin, the identifier must be an entity-set name.
+    if (crossjoinEntitySetNames != null && !crossjoinEntitySetNames.isEmpty()) {
+      if (crossjoinEntitySetNames.contains(name)) {
+        final UriResourceEntitySetImpl resource =
+            new UriResourceEntitySetImpl(edm.getEntityContainer().getEntitySet(name));
+        uriInfo.addResourcePart(resource);
+        if (tokenizer.next(TokenKind.SLASH)) {
+          final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
+          parseMemberExpression(tokenKind, uriInfo, resource, true);
+        }
+        return;
+      } else {
+        throw new UriParserSemanticException("Unknown crossjoin entity set.",
+            UriParserSemanticException.MessageKeys.UNKNOWN_PART, name);
+      }
+    }
+
+    // Check if the OData identifier is a lambda variable, otherwise it must be a property.
+    UriResourceLambdaVariable lambdaVariable = null;
+    for (final UriResourceLambdaVariable variable : lambdaVariables) {
+      if (variable.getVariableName().equals(name)) {
+        lambdaVariable = variable;
+        break;
+      }
+    }
+    if (lambdaVariable != null) {
+      // Copy lambda variable into new resource, just in case ...
+      final UriResourceLambdaVariable lambdaResource =
+          new UriResourceLambdaVarImpl(lambdaVariable.getVariableName(), lambdaVariable.getType());
+      uriInfo.addResourcePart(lambdaResource);
+      if (tokenizer.next(TokenKind.SLASH)) {
+        final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
+        parseMemberExpression(tokenKind, uriInfo, lambdaResource, true);
+      }
+    } else {
+      // Must be a property.
+      parseMemberExpression(TokenKind.ODataIdentifier, uriInfo, null, true); // TODO: Find last resource.
+    }
+  }
+
+  private void parseMemberExpression(final TokenKind lastTokenKind, UriInfoImpl uriInfo,
+      final UriResourcePartTyped lastResource, final boolean allowTypeFilter)
+          throws UriParserException, UriValidationException {
+
+    if (lastTokenKind == TokenKind.QualifiedName) {
+      // Type cast or bound function
+      final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
+      final EdmEntityType edmEntityType = edm.getEntityType(fullQualifiedName);
+
+      if (edmEntityType != null) {
+        if (allowTypeFilter) {
+          setTypeFilter(lastResource, edmEntityType);
+        } else {
+          throw new UriParserSemanticException("Type filters are not chainable.",
+              UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE,
+              lastResource.getType().getFullQualifiedName().getFullQualifiedNameAsString(),
+              fullQualifiedName.getFullQualifiedNameAsString());
+        }
+      } else {
+        parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
+      }
+    } else if (lastTokenKind == TokenKind.ODataIdentifier) {
+      parsePropertyPathExpr(uriInfo, lastResource);
+    } else {
+      throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
+    }
+  }
+
+  private void setTypeFilter(UriResourcePartTyped lastResource, final EdmEntityType entityTypeFilter)
+      throws UriParserException {
+    checkStructuredTypeFilter(lastResource.getType(), entityTypeFilter);
+    if (lastResource instanceof UriResourceTypedImpl) {
+      ((UriResourceTypedImpl) lastResource).setTypeFilter(entityTypeFilter);
+    } else if (lastResource instanceof UriResourceWithKeysImpl) {
+      ((UriResourceWithKeysImpl) lastResource).setEntryTypeFilter(entityTypeFilter);
+    }
+  }
+
+  private void parsePropertyPathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+
+    final String oDataIdentifier = tokenizer.getText();
+
+    final EdmType lastType = lastResource == null ? referringType : ParserHelper.getTypeInformation(lastResource);
+    if (!(lastType instanceof EdmStructuredType)) {
+      throw new UriParserSemanticException("Property paths must follow a structured type.",
+          UriParserSemanticException.MessageKeys.ONLY_FOR_STRUCTURAL_TYPES, oDataIdentifier);
+    }
+
+    final EdmStructuredType structuredType = (EdmStructuredType) lastType;
+    final EdmElement property = structuredType.getProperty(oDataIdentifier);
+
+    if (property == null) {
+      throw new UriParserSemanticException("Unknown property.",
+          UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE, oDataIdentifier);
+    }
+
+    if (property.getType() instanceof EdmComplexType) {
+      final UriResourceComplexPropertyImpl complexResource =
+          new UriResourceComplexPropertyImpl((EdmProperty) property);
+      uriInfo.addResourcePart(complexResource);
+
+      if (property.isCollection()) {
+        parseCollectionPathExpr(uriInfo, complexResource);
+      } else {
+        parseComplexPathExpr(uriInfo, complexResource);
+      }
+    } else if (property instanceof EdmNavigationProperty) {
+      // Nav. property; maybe a collection
+      final UriResourceNavigationPropertyImpl navigationResource =
+          new UriResourceNavigationPropertyImpl((EdmNavigationProperty) property);
+      navigationResource.setKeyPredicates(
+          ParserHelper.parseNavigationKeyPredicate(tokenizer, (EdmNavigationProperty) property));
+      uriInfo.addResourcePart(navigationResource);
+
+      if (navigationResource.isCollection()) {
+        parseCollectionNavigationExpr(uriInfo, navigationResource);
+      } else {
+        parseSingleNavigationExpr(uriInfo, navigationResource);
+      }
+    } else {
+      // Primitive type or Enum type
+      final UriResourcePrimitivePropertyImpl primitiveResource =
+          new UriResourcePrimitivePropertyImpl((EdmProperty) property);
+      uriInfo.addResourcePart(primitiveResource);
+
+      if (property.isCollection()) {
+        parseCollectionPathExpr(uriInfo, primitiveResource);
+      } else {
+        parseSinglePathExpr(uriInfo, primitiveResource);
+      }
+    }
+  }
+
+  private void parseSingleNavigationExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+    // TODO: Is that correct?
+    if (tokenizer.next(TokenKind.SLASH)) {
+      final TokenKind tokenKind = ParserHelper.next(tokenizer, TokenKind.QualifiedName, TokenKind.ODataIdentifier);
+      parseMemberExpression(tokenKind, uriInfo, lastResource, true);
+    }
+  }
+
+  private void parseCollectionNavigationExpr(UriInfoImpl uriInfo, UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+    // TODO: Is type cast missing?
+    if (tokenizer.next(TokenKind.OPEN)) {
+      if (lastResource instanceof UriResourceNavigation) {
+        ((UriResourceNavigationPropertyImpl) lastResource).setKeyPredicates(
+              ParserHelper.parseNavigationKeyPredicate(tokenizer,
+                  ((UriResourceNavigationPropertyImpl) lastResource).getProperty()));
+      } else if (lastResource instanceof UriResourceFunction
+          && ((UriResourceFunction) lastResource).getType() instanceof EdmEntityType) {
+        ((UriResourceFunctionImpl) lastResource).setKeyPredicates(
+            ParserHelper.parseKeyPredicate(tokenizer,
+                (EdmEntityType) ((UriResourceFunction) lastResource).getType(),
+                null));
+      } else {
+        throw new UriParserSemanticException("Unknown or wrong resource type.",
+            UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED, lastResource.toString());
+      }
+      parseSingleNavigationExpr(uriInfo, lastResource);
+    }
+    parseCollectionPathExpr(uriInfo, lastResource);
+  }
+
+  private void parseSinglePathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+    if (tokenizer.next(TokenKind.SLASH)) {
+      ParserHelper.requireNext(tokenizer, TokenKind.QualifiedName);
+      parseBoundFunction(new FullQualifiedName(tokenizer.getText()), uriInfo, lastResource);
+    }
+  }
+
+  private void parseComplexPathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+
+    if (tokenizer.next(TokenKind.SLASH)) {
+      if (tokenizer.next(TokenKind.QualifiedName)) {
+        final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
+        final EdmEntityType edmEntityType = edm.getEntityType(fullQualifiedName);
+
+        if (edmEntityType != null) {
+          setTypeFilter(lastResource, edmEntityType);
+          if (tokenizer.next(TokenKind.SLASH)) {
+            parseComplexPathRestExpr(uriInfo, lastResource);
+          }
+        } else {
+          // Must be a bound function.
+          parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
+        }
+      } else {
+        parseComplexPathRestExpr(uriInfo, lastResource);
+      }
+    }
+  }
+
+  private void parseComplexPathRestExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+    if (tokenizer.next(TokenKind.QualifiedName)) {
+      final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
+      // Must be a bound function.
+      parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
+    } else if (tokenizer.next(TokenKind.ODataIdentifier)) {
+      parsePropertyPathExpr(uriInfo, lastResource);
+    } else {
+      throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
+    }
+  }
+
+  private void parseCollectionPathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+
+    if (tokenizer.next(TokenKind.SLASH)) {
+      if (tokenizer.next(TokenKind.COUNT)) {
+        uriInfo.addResourcePart(new UriResourceCountImpl());
+      } else if (tokenizer.next(TokenKind.ANY)) {
+        uriInfo.addResourcePart(parseLambdaRest(TokenKind.ANY, lastResource));
+      } else if (tokenizer.next(TokenKind.ALL)) {
+        uriInfo.addResourcePart(parseLambdaRest(TokenKind.ALL, lastResource));
+      } else if (tokenizer.next(TokenKind.QualifiedName)) {
+        final FullQualifiedName fullQualifiedName = new FullQualifiedName(tokenizer.getText());
+        parseBoundFunction(fullQualifiedName, uriInfo, lastResource);
+      }
+    }
+  }
+
+  private void parseFunction(final FullQualifiedName fullQualifiedName, UriInfoImpl uriInfo,
+      final EdmType lastType, final boolean lastIsCollection) throws UriParserException, UriValidationException {
+
+    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, true);
+    final List<String> parameterNames = ParserHelper.getParameterNames(parameters);
+    final EdmFunction boundFunction = edm.getBoundFunction(fullQualifiedName,
+        lastType.getFullQualifiedName(), lastIsCollection, parameterNames);
+
+    if (boundFunction != null) {
+      parseFunctionRest(uriInfo, boundFunction, parameters);
+      return;
+    }
+
+    final EdmFunction unboundFunction = edm.getUnboundFunction(fullQualifiedName, parameterNames);
+    if (unboundFunction != null) {
+      parseFunctionRest(uriInfo, unboundFunction, parameters);
+      return;
+    }
+
+    throw new UriParserSemanticException("No function found.",
+        UriParserSemanticException.MessageKeys.FUNCTION_NOT_FOUND, fullQualifiedName.getFullQualifiedNameAsString());
+  }
+
+  private void parseBoundFunction(final FullQualifiedName fullQualifiedName, UriInfoImpl uriInfo,
+      final UriResourcePartTyped lastResource) throws UriParserException, UriValidationException {
+    final List<UriParameter> parameters = ParserHelper.parseFunctionParameters(tokenizer, true);
+    final List<String> parameterNames = ParserHelper.getParameterNames(parameters);
+    final EdmFunction boundFunction = edm.getBoundFunction(fullQualifiedName,
+        lastResource.getType().getFullQualifiedName(), lastResource.isCollection(), parameterNames);
+    if (boundFunction == null) {
+      throw new UriParserSemanticException("Bound function not found.",
+          UriParserSemanticException.MessageKeys.FUNCTION_NOT_FOUND, fullQualifiedName.getFullQualifiedNameAsString());
+    }
+    parseFunctionRest(uriInfo, boundFunction, parameters);
+  }
+
+  private void parseFunctionRest(UriInfoImpl uriInfo, final EdmFunction function,
+      final List<UriParameter> parameters) throws UriParserException, UriValidationException {
+    final UriResourceFunction functionResource = new UriResourceFunctionImpl(null, function, parameters);
+    uriInfo.addResourcePart(functionResource);
+
+    final EdmReturnType edmReturnType = function.getReturnType();
+    final EdmType edmType = edmReturnType.getType();
+    final boolean isCollection = edmReturnType.isCollection();
+
+    if (function.isComposable()) {
+      if (edmType instanceof EdmEntityType ) {
+        if (isCollection) {
+          parseCollectionNavigationExpr(uriInfo, null); // TODO: Get navigation property.
+        } else {
+          parseSingleNavigationExpr(uriInfo, null); // TODO: Get navigation property.
+        }
+      } else if (edmType instanceof EdmComplexType) {
+        if (isCollection) {
+          parseCollectionPathExpr(uriInfo, functionResource);
+        } else {
+          parseComplexPathExpr(uriInfo, functionResource);
+        }
+      } else if (edmType instanceof EdmPrimitiveType) {
+        if (isCollection) {
+          parseCollectionPathExpr(uriInfo, functionResource);
+        } else {
+          parseSinglePathExpr(uriInfo, functionResource);
+        }
+      }
+    } else if (tokenizer.next(TokenKind.SLASH)) {
+      throw new UriValidationException("Function is not composable.",
+          UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH, "");
+    }
+  }
+
+  private UriResourcePartTyped parseLambdaRest(final TokenKind lastTokenKind, final UriResourcePartTyped lastResource)
+      throws UriParserException, UriValidationException {
+
+    ParserHelper.requireNext(tokenizer, TokenKind.OPEN);
+    if (lastTokenKind == TokenKind.ANY && tokenizer.next(TokenKind.CLOSE)) {
+      return new UriResourceLambdaAnyImpl(null, null);
+    }
+    ParserHelper.requireNext(tokenizer, TokenKind.ODataIdentifier);
+    final String lambbdaVariable = tokenizer.getText();
+    ParserHelper.requireNext(tokenizer, TokenKind.COLON);
+    lambdaVariables.addFirst(new UriResourceLambdaVarImpl(lambbdaVariable,
+        lastResource == null ? referringType : lastResource.getType()));
+    final Expression lambdaPredicateExpr = parseExpression();
+    lambdaVariables.removeFirst();
+    // TODO: The ABNF suggests that the "lambaPredicateExpr" must contain at least one lambdaVariable.
+    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
+    if (lastTokenKind == TokenKind.ALL) {
+      return new UriResourceLambdaAllImpl(lambbdaVariable, lambdaPredicateExpr);
+    } else if (lastTokenKind == TokenKind.ANY) {
+      return new UriResourceLambdaAnyImpl(lambbdaVariable, lambdaPredicateExpr);
+    } else {
+      throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX);
+    }
+  }
+
   private TokenKind nextMethod() {
     return ParserHelper.next(tokenizer,
         TokenKind.CeilingMethod,
@@ -580,9 +1044,9 @@ public class ExpressionParser {
     }
   }
 
-  private EdmPrimitiveType getEnumType(final String primitiveValueLiteral) throws UriParserException {
+  private EdmEnumType getEnumType(final String primitiveValueLiteral) throws UriParserException {
     final String enumTypeName = primitiveValueLiteral.substring(0, primitiveValueLiteral.indexOf('\''));
-    final EdmPrimitiveType type = edm.getEnumType(new FullQualifiedName(enumTypeName));
+    final EdmEnumType type = edm.getEnumType(new FullQualifiedName(enumTypeName));
     if (type == null) {
       throw new UriParserSemanticException("Unknown Enum type '" + enumTypeName + "'.",
           UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, enumTypeName);
@@ -599,13 +1063,16 @@ public class ExpressionParser {
             EdmPrimitiveTypeKind.Byte, EdmPrimitiveTypeKind.SByte);
   }
 
-  private void checkEnumLiteral(final Expression expression) throws UriParserException {
-    if (expression == null
-        || !(expression instanceof Literal)
-        || ((Literal) expression).getType() == null
-        || ((Literal) expression).getType().getKind() != EdmTypeKind.ENUM) {
-      throw new UriParserSemanticException("Enum literal expected.",
-          UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, ""); // TODO: better message
+  private Enumeration createEnumExpression(final String primitiveValueLiteral) throws UriParserException {
+    final EdmEnumType enumType = getEnumType(primitiveValueLiteral);
+    // TODO: Can the Enumeration interface be changed to handle the value as a whole?
+    try {
+      return new EnumerationImpl(enumType,
+          Arrays.asList(enumType.fromUriLiteral(primitiveValueLiteral).split(",")));
+    } catch (final EdmPrimitiveTypeException e) {
+      // TODO: Better error message.
+      throw new UriParserSemanticException("Wrong enumeration value.", e,
+          UriParserSemanticException.MessageKeys.UNKNOWN_PART, primitiveValueLiteral);
     }
   }
 
@@ -664,4 +1131,13 @@ public class ExpressionParser {
     throw new UriParserSemanticException("Incompatible types.",
         UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, ""); // TODO: better message
   }
+
+  private void checkStructuredTypeFilter(final EdmType type, final EdmStructuredType filterType)
+      throws UriParserException {
+    if (!filterType.compatibleTo(type)) {
+      throw new UriParserSemanticException("Incompatible type filter.",
+          UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER,
+          filterType.getFullQualifiedName().getFullQualifiedNameAsString());
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
new file mode 100644
index 0000000..a3376e0
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/FilterParser.java
@@ -0,0 +1,49 @@
+/*
+ * 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.core.uri.parser;
+
+import java.util.Collection;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.uri.queryoption.FilterOption;
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
+
+public class FilterParser {
+
+  private final Edm edm;
+  private final OData odata;
+
+  public FilterParser(final Edm edm, final OData odata) {
+    this.edm = edm;
+    this.odata = odata;
+  }
+
+  public FilterOption parse(UriTokenizer tokenizer, final EdmStructuredType referencedType,
+      final Collection<String> crossjoinEntitySetNames)
+      throws UriParserException, UriValidationException {
+    final Expression filterExpression = new ExpressionParser(edm, odata)
+        .parse(tokenizer, referencedType, crossjoinEntitySetNames);
+    // TODO: Check that the expression is boolean.
+    return new FilterOptionImpl().setExpression(filterExpression);
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a8091658/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/OrderByParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/OrderByParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/OrderByParser.java
new file mode 100644
index 0000000..5ea8cb7
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/OrderByParser.java
@@ -0,0 +1,61 @@
+/*
+ * 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.core.uri.parser;
+
+import java.util.Collection;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.uri.queryoption.OrderByOption;
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
+import org.apache.olingo.server.core.uri.queryoption.OrderByItemImpl;
+import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
+
+public class OrderByParser {
+
+  private final Edm edm;
+  private final OData odata;
+
+  public OrderByParser(final Edm edm, final OData odata) {
+    this.edm = edm;
+    this.odata = odata;
+  }
+
+  public OrderByOption parse(UriTokenizer tokenizer, final EdmStructuredType referencedType,
+      final Collection<String> crossjoinEntitySetNames)
+      throws UriParserException, UriValidationException {
+    OrderByOptionImpl orderByOption = new OrderByOptionImpl();
+    do {
+      final Expression orderByExpression = new ExpressionParser(edm, odata)
+          .parse(tokenizer, referencedType, crossjoinEntitySetNames);
+      OrderByItemImpl item = new OrderByItemImpl();
+      item.setExpression(orderByExpression);
+      if (tokenizer.next(TokenKind.AscSuffix)) {
+        item.setDescending(false);
+      } else if (tokenizer.next(TokenKind.DescSuffix)) {
+        item.setDescending(true);
+      }
+      orderByOption.addOrder(item);
+    } while (tokenizer.next(TokenKind.COMMA));
+    return orderByOption;
+  }
+}


[20/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] $expand parser in Java + clean-up

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
index f505a21..3b673a6 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
@@ -40,6 +40,15 @@ public class UriTokenizer {
     ROOT,
     IT,
 
+    EXPAND,
+    FILTER,
+    LEVELS,
+    ORDERBY,
+    SEARCH,
+    SELECT,
+    SKIP,
+    TOP,
+
     ANY,
     ALL,
 
@@ -53,8 +62,9 @@ public class UriTokenizer {
     EQ,
     STAR,
     PLUS,
-    MINUS,
+
     NULL,
+    MAX,
 
     // variable-value tokens (convention: mixed case)
     ODataIdentifier,
@@ -76,6 +86,13 @@ public class UriTokenizer {
 
     jsonArrayOrObject,
 
+    Word,
+    Phrase,
+
+    OrOperatorSearch,
+    AndOperatorSearch,
+    NotOperatorSearch,
+
     OrOperator,
     AndOperator,
     EqualsOperator,
@@ -90,6 +107,7 @@ public class UriTokenizer {
     MulOperator,
     DivOperator,
     ModOperator,
+    MinusOperator,
     NotOperator,
 
     CastMethod,
@@ -161,6 +179,10 @@ public class UriTokenizer {
     boolean found = false;
     final int previousIndex = index;
     switch (allowedTokenKind) {
+    case EOF:
+      found = index >= parseString.length();
+      break;
+
     // Constants
     case REF:
       found = nextConstant("$ref");
@@ -181,6 +203,31 @@ public class UriTokenizer {
       found = nextConstant("$it");
       break;
 
+    case EXPAND:
+      found = nextConstant("$expand");
+      break;
+    case FILTER:
+      found = nextConstant("$filter");
+      break;
+    case LEVELS:
+      found = nextConstant("$levels");
+      break;
+    case ORDERBY:
+      found = nextConstant("$orderby");
+      break;
+    case SEARCH:
+      found = nextConstant("$search");
+      break;
+    case SELECT:
+      found = nextConstant("$select");
+      break;
+    case SKIP:
+      found = nextConstant("$skip");
+      break;
+    case TOP:
+      found = nextConstant("$top");
+      break;
+
     case ANY:
       found = nextConstant("any");
       break;
@@ -218,14 +265,12 @@ public class UriTokenizer {
     case PLUS:
       found = nextCharacter('+');
       break;
-    case MINUS:
-      found = nextMinus();
-      break;
+
     case NULL:
       found = nextConstant("null");
       break;
-    case EOF:
-      found = index >= parseString.length();
+    case MAX:
+      found = nextConstant("max");
       break;
 
     // Identifiers
@@ -282,6 +327,25 @@ public class UriTokenizer {
       found = nextJsonArrayOrObject();
       break;
 
+    // Search
+    case Word:
+      found = nextWord();
+      break;
+    case Phrase:
+      found = nextPhrase();
+      break;
+
+    // Operators in Search Expressions
+    case OrOperatorSearch:
+      found = nextBinaryOperator("OR");
+      break;
+    case AndOperatorSearch:
+      found = nextAndOperatorSearch();
+      break;
+    case NotOperatorSearch:
+      found = nextUnaryOperator("NOT");
+      break;
+
     // Operators
     case OrOperator:
       found = nextBinaryOperator("or");
@@ -325,8 +389,12 @@ public class UriTokenizer {
     case ModOperator:
       found = nextBinaryOperator("mod");
       break;
+    case MinusOperator:
+      // To avoid unnecessary minus operators for negative numbers, we have to check what follows the minus sign.
+      found = nextCharacter('-') && !nextDigit() && !nextConstant("INF");
+      break;
     case NotOperator:
-      found = nextConstant("not") && nextWhitespace();
+      found = nextUnaryOperator("not");
       break;
 
     // Methods
@@ -444,27 +512,6 @@ public class UriTokenizer {
     return found;
   }
 
-  private boolean nextMinus() {
-    if(parseString.startsWith("-", index)) {
-      final int lastGoodIndex = index;
-      
-      if(nextDoubleValue()) {
-        index = lastGoodIndex;
-        return false;
-      } else if(nextDecimalValue()) {
-        index = lastGoodIndex;
-        return false;
-      } else if(nextIntegerValue(true)) {
-        index = lastGoodIndex;
-        return false;
-      } else {
-        index++;
-        return true;
-      }
-    }
-    return false;
-  }
-
   /**
    * Moves past the given string constant if found; otherwise leaves the index unchanged.
    * @return whether the constant has been found at the current index
@@ -569,34 +616,6 @@ public class UriTokenizer {
     }
     return count > 0;
   }
-
-  /**
-   * Moves past the given whitespace-surrounded operator constant if found;
-   * otherwise leaves the index unchanged.
-   * @return whether the operator has been found at the current index
-   */
-  private boolean nextBinaryOperator(final String operator) {
-    return nextWhitespace() && nextConstant(operator) && nextWhitespace();
-  }
-
-  /**
-   * Moves past the given method name and its immediately following opening parenthesis if found;
-   * otherwise leaves the index unchanged.
-   * @return whether the method has been found at the current index
-   */
-  private boolean nextMethod(final String methodName) {
-    return nextConstant(methodName) && nextCharacter('(');
-  }
-
-  /**
-   * Moves past (required) whitespace and the given suffix name if found;
-   * otherwise leaves the index unchanged.
-   * @return whether the suffix has been found at the current index
-   */
-  private boolean nextSuffix(final String suffixName) {
-    return nextWhitespace() && nextConstant(suffixName);
-  }
-
   /**
    * Moves past an OData identifier if found; otherwise leaves the index unchanged.
    * @return whether an OData identifier has been found at the current index
@@ -650,6 +669,38 @@ public class UriTokenizer {
     }
   }
 
+  /**
+   * Moves past the given whitespace-surrounded operator constant if found.
+   * @return whether the operator has been found at the current index
+   */
+  private boolean nextBinaryOperator(final String operator) {
+    return nextWhitespace() && nextConstant(operator) && nextWhitespace();
+  }
+
+  /**
+   * Moves past the given whitespace-suffixed operator constant if found.
+   * @return whether the operator has been found at the current index
+   */
+  private boolean nextUnaryOperator(final String operator) {
+    return nextConstant(operator) && nextWhitespace();
+  }
+
+  /**
+   * Moves past the given method name and its immediately following opening parenthesis if found.
+   * @return whether the method has been found at the current index
+   */
+  private boolean nextMethod(final String methodName) {
+    return nextConstant(methodName) && nextCharacter('(');
+  }
+
+  /**
+   * Moves past (required) whitespace and the given suffix name if found.
+   * @return whether the suffix has been found at the current index
+   */
+  private boolean nextSuffix(final String suffixName) {
+    return nextWhitespace() && nextConstant(suffixName);
+  }
+
   private boolean nextParameterAliasName() {
     return nextCharacter('@') && nextODataIdentifier();
   }
@@ -978,4 +1029,52 @@ public class UriTokenizer {
       return false;
     }
   }
+
+  private boolean nextAndOperatorSearch() {
+    if (nextWhitespace()) {
+      final int lastGoodIndex = index;
+      if (nextUnaryOperator("OR")) {
+        return false;
+      } else if (!(nextUnaryOperator("AND"))) {
+        index = lastGoodIndex;
+      }
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  private boolean nextWord() {
+    int count = 0;
+    while (index < parseString.length()) {
+      final int code = parseString.codePointAt(index);
+      if (Character.isUnicodeIdentifierStart(code)) {
+        count++;
+        // Unicode characters outside of the Basic Multilingual Plane are represented as two Java characters.
+        index += Character.isSupplementaryCodePoint(code) ? 2 : 1;
+      } else {
+        break;
+      }
+    }
+    final String word = parseString.substring(index - count, index);
+    return count > 0 && !("OR".equals(word) || "AND".equals(word) || "NOT".equals(word));
+  }
+
+  private boolean nextPhrase() {
+    if (nextCharacter('"')) {
+      do {
+        if (nextCharacter('\\')) {
+          if (!(nextCharacter('\\') || nextCharacter('"'))) {
+            return false;
+          }
+        } else if (nextCharacter('"')) {
+          return true;
+        } else {
+          index++;
+        }
+      } while (index < parseString.length());
+      return false;
+    }
+    return false;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
index c7d7c20..8c8dab9 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/AliasImpl.java
@@ -41,4 +41,8 @@ public class AliasImpl implements Alias {
     return visitor.visitAlias(parameterName);
   }
 
+  @Override
+  public String toString() {
+    return parameterName;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
index 256b8d1..a238104 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/EnumerationImpl.java
@@ -53,4 +53,10 @@ public class EnumerationImpl implements Enumeration {
   public <T> T accept(final ExpressionVisitor<T> visitor) throws ExpressionVisitException, ODataApplicationException {
     return visitor.visitEnum(type, values);
   }
+
+  @Override
+  public String toString() {
+    return type == null ? null :
+      type.getFullQualifiedName().getFullQualifiedNameAsString() + getValues();
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
index 824943a..16232b8 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/LambdaRefImpl.java
@@ -40,4 +40,9 @@ public class LambdaRefImpl implements LambdaRef {
   public <T> T accept(final ExpressionVisitor<T> visitor) throws ExpressionVisitException, ODataApplicationException {
     return visitor.visitLambdaReference(variableText);
   }
+
+  @Override
+  public String toString() {
+    return variableText;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
index 336c203..6a2a1c6 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/TypeLiteralImpl.java
@@ -41,4 +41,9 @@ public class TypeLiteralImpl implements TypeLiteral {
   public <T> T accept(final ExpressionVisitor<T> visitor) throws ExpressionVisitException, ODataApplicationException {
     return visitor.visitTypeLiteral(type);
   }
+
+  @Override
+  public String toString() {
+    return type == null ? null : type.getFullQualifiedName().getFullQualifiedNameAsString();
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties b/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
index 0b43f70..e178fed 100644
--- a/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
+++ b/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
@@ -81,11 +81,11 @@ UriParserSemanticException.COMPLEX_PROPERTY_OF_ENTITY_TYPE_EXPECTED=A complex pr
 UriParserSemanticException.NOT_FOR_ENTITY_TYPE=Not allowed for entity type.
 UriParserSemanticException.PREVIOUS_PART_TYPED=The previous part is typed.
 UriParserSemanticException.RESOURCE_NOT_FOUND=Cannot find EntitySet, Singleton, ActionImport or FunctionImport with name '%1$s'.
-UriParserSemanticException.NOT_IMPLEMENTED=%1$s is not implemented!
-UriParserSemanticException.NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT=Namespace is not allowed for Entity Sets, Singeltons, Action Imports and Function Imports. Found '%1$s'.
-UriParserSemanticException.COMPLEX_PARAMETER_IN_RESOURCE_PATH=Complex parameters must not appear in resource path segments. Found: '%1$s'.
+UriParserSemanticException.NOT_IMPLEMENTED='%1$s' is not implemented!
+UriParserSemanticException.NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT=Namespace is not allowed for Entity Sets, Singletons, Action Imports and Function Imports; found '%1$s'.
+UriParserSemanticException.COMPLEX_PARAMETER_IN_RESOURCE_PATH=Complex parameters must not appear in resource path segments; found: '%1$s'.
 UriParserSemanticException.FUNCTION_IMPORT_NOT_ALLOWED=Function Imports are not allowed in $filter or $orderby. Found: '%1$s'.
-UriParserSemanticException.TYPES_NOT_COMPATIBLE=Types are not compatible. Left type: '%1$s', right type: '%1$s'.
+UriParserSemanticException.TYPES_NOT_COMPATIBLE=The types '%1$s' and '%2$s' are not compatible.
 
 UriValidationException.UNSUPPORTED_QUERY_OPTION=The query option '%1$s' is not supported.
 UriValidationException.UNSUPPORTED_URI_KIND=The URI kind '%1$s' is not supported.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
index 4ab7fce..94d5373 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
@@ -22,9 +22,11 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
 
 import java.util.Locale;
 
+import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
 import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
@@ -260,9 +262,17 @@ public class ExpressionParserTest {
     expression = parseMethod(TokenKind.SubstringMethod, "'abc'", "1");
     assertEquals("{substring ['abc', 1]}", expression.toString());
 
+    assertEquals("{cast [Edm.SByte]}", parseMethod(TokenKind.CastMethod, "Edm.SByte").toString());
+    assertEquals("{cast [42, Edm.SByte]}", parseMethod(TokenKind.CastMethod, "42", "Edm.SByte").toString());
+
+    assertEquals("{isof [Edm.SByte]}", parseMethod(TokenKind.IsofMethod, "Edm.SByte").toString());
+    assertEquals("{isof [42, Edm.SByte]}", parseMethod(TokenKind.IsofMethod, "42", "Edm.SByte").toString());
+
     wrongExpression("substring('abc')");
     wrongExpression("substring('abc',1,2,3)");
     wrongExpression("substring(1,2)");
+    wrongExpression("cast(1,2)");
+    wrongExpression("isof(Edm.Int16,2)");
   }
 
   private Expression parseMethod(TokenKind kind, String... parameters)
@@ -288,7 +298,7 @@ public class ExpressionParserTest {
   private Expression parseExpression(final String expressionString)
       throws UriParserException, UriValidationException {
     UriTokenizer tokenizer = new UriTokenizer(expressionString);
-    Expression expression = new ExpressionParser(null, odata).parse(tokenizer, null, null);
+    Expression expression = new ExpressionParser(mock(Edm.class), odata).parse(tokenizer, null, null);
     assertNotNull(expression);
     assertTrue(tokenizer.next(TokenKind.EOF));
     return expression;
@@ -296,7 +306,7 @@ public class ExpressionParserTest {
 
   private void wrongExpression(final String expressionString) {
     try {
-      new ExpressionParser(null, odata).parse(new UriTokenizer(expressionString), null, null);
+      new ExpressionParser(mock(Edm.class), odata).parse(new UriTokenizer(expressionString), null, null);
       fail("Expected exception not thrown.");
     } catch (final UriParserException e) {
       assertNotNull(e);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
index af45e80..e130457 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
@@ -76,7 +76,7 @@ public class UriTokenizerTest {
     assertTrue(tokenizer.next(TokenKind.STAR));
     assertTrue(tokenizer.next(TokenKind.SLASH));
     assertTrue(tokenizer.next(TokenKind.PLUS));
-    assertTrue(tokenizer.next(TokenKind.MINUS));
+    assertTrue(tokenizer.next(TokenKind.MinusOperator));
     assertTrue(tokenizer.next(TokenKind.EOF));
 
     tokenizer = new UriTokenizer("any(a:true) or all(b:false)");
@@ -97,6 +97,45 @@ public class UriTokenizerTest {
   }
 
   @Test
+  public void systemQueryOptions() {
+    UriTokenizer tokenizer = new UriTokenizer("$expand=*;$filter=true;$levels=max;$orderby=false");
+    assertTrue(tokenizer.next(TokenKind.EXPAND));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.STAR));
+    assertTrue(tokenizer.next(TokenKind.SEMI));
+    assertTrue(tokenizer.next(TokenKind.FILTER));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.BooleanValue));
+    assertTrue(tokenizer.next(TokenKind.SEMI));
+    assertTrue(tokenizer.next(TokenKind.LEVELS));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.MAX));
+    assertTrue(tokenizer.next(TokenKind.SEMI));
+    assertTrue(tokenizer.next(TokenKind.ORDERBY));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.BooleanValue));
+    assertTrue(tokenizer.next(TokenKind.EOF));
+
+    tokenizer = new UriTokenizer("$search=A;$select=*;$skip=1;$top=2");
+    assertTrue(tokenizer.next(TokenKind.SEARCH));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.ODataIdentifier));
+    assertTrue(tokenizer.next(TokenKind.SEMI));
+    assertTrue(tokenizer.next(TokenKind.SELECT));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.STAR));
+    assertTrue(tokenizer.next(TokenKind.SEMI));
+    assertTrue(tokenizer.next(TokenKind.SKIP));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.IntegerValue));
+    assertTrue(tokenizer.next(TokenKind.SEMI));
+    assertTrue(tokenizer.next(TokenKind.TOP));
+    assertTrue(tokenizer.next(TokenKind.EQ));
+    assertTrue(tokenizer.next(TokenKind.IntegerValue));
+    assertTrue(tokenizer.next(TokenKind.EOF));
+  }
+
+  @Test
   public void identifier() {
     assertTrue(new UriTokenizer("name").next(TokenKind.ODataIdentifier));
     assertTrue(new UriTokenizer("_name").next(TokenKind.ODataIdentifier));
@@ -390,11 +429,11 @@ public class UriTokenizerTest {
     assertTrue(tokenizer.next(TokenKind.IntegerValue));
     assertTrue(tokenizer.next(TokenKind.EOF));
 
-    tokenizer = new UriTokenizer("1ne 2");
+    tokenizer = new UriTokenizer("-1ne 2");
     assertTrue(tokenizer.next(TokenKind.IntegerValue));
     assertFalse(tokenizer.next(TokenKind.NotEqualsOperator));
 
-    tokenizer = new UriTokenizer("1 ne2");
+    tokenizer = new UriTokenizer("1 ne-2");
     assertTrue(tokenizer.next(TokenKind.IntegerValue));
     assertFalse(tokenizer.next(TokenKind.NotEqualsOperator));
 
@@ -404,6 +443,11 @@ public class UriTokenizerTest {
     assertTrue(tokenizer.next(TokenKind.IntegerValue));
     assertTrue(tokenizer.next(TokenKind.EOF));
 
+    assertTrue(new UriTokenizer("-x").next(TokenKind.MinusOperator));
+    assertFalse(new UriTokenizer("-1").next(TokenKind.MinusOperator));
+    assertFalse(new UriTokenizer("-INF").next(TokenKind.MinusOperator));
+    assertFalse(new UriTokenizer("+").next(TokenKind.MinusOperator));
+
     assertFalse(new UriTokenizer("nottrue").next(TokenKind.NotOperator));
     assertFalse(new UriTokenizer("no true").next(TokenKind.NotOperator));
 
@@ -484,6 +528,38 @@ public class UriTokenizerTest {
     wrongToken(TokenKind.DescSuffix, " desc", 'D');
   }
 
+  @Test
+  public void search() {
+    UriTokenizer tokenizer = new UriTokenizer("a AND b OR NOT \"c\" d");
+    assertTrue(tokenizer.next(TokenKind.Word));
+    assertTrue(tokenizer.next(TokenKind.AndOperatorSearch));
+    assertTrue(tokenizer.next(TokenKind.Word));
+    assertFalse(tokenizer.next(TokenKind.AndOperatorSearch));
+    assertTrue(tokenizer.next(TokenKind.OrOperatorSearch));
+    assertTrue(tokenizer.next(TokenKind.NotOperatorSearch));
+    assertTrue(tokenizer.next(TokenKind.Phrase));
+    assertTrue(tokenizer.next(TokenKind.AndOperatorSearch));
+    assertTrue(tokenizer.next(TokenKind.Word));
+    assertFalse(tokenizer.next(TokenKind.AndOperatorSearch));
+    assertFalse(tokenizer.next(TokenKind.Word));
+    assertFalse(tokenizer.next(TokenKind.Phrase));
+    assertTrue(tokenizer.next(TokenKind.EOF));
+
+    assertTrue(new UriTokenizer("\"a\\\\x\\\"\"").next(TokenKind.Phrase));
+    assertFalse(new UriTokenizer("\"a\\\"").next(TokenKind.Phrase));
+    assertFalse(new UriTokenizer("\"a\\x\"").next(TokenKind.Phrase));
+    wrongToken(TokenKind.Phrase, "\"a\"", '\\');
+
+    final String outsideBmpLetter = String.valueOf(Character.toChars(0x10330));
+    assertTrue(new UriTokenizer("\"" + outsideBmpLetter + "\"").next(TokenKind.Phrase));
+
+    assertTrue(new UriTokenizer(outsideBmpLetter).next(TokenKind.Word));
+    assertFalse(new UriTokenizer("1").next(TokenKind.Word));
+    assertFalse(new UriTokenizer("AND").next(TokenKind.Word));
+    assertFalse(new UriTokenizer("OR").next(TokenKind.Word));
+    assertFalse(new UriTokenizer("NOT").next(TokenKind.Word));
+  }
+
   private void wrongToken(final TokenKind kind, final String value, final char disturbCharacter) {
     assertFalse(new UriTokenizer(disturbCharacter + value).next(kind));
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
index e028cfe..f3e50a2 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
@@ -35,7 +35,7 @@ public class SearchParserAndTokenizerTest {
     assertQuery("a AND b AND c").resultsIn("{{'a' AND 'b'} AND 'c'}");
     assertQuery("a OR b").resultsIn("{'a' OR 'b'}");
     assertQuery("a OR b OR c").resultsIn("{{'a' OR 'b'} OR 'c'}");
-    
+
     assertQuery("NOT a NOT b").resultsIn("{{NOT 'a'} AND {NOT 'b'}}");
     assertQuery("NOT a AND NOT b").resultsIn("{{NOT 'a'} AND {NOT 'b'}}");
     assertQuery("NOT a OR NOT b").resultsIn("{{NOT 'a'} OR {NOT 'b'}}");
@@ -59,16 +59,16 @@ public class SearchParserAndTokenizerTest {
     assertQuery("a AND (b OR c)").resultsIn("{'a' AND {'b' OR 'c'}}");
     assertQuery("(a OR b) AND NOT c").resultsIn("{{'a' OR 'b'} AND {NOT 'c'}}");
     assertQuery("(a OR B) AND (c OR d AND NOT e OR (f))")
-            .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
+        .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
     assertQuery("(a OR B) (c OR d NOT e OR (f))")
-      .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
+        .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
     assertQuery("((((a))))").resultsIn("'a'");
     assertQuery("((((a)))) ((((a))))").resultsIn("{'a' AND 'a'}");
     assertQuery("((((a)))) OR ((((a))))").resultsIn("{'a' OR 'a'}");
     assertQuery("((((((a)))) ((((c))) OR (((C)))) ((((a))))))").resultsIn("{{'a' AND {'c' OR 'C'}} AND 'a'}");
     assertQuery("((((\"a\")))) OR ((((\"a\"))))").resultsIn("{'a' OR 'a'}");
   }
-  
+
   @Test
   public void parseImplicitAnd() throws Exception {
     assertQuery("a b").resultsIn("{'a' AND 'b'}");
@@ -103,7 +103,7 @@ public class SearchParserAndTokenizerTest {
     assertQuery("((a AND b OR c)").resultsIn(SearchParserException.MessageKeys.MISSING_CLOSE);
     assertQuery("a AND (b OR c").resultsIn(SearchParserException.MessageKeys.MISSING_CLOSE);
     assertQuery("(a AND ((b OR c)").resultsIn(SearchParserException.MessageKeys.MISSING_CLOSE);
-    
+
     assertQuery("NOT NOT a").resultsIn(SearchParserException.MessageKeys.INVALID_NOT_OPERAND);
     assertQuery("NOT (a)").resultsIn(SearchParserException.MessageKeys.TOKENIZER_EXCEPTION);
   }
@@ -186,7 +186,6 @@ public class SearchParserAndTokenizerTest {
     //    <Input>http://serviceRoot/Products?$search=blue</Input>
     assertQuery("blue").resultsIn("'blue'");
 
-
     // below cases can not be tested here
     //    <TestCase Name="5.1.7 Search - on entity container" Rule="odataUri">
     //    <Input>http://serviceRoot/Model.Container/$all?$search=blue</Input>
@@ -194,68 +193,47 @@ public class SearchParserAndTokenizerTest {
     //    <Input>http://serviceRoot/$all?$search=blue</Input>
   }
 
-
   private static Validator assertQuery(String searchQuery) {
-    return Validator.init(searchQuery);
+    return new Validator(searchQuery);
   }
 
   private static class Validator {
-    private boolean log;
     private final String searchQuery;
 
     private Validator(String searchQuery) {
       this.searchQuery = searchQuery;
     }
 
-    private static Validator init(String searchQuery) {
-      return new Validator(searchQuery);
-    }
-
-    @SuppressWarnings("unused")
-    private Validator withLogging() {
-      log = true;
-      return this;
-    }
-
-    private void resultsIn(SearchParserException.MessageKey key)
-            throws SearchTokenizerException {
+    private void resultsIn(SearchParserException.MessageKey key) throws SearchTokenizerException {
       try {
         resultsIn(searchQuery);
       } catch (SearchParserException e) {
         Assert.assertEquals("SearchParserException with unexpected message '" + e.getMessage() +
             "' was thrown.", key, e.getMessageKey());
-        if(log) {
-          System.out.println("Caught SearchParserException with message key " +
-              e.getMessageKey() + " and message " + e.getMessage());
-        }
         return;
       }
       Assert.fail("SearchParserException with message key " + key.getKey() + " was not thrown.");
     }
-    
+
     public void resultsInExpectedTerm(final String actualToken) throws SearchTokenizerException {
       try {
         resultsIn(searchQuery);
-      } catch(SearchParserException e) {
+      } catch (SearchParserException e) {
         Assert.assertEquals(SearchParserException.MessageKeys.EXPECTED_DIFFERENT_TOKEN, e.getMessageKey());
         Assert.assertEquals("Expected PHRASE||WORD found: " + actualToken, e.getMessage());
       }
     }
-    
+
     private void resultsIn(String expectedSearchExpression) throws SearchTokenizerException, SearchParserException {
       final SearchExpression searchExpression = getSearchExpression();
       Assert.assertEquals(expectedSearchExpression, searchExpression.toString());
     }
 
     private SearchExpression getSearchExpression() throws SearchParserException, SearchTokenizerException {
-      SearchParser tokenizer = new SearchParser();
-      SearchOption result = tokenizer.parse(searchQuery);
+      SearchOption result = new SearchParser().parse(searchQuery);
       Assert.assertNotNull(result);
       final SearchExpression searchExpression = result.getSearchExpression();
       Assert.assertNotNull(searchExpression);
-      if (log) {
-        System.out.println(searchExpression);
-      }
       return searchExpression;
     }
   }


[04/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp ServerCore

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
index 8c6e4ed..db88062 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -205,18 +205,18 @@ public class MetadataDocumentXmlSerializerTest {
         "<edmx:Reference " +
             "Uri=\"http://localhost/odata/odata/v4.0/referenceWithInclude\">" +
             "<edmx:Include Namespace=\"Org.OData.Core.V1\" Alias=\"Core\"/>" +
-            "</edmx:Reference>"));
+        "</edmx:Reference>"));
     assertTrue(metadataString.contains(
         "<edmx:Reference " +
             "Uri=\"http://localhost/odata/odata/v4.0/referenceWithTwoIncludes\">" +
             "<edmx:Include Namespace=\"Org.OData.Core.2\" Alias=\"Core2\"/>" +
             "<edmx:Include Namespace=\"Org.OData.Core.3\" Alias=\"Core3\"/>" +
-            "</edmx:Reference>"));
+        "</edmx:Reference>"));
     assertTrue(metadataString.contains(
         "<edmx:Reference Uri=\"http://localhost/odata/odata/v4.0/referenceWithIncludeAnnos\">" +
             "<edmx:IncludeAnnotations TermNamespace=\"TermNs.2\" Qualifier=\"Q.2\" TargetNamespace=\"TargetNS.2\"/>" +
             "<edmx:IncludeAnnotations TermNamespace=\"TermNs.3\" Qualifier=\"Q.3\" TargetNamespace=\"TargetNS.3\"/>" +
-            "</edmx:Reference>"));
+        "</edmx:Reference>"));
     assertTrue(metadataString.contains(
         "<edmx:Reference Uri=\"http://localhost/odata/odata/v4.0/referenceWithAll\">" +
             "<edmx:Include Namespace=\"ReferenceWithAll.1\" Alias=\"Core1\"/>" +
@@ -225,7 +225,7 @@ public class MetadataDocumentXmlSerializerTest {
             "Qualifier=\"Q.4\" TargetNamespace=\"TargetNS.4\"/>" +
             "<edmx:IncludeAnnotations TermNamespace=\"ReferenceWithAllTermNs.5\" " +
             "Qualifier=\"Q.5\" TargetNamespace=\"TargetNS.5\"/>" +
-            "</edmx:Reference>"));
+        "</edmx:Reference>"));
     assertTrue(metadataString.contains(
         "<edmx:Reference Uri=\"http://localhost/odata/odata/v4.0/referenceWithAllAndNull\">" +
             "<edmx:Include Namespace=\"referenceWithAllAndNull.1\"/>" +
@@ -235,7 +235,7 @@ public class MetadataDocumentXmlSerializerTest {
             "<edmx:IncludeAnnotations TermNamespace=\"ReferenceWithAllTermAndNullNs.6\" " +
             "TargetNamespace=\"TargetNS\"/>" +
             "<edmx:IncludeAnnotations TermNamespace=\"ReferenceWithAllTermAndNullNs.7\"/>" +
-            "</edmx:Reference>"));
+        "</edmx:Reference>"));
   }
 
   @Test
@@ -404,12 +404,12 @@ public class MetadataDocumentXmlSerializerTest {
     private final FullQualifiedName nameString = EdmPrimitiveTypeKind.String.getFullQualifiedName();
     private final FullQualifiedName nameUARTPrimParam = new FullQualifiedName(nameSpace, "UARTPrimParam");
     private final CsdlProperty propertyInt16_NotNullable = new CsdlProperty()
-        .setName("PropertyInt16")
-        .setType(nameInt16)
-        .setNullable(false);
+    .setName("PropertyInt16")
+    .setType(nameInt16)
+    .setNullable(false);
     private final CsdlProperty propertyString = new CsdlProperty()
-        .setName("PropertyString")
-        .setType(nameString);
+    .setName("PropertyString")
+    .setType(nameString);
 
     private final FullQualifiedName nameCTTwoPrim = new FullQualifiedName(nameSpace, "CTTwoPrim");
     private final FullQualifiedName nameCTTwoPrimBase = new FullQualifiedName(nameSpace, "CTTwoPrimBase");
@@ -426,10 +426,10 @@ public class MetadataDocumentXmlSerializerTest {
     public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
       if (nameENString.equals(enumTypeName)) {
         return new CsdlEnumType()
-            .setName(nameENString.getName())
-            .setFlags(true)
-            .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName())
-            .setMembers(Collections.singletonList(new CsdlEnumMember().setName("String1").setValue("1")));
+        .setName(nameENString.getName())
+        .setFlags(true)
+        .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName())
+        .setMembers(Collections.singletonList(new CsdlEnumMember().setName("String1").setValue("1")));
       }
       return null;
     }
@@ -438,16 +438,16 @@ public class MetadataDocumentXmlSerializerTest {
     public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
       if (entityTypeName.equals(nameETAbstract)) {
         return new CsdlEntityType()
-            .setName("ETAbstract")
-            .setAbstract(true)
-            .setProperties(Collections.singletonList(propertyString));
+        .setName("ETAbstract")
+        .setAbstract(true)
+        .setProperties(Collections.singletonList(propertyString));
 
       } else if (entityTypeName.equals(nameETAbstractBase)) {
         return new CsdlEntityType()
-            .setName("ETAbstractBase")
-            .setBaseType(nameETAbstract)
-            .setKey(Collections.singletonList(new CsdlPropertyRef().setName("PropertyInt16")))
-            .setProperties(Collections.singletonList(propertyInt16_NotNullable));
+        .setName("ETAbstractBase")
+        .setBaseType(nameETAbstract)
+        .setKey(Collections.singletonList(new CsdlPropertyRef().setName("PropertyInt16")))
+        .setProperties(Collections.singletonList(propertyInt16_NotNullable));
       }
       return null;
     }
@@ -456,15 +456,15 @@ public class MetadataDocumentXmlSerializerTest {
     public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
       if (complexTypeName.equals(nameCTTwoPrim)) {
         return new CsdlComplexType()
-            .setName("CTTwoPrim")
-            .setProperties(Arrays.asList(propertyInt16_NotNullable, propertyString));
+        .setName("CTTwoPrim")
+        .setProperties(Arrays.asList(propertyInt16_NotNullable, propertyString));
 
       }
       if (complexTypeName.equals(nameCTTwoPrimBase)) {
         return new CsdlComplexType()
-            .setName("CTTwoPrimBase")
-            .setBaseType(nameCTTwoPrim)
-            .setProperties(Arrays.asList(propertyInt16_NotNullable, propertyString));
+        .setName("CTTwoPrimBase")
+        .setBaseType(nameCTTwoPrim)
+        .setProperties(Arrays.asList(propertyInt16_NotNullable, propertyString));
       }
       return null;
 
@@ -475,8 +475,8 @@ public class MetadataDocumentXmlSerializerTest {
       if (actionName.equals(nameUARTPrimParam)) {
         return Collections.singletonList(
             new CsdlAction().setName("UARTPrimParam")
-                .setParameters(Collections.singletonList(
-                    new CsdlParameter().setName("ParameterInt16").setType(nameInt16)))
+            .setParameters(Collections.singletonList(
+                new CsdlParameter().setName("ParameterInt16").setType(nameInt16)))
                 .setReturnType(new CsdlReturnType().setType(nameString)));
       }
       return null;
@@ -487,9 +487,9 @@ public class MetadataDocumentXmlSerializerTest {
       if (functionName.equals(nameUFNRTInt16)) {
         return Collections.singletonList(
             new CsdlFunction()
-                .setName("UFNRTInt16")
-                .setParameters(Collections.<CsdlParameter> emptyList())
-                .setReturnType(new CsdlReturnType().setType(nameInt16)));
+            .setName("UFNRTInt16")
+            .setParameters(Collections.<CsdlParameter> emptyList())
+            .setReturnType(new CsdlReturnType().setType(nameInt16)));
       }
       return null;
     }
@@ -499,8 +499,8 @@ public class MetadataDocumentXmlSerializerTest {
         throws ODataException {
       if (entitySetName.equals("ESAllPrim")) {
         return new CsdlEntitySet()
-            .setName("ESAllPrim")
-            .setType(nameETAbstractBase);
+        .setName("ESAllPrim")
+        .setType(nameETAbstractBase);
       }
       return null;
     }
@@ -510,8 +510,8 @@ public class MetadataDocumentXmlSerializerTest {
         throws ODataException {
       if (singletonName.equals("SI")) {
         return new CsdlSingleton()
-            .setName("SI")
-            .setType(nameETAbstractBase);
+        .setName("SI")
+        .setType(nameETAbstractBase);
       }
       return null;
     }
@@ -522,8 +522,8 @@ public class MetadataDocumentXmlSerializerTest {
       if (entityContainer.equals(nameContainer)) {
         if (actionImportName.equals("AIRTPrimParam")) {
           return new CsdlActionImport()
-              .setName("AIRTPrimParam")
-              .setAction(nameUARTPrimParam);
+          .setName("AIRTPrimParam")
+          .setAction(nameUARTPrimParam);
         }
       }
       return null;
@@ -532,13 +532,13 @@ public class MetadataDocumentXmlSerializerTest {
     @Override
     public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer,
         final String functionImportName)
-        throws ODataException {
+            throws ODataException {
       if (entityContainer.equals(nameContainer)) {
         if (functionImportName.equals("FINRTInt16")) {
           return new CsdlFunctionImport()
-              .setName("FINRTInt16")
-              .setFunction(nameUFNRTInt16)
-              .setIncludeInServiceDocument(true);
+          .setName("FINRTInt16")
+          .setFunction(nameUFNRTInt16)
+          .setIncludeInServiceDocument(true);
         }
       }
       return null;
@@ -576,9 +576,9 @@ public class MetadataDocumentXmlSerializerTest {
       // EntityContainer
       schema.setEntityContainer(getEntityContainer());
 
-      //Terms
+      // Terms
       schema.setTerms(Arrays.asList(
-          getTerm(new FullQualifiedName("ns","term")),
+          getTerm(new FullQualifiedName("ns", "term")),
           getTerm(new FullQualifiedName("namespace", "Term1")),
           getTerm(new FullQualifiedName("ns", "Term2")),
           getTerm(new FullQualifiedName("ns", "Term3")),
@@ -621,27 +621,27 @@ public class MetadataDocumentXmlSerializerTest {
     }
 
     @Override
-    public CsdlTypeDefinition getTypeDefinition(FullQualifiedName typeDefinitionName) throws ODataException {
+    public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
       return null;
     }
 
     @Override
-    public CsdlTerm getTerm(FullQualifiedName termName) throws ODataException {
+    public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException {
       if (new FullQualifiedName("ns", "term").equals(termName)) {
         return new CsdlTerm().setType("Edm.String").setName("term");
 
-      } else if(new FullQualifiedName("namespace", "Term1").equals(termName)){
+      } else if (new FullQualifiedName("namespace", "Term1").equals(termName)) {
         return new CsdlTerm().setType("Edm.String").setName("Term1");
 
-      } else if(new FullQualifiedName("ns", "Term2").equals(termName)){
+      } else if (new FullQualifiedName("ns", "Term2").equals(termName)) {
         return new CsdlTerm().setType("Edm.String").setName("Term2")
             .setNullable(false).setDefaultValue("default").setMaxLength(1).setPrecision(2).setScale(3);
 
-      } else if(new FullQualifiedName("ns", "Term3").equals(termName)){
+      } else if (new FullQualifiedName("ns", "Term3").equals(termName)) {
         return new CsdlTerm().setType("Edm.String").setName("Term3")
             .setAppliesTo(Arrays.asList("Property", "EntitySet", "Schema"));
 
-      } else if(new FullQualifiedName("ns", "Term4").equals(termName)){
+      } else if (new FullQualifiedName("ns", "Term4").equals(termName)) {
         return new CsdlTerm().setType("Edm.String").setName("Term4").setBaseTerm("namespace.Term1");
 
       }
@@ -649,7 +649,8 @@ public class MetadataDocumentXmlSerializerTest {
     }
 
     @Override
-    public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName, String qualifier) throws ODataException {
+    public CsdlAnnotations getAnnotationsGroup(final FullQualifiedName targetName, final String qualifier)
+        throws ODataException {
       if (new FullQualifiedName("Alias", "ETAbstract").equals(targetName) && "Tablett".equals(qualifier)) {
         CsdlAnnotations annoGroup = new CsdlAnnotations();
         annoGroup.setTarget("Alias.ETAbstract");
@@ -690,50 +691,50 @@ public class MetadataDocumentXmlSerializerTest {
         // logical expressions
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.And)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Or)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Not)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setAnnotations(innerAnnotations)));
 
         // comparison
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Eq)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Ne)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Gt)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Ge)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Lt)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Le)
-                .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
-                .setAnnotations(innerAnnotations)));
+            .setLeft(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setRight(new CsdlConstantExpression(ConstantExpressionType.Bool, "false"))
+            .setAnnotations(innerAnnotations)));
 
         // Other
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
@@ -748,12 +749,12 @@ public class MetadataDocumentXmlSerializerTest {
 
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlCast()
-                .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
-                .setMaxLength(1)
-                .setPrecision(2)
-                .setScale(3)
-                .setType("Edm.String")
-                .setAnnotations(innerAnnotations)));
+            .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
+            .setMaxLength(1)
+            .setPrecision(2)
+            .setScale(3)
+            .setType("Edm.String")
+            .setAnnotations(innerAnnotations)));
 
         List<CsdlExpression> items = new ArrayList<CsdlExpression>();
         items.add(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"));
@@ -764,25 +765,25 @@ public class MetadataDocumentXmlSerializerTest {
 
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlIf()
-                .setGuard(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
-                .setThen(new CsdlConstantExpression(ConstantExpressionType.String, "Then"))
-                .setElse(new CsdlConstantExpression(ConstantExpressionType.String, "Else"))
-                .setAnnotations(innerAnnotations)));
+            .setGuard(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"))
+            .setThen(new CsdlConstantExpression(ConstantExpressionType.String, "Then"))
+            .setElse(new CsdlConstantExpression(ConstantExpressionType.String, "Else"))
+            .setAnnotations(innerAnnotations)));
 
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlIsOf()
-                .setMaxLength(1)
-                .setPrecision(2)
-                .setScale(3)
-                .setType("Edm.String")
-                .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
-                .setAnnotations(innerAnnotations)));
+            .setMaxLength(1)
+            .setPrecision(2)
+            .setScale(3)
+            .setType("Edm.String")
+            .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
+            .setAnnotations(innerAnnotations)));
 
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLabeledElement()
-                .setName("NameAtt")
-                .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
-                .setAnnotations(innerAnnotations)));
+            .setName("NameAtt")
+            .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
+            .setAnnotations(innerAnnotations)));
 
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlLabeledElementReference().setValue("LabeledElementReferenceValue")));
@@ -800,9 +801,9 @@ public class MetadataDocumentXmlSerializerTest {
             .setExpression(new CsdlPropertyPath().setValue("PropertyPathValue")));
 
         CsdlPropertyValue prop = new CsdlPropertyValue()
-            .setProperty("PropName")
-            .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
-            .setAnnotations(innerAnnotations);
+        .setProperty("PropName")
+        .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "value"))
+        .setAnnotations(innerAnnotations);
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlRecord().setType("Alias.ETAbstract")
                 .setPropertyValues(Arrays.asList(prop))
@@ -810,8 +811,8 @@ public class MetadataDocumentXmlSerializerTest {
 
         annotationsList.add(new CsdlAnnotation().setTerm("ns.term")
             .setExpression(new CsdlUrlRef()
-                .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "URLRefValue"))
-                .setAnnotations(innerAnnotations)));
+            .setValue(new CsdlConstantExpression(ConstantExpressionType.String, "URLRefValue"))
+            .setAnnotations(innerAnnotations)));
 
         return annoGroup;
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java
index 907228f..ee9618d 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -62,13 +62,13 @@ public class ServerErrorXmlSerializerTest {
   @Test
   public void singleDetailNothingSet() throws Exception {
     ODataServerError error = new ODataServerError()
-        .setCode("code")
-        .setMessage("err message")
-        .setTarget("target")
-        .setDetails(Collections.singletonList(
-            new ODataErrorDetail()
-                .setCode("detail code")
-                .setMessage("detail message")));
+    .setCode("code")
+    .setMessage("err message")
+    .setTarget("target")
+    .setDetails(Collections.singletonList(
+        new ODataErrorDetail()
+        .setCode("detail code")
+        .setMessage("detail message")));
 
     InputStream stream = ser.error(error).getContent();
     String jsonString = IOUtils.toString(stream);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializerTest.java
index 846efc5..c3e3598 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -76,7 +76,7 @@ public class ServiceDocumentXmlSerializerTest {
   @Test
   public void writeServiceDocument() throws Exception {
     CsdlEdmProvider provider = new MetadataDocumentXmlSerializerTest.LocalProvider();
-    ServiceMetadata serviceMetadata = new ServiceMetadataImpl(provider, 
+    ServiceMetadata serviceMetadata = new ServiceMetadataImpl(provider,
         Collections.<EdmxReference> emptyList(), null);
     InputStream metadataStream = serializer.serviceDocument(serviceMetadata, "http://host/svc").getContent();
     String metadata = IOUtils.toString(metadataStream);
@@ -87,15 +87,15 @@ public class ServiceDocumentXmlSerializerTest {
         + "metadata:context=\"http://host/svc/$metadata\">"
         + "<app:workspace>"
         + "<atom:title>org.olingo.container</atom:title>"
-        +   "<app:collection href=\"ESAllPrim\" metadata:name=\"ESAllPrim\">"
-        +     "<atom:title>ESAllPrim</atom:title>"
-        +   "</app:collection>"
-        +   "<metadata:function-import href=\"FINRTInt16\" metadata:name=\"FINRTInt16\">"
-        +     "<atom:title>FINRTInt16</atom:title>"
-        +   "</metadata:function-import>"
-        +   "<metadata:singleton href=\"SI\" metadata:name=\"SI\">"
-        +     "<atom:title>SI</atom:title>"
-        +   "</metadata:singleton>"
+        + "<app:collection href=\"ESAllPrim\" metadata:name=\"ESAllPrim\">"
+        + "<atom:title>ESAllPrim</atom:title>"
+        + "</app:collection>"
+        + "<metadata:function-import href=\"FINRTInt16\" metadata:name=\"FINRTInt16\">"
+        + "<atom:title>FINRTInt16</atom:title>"
+        + "</metadata:function-import>"
+        + "<metadata:singleton href=\"SI\" metadata:name=\"SI\">"
+        + "<atom:title>SI</atom:title>"
+        + "</metadata:singleton>"
         + "</app:workspace>"
         + "</app:service>",
         metadata);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
index e028cfe..40c6200 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserAndTokenizerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,7 +35,7 @@ public class SearchParserAndTokenizerTest {
     assertQuery("a AND b AND c").resultsIn("{{'a' AND 'b'} AND 'c'}");
     assertQuery("a OR b").resultsIn("{'a' OR 'b'}");
     assertQuery("a OR b OR c").resultsIn("{{'a' OR 'b'} OR 'c'}");
-    
+
     assertQuery("NOT a NOT b").resultsIn("{{NOT 'a'} AND {NOT 'b'}}");
     assertQuery("NOT a AND NOT b").resultsIn("{{NOT 'a'} AND {NOT 'b'}}");
     assertQuery("NOT a OR NOT b").resultsIn("{{NOT 'a'} OR {NOT 'b'}}");
@@ -59,16 +59,16 @@ public class SearchParserAndTokenizerTest {
     assertQuery("a AND (b OR c)").resultsIn("{'a' AND {'b' OR 'c'}}");
     assertQuery("(a OR b) AND NOT c").resultsIn("{{'a' OR 'b'} AND {NOT 'c'}}");
     assertQuery("(a OR B) AND (c OR d AND NOT e OR (f))")
-            .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
+        .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
     assertQuery("(a OR B) (c OR d NOT e OR (f))")
-      .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
+        .resultsIn("{{'a' OR 'B'} AND {{'c' OR {'d' AND {NOT 'e'}}} OR 'f'}}");
     assertQuery("((((a))))").resultsIn("'a'");
     assertQuery("((((a)))) ((((a))))").resultsIn("{'a' AND 'a'}");
     assertQuery("((((a)))) OR ((((a))))").resultsIn("{'a' OR 'a'}");
     assertQuery("((((((a)))) ((((c))) OR (((C)))) ((((a))))))").resultsIn("{{'a' AND {'c' OR 'C'}} AND 'a'}");
     assertQuery("((((\"a\")))) OR ((((\"a\"))))").resultsIn("{'a' OR 'a'}");
   }
-  
+
   @Test
   public void parseImplicitAnd() throws Exception {
     assertQuery("a b").resultsIn("{'a' AND 'b'}");
@@ -103,7 +103,7 @@ public class SearchParserAndTokenizerTest {
     assertQuery("((a AND b OR c)").resultsIn(SearchParserException.MessageKeys.MISSING_CLOSE);
     assertQuery("a AND (b OR c").resultsIn(SearchParserException.MessageKeys.MISSING_CLOSE);
     assertQuery("(a AND ((b OR c)").resultsIn(SearchParserException.MessageKeys.MISSING_CLOSE);
-    
+
     assertQuery("NOT NOT a").resultsIn(SearchParserException.MessageKeys.INVALID_NOT_OPERAND);
     assertQuery("NOT (a)").resultsIn(SearchParserException.MessageKeys.TOKENIZER_EXCEPTION);
   }
@@ -119,83 +119,81 @@ public class SearchParserAndTokenizerTest {
    */
   @Test
   public void searchQueryPhraseAbnfTestcases() throws Exception {
-    //    <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
+    // <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
     assertQuery("\"blue green\"").resultsIn("'blue green'");
-    //    <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
+    // <TestCase Name="5.1.7 Search - simple phrase" Rule="queryOptions">
     assertQuery("\"blue green\"").resultsIn("'blue green'");
-    //    <TestCase Name="5.1.7 Search - phrase with escaped double-quote" Rule="queryOptions">
-    //    <Input>$search="blue\"green"</Input>
+    // <TestCase Name="5.1.7 Search - phrase with escaped double-quote" Rule="queryOptions">
+    // <Input>$search="blue\"green"</Input>
     assertQuery("\"blue\\\"green\"").resultsIn("'blue\"green'");
 
-    //    <TestCase Name="5.1.7 Search - phrase with escaped backslash" Rule="queryOptions">
-    //    <Input>$search="blue\\green"</Input>
+    // <TestCase Name="5.1.7 Search - phrase with escaped backslash" Rule="queryOptions">
+    // <Input>$search="blue\\green"</Input>
     assertQuery("\"blue\\\\green\"").resultsIn("'blue\\green'");
-    //    <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="14">
+    // <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="14">
     assertQuery("\"blue\"green\"").resultsIn(SearchParserException.MessageKeys.TOKENIZER_EXCEPTION);
-    //    <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="16">
+    // <TestCase Name="5.1.7 Search - phrase with unescaped double-quote" Rule="queryOptions" FailAt="16">
     assertQuery("\"blue\"green\"").resultsIn(SearchParserException.MessageKeys.TOKENIZER_EXCEPTION);
 
-    //    <TestCase Name="5.1.7 Search - implicit AND" Rule="queryOptions">
-    //    <Input>$search=blue green</Input>
+    // <TestCase Name="5.1.7 Search - implicit AND" Rule="queryOptions">
+    // <Input>$search=blue green</Input>
     assertQuery("blue green").resultsIn("{'blue' AND 'green'}");
-    //    <TestCase Name="5.1.7 Search - implicit AND, encoced" Rule="queryOptions">
+    // <TestCase Name="5.1.7 Search - implicit AND, encoced" Rule="queryOptions">
     assertQuery("blue green").resultsIn("{'blue' AND 'green'}");
 
-    //    <TestCase Name="5.1.7 Search - AND" Rule="queryOptions">
-    //    <Input>$search=blue AND green</Input>
+    // <TestCase Name="5.1.7 Search - AND" Rule="queryOptions">
+    // <Input>$search=blue AND green</Input>
     assertQuery("blue AND green").resultsIn("{'blue' AND 'green'}");
 
-    //    <TestCase Name="5.1.7 Search - OR" Rule="queryOptions">
-    //    <Input>$search=blue OR green</Input>
+    // <TestCase Name="5.1.7 Search - OR" Rule="queryOptions">
+    // <Input>$search=blue OR green</Input>
     assertQuery("blue OR green").resultsIn("{'blue' OR 'green'}");
 
-    //    <TestCase Name="5.1.7 Search - NOT" Rule="queryOptions">
-    //    <Input>$search=blue NOT green</Input>
+    // <TestCase Name="5.1.7 Search - NOT" Rule="queryOptions">
+    // <Input>$search=blue NOT green</Input>
     assertQuery("blue NOT green").resultsIn("{'blue' AND {NOT 'green'}}");
 
-    //    <TestCase Name="5.1.7 Search - only NOT" Rule="queryOptions">
-    //    <Input>$search=NOT blue</Input>
+    // <TestCase Name="5.1.7 Search - only NOT" Rule="queryOptions">
+    // <Input>$search=NOT blue</Input>
     assertQuery("NOT blue").resultsIn("{NOT 'blue'}");
 
-    //    <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
-    //    <Input>$search=foo AND bar OR foo AND baz OR that AND bar OR that AND baz</Input>
+    // <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
+    // <Input>$search=foo AND bar OR foo AND baz OR that AND bar OR that AND baz</Input>
     assertQuery("foo AND bar OR foo AND baz OR that AND bar OR that AND baz")
-        .resultsIn("{{{{'foo' AND 'bar'} OR {'foo' AND 'baz'}} OR {'that' AND 'bar'}} OR {'that' AND 'baz'}}");
+    .resultsIn("{{{{'foo' AND 'bar'} OR {'foo' AND 'baz'}} OR {'that' AND 'bar'}} OR {'that' AND 'baz'}}");
 
-    //    <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
-    //    <Input>$search=(foo OR that) AND (bar OR baz)</Input>
+    // <TestCase Name="5.1.7 Search - multiple" Rule="queryOptions">
+    // <Input>$search=(foo OR that) AND (bar OR baz)</Input>
     assertQuery("(foo OR that) AND (bar OR baz)").resultsIn("{{'foo' OR 'that'} AND {'bar' OR 'baz'}}");
 
-    //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-    //    <Input>$search=foo AND (bar OR baz)</Input>
+    // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+    // <Input>$search=foo AND (bar OR baz)</Input>
     assertQuery("foo AND (bar OR baz)").resultsIn("{'foo' AND {'bar' OR 'baz'}}");
 
-    //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-    //    <Input>$search=(foo AND bar) OR baz</Input>
+    // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+    // <Input>$search=(foo AND bar) OR baz</Input>
     assertQuery("(foo AND bar) OR baz").resultsIn("{{'foo' AND 'bar'} OR 'baz'}");
 
-    //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-    //    <Input>$search=(NOT foo) OR baz</Input>
+    // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+    // <Input>$search=(NOT foo) OR baz</Input>
     assertQuery("(NOT foo) OR baz").resultsIn("{{NOT 'foo'} OR 'baz'}");
 
-    //    <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
-    //    <Input>$search=(NOT foo)</Input>
+    // <TestCase Name="5.1.7 Search - grouping" Rule="queryOptions">
+    // <Input>$search=(NOT foo)</Input>
     assertQuery("(NOT foo)").resultsIn("{NOT 'foo'}");
 
-    //    <TestCase Name="5.1.7 Search - on entity set" Rule="odataUri">
-    //    <Input>http://serviceRoot/Products?$search=blue</Input>
+    // <TestCase Name="5.1.7 Search - on entity set" Rule="odataUri">
+    // <Input>http://serviceRoot/Products?$search=blue</Input>
     assertQuery("blue").resultsIn("'blue'");
 
-
     // below cases can not be tested here
-    //    <TestCase Name="5.1.7 Search - on entity container" Rule="odataUri">
-    //    <Input>http://serviceRoot/Model.Container/$all?$search=blue</Input>
-    //    <TestCase Name="5.1.7 Search - on service" Rule="odataUri">
-    //    <Input>http://serviceRoot/$all?$search=blue</Input>
+    // <TestCase Name="5.1.7 Search - on entity container" Rule="odataUri">
+    // <Input>http://serviceRoot/Model.Container/$all?$search=blue</Input>
+    // <TestCase Name="5.1.7 Search - on service" Rule="odataUri">
+    // <Input>http://serviceRoot/$all?$search=blue</Input>
   }
 
-
-  private static Validator assertQuery(String searchQuery) {
+  private static Validator assertQuery(final String searchQuery) {
     return Validator.init(searchQuery);
   }
 
@@ -203,28 +201,22 @@ public class SearchParserAndTokenizerTest {
     private boolean log;
     private final String searchQuery;
 
-    private Validator(String searchQuery) {
+    private Validator(final String searchQuery) {
       this.searchQuery = searchQuery;
     }
 
-    private static Validator init(String searchQuery) {
+    private static Validator init(final String searchQuery) {
       return new Validator(searchQuery);
     }
 
-    @SuppressWarnings("unused")
-    private Validator withLogging() {
-      log = true;
-      return this;
-    }
-
-    private void resultsIn(SearchParserException.MessageKey key)
-            throws SearchTokenizerException {
+    private void resultsIn(final SearchParserException.MessageKey key)
+        throws SearchTokenizerException {
       try {
         resultsIn(searchQuery);
       } catch (SearchParserException e) {
         Assert.assertEquals("SearchParserException with unexpected message '" + e.getMessage() +
             "' was thrown.", key, e.getMessageKey());
-        if(log) {
+        if (log) {
           System.out.println("Caught SearchParserException with message key " +
               e.getMessageKey() + " and message " + e.getMessage());
         }
@@ -232,17 +224,18 @@ public class SearchParserAndTokenizerTest {
       }
       Assert.fail("SearchParserException with message key " + key.getKey() + " was not thrown.");
     }
-    
+
     public void resultsInExpectedTerm(final String actualToken) throws SearchTokenizerException {
       try {
         resultsIn(searchQuery);
-      } catch(SearchParserException e) {
+      } catch (SearchParserException e) {
         Assert.assertEquals(SearchParserException.MessageKeys.EXPECTED_DIFFERENT_TOKEN, e.getMessageKey());
         Assert.assertEquals("Expected PHRASE||WORD found: " + actualToken, e.getMessage());
       }
     }
-    
-    private void resultsIn(String expectedSearchExpression) throws SearchTokenizerException, SearchParserException {
+
+    private void resultsIn(final String expectedSearchExpression) throws SearchTokenizerException,
+        SearchParserException {
       final SearchExpression searchExpression = getSearchExpression();
       Assert.assertEquals(expectedSearchExpression, searchExpression.toString());
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
index 4d2b560..780c209 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchParserTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -176,7 +176,6 @@ public class SearchParserTest extends SearchParser {
     runEx(SearchParserException.MessageKeys.INVALID_NOT_OPERAND, Token.NOT, Token.AND);
   }
 
-
   @Test
   public void notNotWord() throws Exception {
     runEx(SearchParserException.MessageKeys.INVALID_NOT_OPERAND, Token.NOT, Token.NOT, Token.WORD);
@@ -195,12 +194,12 @@ public class SearchParserTest extends SearchParser {
     runEx(MessageKeys.EXPECTED_DIFFERENT_TOKEN, Token.NOT, Token.WORD, Token.AND);
     runEx(MessageKeys.INVALID_END_OF_QUERY, Token.WORD, Token.AND, Token.WORD, Token.CLOSE);
   }
-  
+
   @Test
   public void invalidQueryStarts() throws Exception {
     run(Token.WORD, Token.AND, Token.WORD, Token.AND, Token.WORD);
   }
-  
+
   @Test
   public void singleAnd() {
     runEx(SearchParserException.MessageKeys.EXPECTED_DIFFERENT_TOKEN, Token.AND);
@@ -222,7 +221,7 @@ public class SearchParserTest extends SearchParser {
     runEx(SearchParserException.MessageKeys.NO_EXPRESSION_FOUND, emptyArray);
   }
 
-  private void runEx(MessageKeys key, Token... tokenArray) {
+  private void runEx(final MessageKeys key, final Token... tokenArray) {
     try {
       run(tokenArray);
       fail("Expected UriParserSyntaxException with key " + key);
@@ -230,15 +229,15 @@ public class SearchParserTest extends SearchParser {
       assertEquals(key, e.getMessageKey());
     }
   }
-  
-  private SearchExpression run(SearchQueryToken.Token... tokenArray) throws SearchParserException {
+
+  private SearchExpression run(final SearchQueryToken.Token... tokenArray) throws SearchParserException {
     List<SearchQueryToken> tokenList = prepareTokens(tokenArray);
     SearchExpression se = parse(tokenList);
     assertNotNull(se);
     return se;
   }
 
-  public List<SearchQueryToken> prepareTokens(SearchQueryToken.Token... tokenArray) {
+  public List<SearchQueryToken> prepareTokens(final SearchQueryToken.Token... tokenArray) {
     ArrayList<SearchQueryToken> tokenList = new ArrayList<SearchQueryToken>();
     int wordNumber = 1;
     int phraseNumber = 1;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
index c2a390a..a6c1375 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -31,7 +31,6 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.junit.Assert;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class SearchTokenizerTest {
@@ -58,7 +57,7 @@ public class SearchTokenizerTest {
     assertQuery("notAw0rd").resultsIn(SearchTokenizerException.MessageKeys.FORBIDDEN_CHARACTER);
   }
 
-  private Validator.Tuple word(String literal) {
+  private Validator.Tuple word(final String literal) {
     return Validator.tuple(WORD, literal);
   }
 
@@ -72,20 +71,20 @@ public class SearchTokenizerTest {
     //
     result = tokenizer.tokenize("\"abc\"");
     Assert.assertNotNull(result);
-    
+
     Assert.assertEquals(PHRASE, result.get(0).getToken());
 
     //
     result = tokenizer.tokenize("\"9988  abs\"");
     Assert.assertNotNull(result);
-    
+
     Assert.assertEquals(PHRASE, result.get(0).getToken());
     Assert.assertEquals("\"9988  abs\"", result.get(0).getLiteral());
 
     //
     result = tokenizer.tokenize("\"99_88.\"");
     Assert.assertNotNull(result);
-    
+
     Assert.assertEquals(PHRASE, result.get(0).getToken());
     Assert.assertEquals("\"99_88.\"", result.get(0).getLiteral());
 
@@ -136,7 +135,7 @@ public class SearchTokenizerTest {
     assertQuery("abc xyz").resultsIn(WORD, WORD);
     assertQuery("abc AND xyz AND olingo").resultsIn(WORD, AND, WORD, AND, WORD);
     assertQuery("abc AND \"x-y_z\"  AND olingo")
-        .resultsIn(WORD, AND, PHRASE, AND, WORD);
+    .resultsIn(WORD, AND, PHRASE, AND, WORD);
   }
 
   @Test
@@ -146,7 +145,6 @@ public class SearchTokenizerTest {
     assertQuery("abc AND ANDsomething").addExpected(WORD, AND, WORD);
   }
 
-
   @Test
   public void parseCombinations() throws Exception {
     assertQuery("word O NO").resultsIn(word("word"), word("O"), word("NO"));
@@ -156,27 +154,25 @@ public class SearchTokenizerTest {
     assertQuery("abc AND NOT xyz OR olingo").resultsIn(WORD, AND, NOT, WORD, OR, WORD);
 
     assertQuery("foo AND bar OR foo AND baz OR that AND bar OR that AND baz")
-        .addExpected(WORD, "foo").addExpected(AND)
-        .addExpected(WORD, "bar").addExpected(OR)
-        .addExpected(WORD, "foo").addExpected(AND)
-        .addExpected(WORD, "baz").addExpected(OR)
-        .addExpected(WORD, "that").addExpected(AND)
-        .addExpected(WORD, "bar").addExpected(OR)
-        .addExpected(WORD, "that").addExpected(AND)
-        .addExpected(WORD, "baz")
-        .validate();
-
+    .addExpected(WORD, "foo").addExpected(AND)
+    .addExpected(WORD, "bar").addExpected(OR)
+    .addExpected(WORD, "foo").addExpected(AND)
+    .addExpected(WORD, "baz").addExpected(OR)
+    .addExpected(WORD, "that").addExpected(AND)
+    .addExpected(WORD, "bar").addExpected(OR)
+    .addExpected(WORD, "that").addExpected(AND)
+    .addExpected(WORD, "baz")
+    .validate();
 
     assertQuery("(foo OR that) AND (bar OR baz)")
-        .addExpected(OPEN)
-        .addExpected(WORD, "foo").addExpected(OR).addExpected(WORD, "that")
-        .addExpected(CLOSE).addExpected(AND).addExpected(OPEN)
-        .addExpected(WORD, "bar").addExpected(OR).addExpected(WORD, "baz")
-        .addExpected(CLOSE)
-        .validate();
+    .addExpected(OPEN)
+    .addExpected(WORD, "foo").addExpected(OR).addExpected(WORD, "that")
+    .addExpected(CLOSE).addExpected(AND).addExpected(OPEN)
+    .addExpected(WORD, "bar").addExpected(OR).addExpected(WORD, "baz")
+    .addExpected(CLOSE)
+    .validate();
   }
 
-
   @Test
   public void parseSpecial() throws Exception {
     assertQuery("NOT abc AND nothing").resultsIn(NOT, WORD, AND, WORD);
@@ -192,23 +188,23 @@ public class SearchTokenizerTest {
   public void unicodeInWords() throws Exception {
     // Ll, Lm, Lo, Lt, Lu, Nl
     assertQuery("abc OR Ll\u01E3Lm\u02B5Lo\u00AALt\u01F2Lu\u03D3Nl\u216F")
-        .resultsIn(WORD, OR, WORD);
+    .resultsIn(WORD, OR, WORD);
   }
 
   /**
-   * unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
-   * other-delims   = "!" /                   "(" / ")" / "*" / "+" / "," / ";"
-   * qchar-unescaped       = unreserved / pct-encoded-unescaped / other-delims / ":" / "@" / "/" / "?" / "$" / "'" / "="
-   * pct-encoded-unescaped = "%" ( "0" / "1" /   "3" / "4" /   "6" / "7" / "8" / "9" / A-to-F ) HEXDIG
-   *   / "%" "2" ( "0" / "1" /   "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F )
-   *   / "%" "5" ( DIGIT / "A" / "B" /   "D" / "E" / "F" )
+   * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
+   * other-delims = "!" / "(" / ")" / "*" / "+" / "," / ";"
+   * qchar-unescaped = unreserved / pct-encoded-unescaped / other-delims / ":" / "@" / "/" / "?" / "$" / "'" / "="
+   * pct-encoded-unescaped = "%" ( "0" / "1" / "3" / "4" / "6" / "7" / "8" / "9" / A-to-F ) HEXDIG
+   * / "%" "2" ( "0" / "1" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / A-to-F )
+   * / "%" "5" ( DIGIT / "A" / "B" / "D" / "E" / "F" )
    *
-   * qchar-no-AMP-DQUOTE   = qchar-unescaped  / escape ( escape / quotation-mark )
+   * qchar-no-AMP-DQUOTE = qchar-unescaped / escape ( escape / quotation-mark )
    *
-   * escape = "\" / "%5C"     ; reverse solidus U+005C
-   * quotation-mark  = DQUOTE / "%22"
-   * ALPHA  = %x41-5A / %x61-7A
-   * DIGIT  = %x30-39
+   * escape = "\" / "%5C" ; reverse solidus U+005C
+   * quotation-mark = DQUOTE / "%22"
+   * ALPHA = %x41-5A / %x61-7A
+   * DIGIT = %x30-39
    * DQUOTE = %x22
    *
    * @throws Exception
@@ -218,7 +214,7 @@ public class SearchTokenizerTest {
     assertQuery("\"123\" OR \"ALPHA-._~\"").resultsIn(PHRASE, OR, PHRASE);
     assertQuery("\"100%Olingo\"").resultsIn(new Validator.Tuple(PHRASE, "\"100%Olingo\""));
     assertQuery("\"100'Olingo\"").resultsIn(new Validator.Tuple(PHRASE, "\"100'Olingo\""));
-    //escaped characters
+    // escaped characters
     assertQuery("\"\\\"123\" OR \"\\\\abc\"").resultsIn(new Validator.Tuple(PHRASE, "\"\"123\""),
         new Validator.Tuple(OR), new Validator.Tuple(PHRASE, "\"\\abc\""));
     assertQuery("\"\\\"1\\\\23\"").resultsIn(new Validator.Tuple(PHRASE, "\"\"1\\23\""));
@@ -294,15 +290,15 @@ public class SearchTokenizerTest {
     assertQuery("abc AND \"something\" )").resultsIn(WORD, AND, PHRASE, CLOSE);
   }
 
-  public void validate(String query) throws SearchTokenizerException {
+  public void validate(final String query) throws SearchTokenizerException {
     new Validator(query);
   }
 
-  public Validator assertQuery(String query) throws SearchTokenizerException {
+  public Validator assertQuery(final String query) throws SearchTokenizerException {
     return new Validator(query);
   }
 
-  public void validate(String query, SearchQueryToken.Token ... tokens) throws SearchTokenizerException {
+  public void validate(final String query, final SearchQueryToken.Token... tokens) throws SearchTokenizerException {
     Validator sv = new Validator(query);
     for (SearchQueryToken.Token token : tokens) {
       sv.addExpected(token);
@@ -315,32 +311,37 @@ public class SearchTokenizerTest {
     private boolean log;
     private final String searchQuery;
 
-    public void resultsIn(SearchQueryToken.Token... tokens) throws SearchTokenizerException {
+    public void resultsIn(final SearchQueryToken.Token... tokens) throws SearchTokenizerException {
       addExpected(tokens);
       validate();
     }
-    public void resultsIn(Tuple... tuple) throws SearchTokenizerException {
+
+    public void resultsIn(final Tuple... tuple) throws SearchTokenizerException {
       for (Tuple t : tuple) {
         addExpected(t.token, t.literal);
       }
       validate();
     }
-    public static Tuple tuple(SearchQueryToken.Token token, String literal) {
+
+    public static Tuple tuple(final SearchQueryToken.Token token, final String literal) {
       return new Tuple(token, literal);
     }
+
     private static class Tuple {
       final SearchQueryToken.Token token;
       final String literal;
-      public Tuple(SearchQueryToken.Token token, String literal) {
+
+      public Tuple(final SearchQueryToken.Token token, final String literal) {
         this.token = token;
         this.literal = literal;
       }
-      public Tuple(SearchQueryToken.Token token) {
+
+      public Tuple(final SearchQueryToken.Token token) {
         this(token, null);
       }
     }
 
-    private Validator(String searchQuery) {
+    private Validator(final String searchQuery) {
       this.searchQuery = searchQuery;
     }
 
@@ -348,24 +349,26 @@ public class SearchTokenizerTest {
       log = true;
       return this;
     }
-    private Validator addExpected(SearchQueryToken.Token token, String literal) {
+
+    private Validator addExpected(final SearchQueryToken.Token token, final String literal) {
       validations.add(new Tuple(token, literal));
       return this;
     }
-    private Validator addExpected(SearchQueryToken.Token ... token) {
+
+    private Validator addExpected(final SearchQueryToken.Token... token) {
       for (SearchQueryToken.Token t : token) {
         validations.add(new Tuple(t));
       }
       return this;
     }
 
-    private void resultsIn(SearchTokenizerException.MessageKey key)
+    private void resultsIn(final SearchTokenizerException.MessageKey key)
         throws SearchTokenizerException {
       try {
         validate();
       } catch (SearchTokenizerException e) {
         Assert.assertEquals("SearchTokenizerException with unexpected message was thrown.", key, e.getMessageKey());
-        if(log) {
+        if (log) {
           System.out.println("Caught SearchTokenizerException with message key " +
               e.getMessageKey() + " and message " + e.getMessage());
         }
@@ -378,17 +381,17 @@ public class SearchTokenizerTest {
       SearchTokenizer tokenizer = new SearchTokenizer();
       List<SearchQueryToken> result = tokenizer.tokenize(searchQuery);
       Assert.assertNotNull(result);
-      if(log) {
+      if (log) {
         System.out.println(result);
       }
-      if(validations.size() != 0) {
+      if (validations.size() != 0) {
         Assert.assertEquals(validations.size(), result.size());
 
         Iterator<Tuple> validationIt = validations.iterator();
         for (SearchQueryToken iToken : result) {
           Tuple validation = validationIt.next();
           Assert.assertEquals(validation.token, iToken.getToken());
-          if(validation.literal != null) {
+          if (validation.literal != null) {
             Assert.assertEquals(validation.literal, iToken.getLiteral());
           }
         }


[46/51] [abbrv] olingo-odata4 git commit: OLINGO-853: Correcting the encoding of datetime properties correctly to be used in a URI

Posted by mi...@apache.org.
OLINGO-853: Correcting the encoding of datetime properties correctly to be used in a URI


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 16d238f96fa881f587a76d3bc6d00be11c110437
Parents: 03aa1d0
Author: Ramesh Reddy <ra...@jboss.org>
Authored: Thu Jan 21 16:01:59 2016 -0600
Committer: Ramesh Reddy <ra...@jboss.org>
Committed: Thu Jan 21 16:01:59 2016 -0600

----------------------------------------------------------------------
 .../apache/olingo/server/core/responses/EntityResponse.java | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/16d238f9/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
index 5bf86a3..064ad6f 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
@@ -175,14 +175,9 @@ public class EntityResponse extends ServiceResponse {
   public static String buildLocation(String baseURL, Entity entity, String enitySetName, EdmEntityType type) 
       throws EdmPrimitiveTypeException {
     StringBuilder location = new StringBuilder();
-    location.append(baseURL).append("/").append(enitySetName);
-    location.append(buildKeySegmentsURI(entity, type));
-    return location.toString();
-  }
 
-  public static String buildKeySegmentsURI(Entity entity, EdmEntityType type)
-      throws EdmPrimitiveTypeException {
-    StringBuilder location = new StringBuilder();
+    location.append(baseURL).append("/").append(enitySetName);
+    
     int i = 0;
     boolean usename = type.getKeyPredicateNames().size() > 1;
     location.append("(");


[38/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] parsing of most geo literals in URI parser

Posted by mi...@apache.org.
[OLINGO-834] parsing of most geo literals in URI parser

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: a283bddbbf1e6d16a7ec7926e183e367fd7ba544
Parents: c7aa842
Author: Klaus Straubinger <kl...@sap.com>
Authored: Fri Jan 15 16:10:32 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Jan 18 13:36:18 2016 +0100

----------------------------------------------------------------------
 .../search/SearchUnaryOperatorKind.java         |   2 +-
 .../core/uri/parser/ExpressionParser.java       |  22 +-
 .../server/core/uri/parser/ParserHelper.java    |  83 ++++++-
 .../server/core/uri/parser/UriTokenizer.java    | 244 +++++++++++++++++++
 .../core/uri/parser/ExpressionParserTest.java   |  19 +-
 .../core/uri/parser/UriTokenizerTest.java       |  64 +++++
 .../core/uri/parser/TestUriParserImpl.java      |  27 +-
 7 files changed, 406 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a283bddb/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
index bbc9ba6..f4122c7 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
@@ -22,6 +22,6 @@ public enum SearchUnaryOperatorKind {
   NOT;
 
   public static SearchUnaryOperatorKind get(final String operator) {
-    return NOT.equals(operator) ? NOT : null;
+    return NOT.name().equals(operator) ? NOT : null;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a283bddb/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
index ef7d6da..8b28f6a 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
@@ -156,26 +156,6 @@ public class ExpressionParser {
     tokenToMethod = Collections.unmodifiableMap(temp);
   }
 
-  private static final Map<TokenKind, EdmPrimitiveTypeKind> tokenToPrimitiveType;
-  static {
-    /* Enum and null are not present in the map. These have to be handled differently. */
-    Map<TokenKind, EdmPrimitiveTypeKind> temp = new HashMap<TokenKind, EdmPrimitiveTypeKind>();
-    temp.put(TokenKind.BooleanValue, EdmPrimitiveTypeKind.Boolean);
-    temp.put(TokenKind.StringValue, EdmPrimitiveTypeKind.String);
-    // TODO: Check if int64 is correct here or if it has to be decimal or single or double instead.
-    temp.put(TokenKind.IntegerValue, EdmPrimitiveTypeKind.Int64);
-    temp.put(TokenKind.GuidValue, EdmPrimitiveTypeKind.Guid);
-    temp.put(TokenKind.DateValue, EdmPrimitiveTypeKind.Date);
-    temp.put(TokenKind.DateTimeOffsetValue, EdmPrimitiveTypeKind.DateTimeOffset);
-    temp.put(TokenKind.TimeOfDayValue, EdmPrimitiveTypeKind.TimeOfDay);
-    temp.put(TokenKind.DecimalValue, EdmPrimitiveTypeKind.Decimal);
-    temp.put(TokenKind.DoubleValue, EdmPrimitiveTypeKind.Double);
-    temp.put(TokenKind.DurationValue, EdmPrimitiveTypeKind.Duration);
-    temp.put(TokenKind.BinaryValue, EdmPrimitiveTypeKind.Binary);
-
-    tokenToPrimitiveType = Collections.unmodifiableMap(temp);
-  }
-
   private final Edm edm;
   private final OData odata;
 
@@ -408,7 +388,7 @@ public class ExpressionParser {
     if (primitiveTokenKind == TokenKind.EnumValue) {
       return createEnumExpression(primitiveValueLiteral);
     } else {
-      EdmPrimitiveTypeKind primitiveTypeKind = tokenToPrimitiveType.get(primitiveTokenKind);
+      EdmPrimitiveTypeKind primitiveTypeKind = ParserHelper.tokenToPrimitiveType.get(primitiveTokenKind);
       if (primitiveTypeKind == EdmPrimitiveTypeKind.Int64) {
         primitiveTypeKind = determineIntegerType(primitiveValueLiteral);
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a283bddb/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
index 852c43a..0ac888f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
@@ -19,9 +19,11 @@
 package org.apache.olingo.server.core.uri.parser;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
@@ -50,6 +52,42 @@ public class ParserHelper {
 
   private static final OData odata = new ODataImpl();
 
+  protected static final Map<TokenKind, EdmPrimitiveTypeKind> tokenToPrimitiveType;
+  static {
+    /* Enum and null are not present in the map. These have to be handled differently. */
+    Map<TokenKind, EdmPrimitiveTypeKind> temp = new HashMap<TokenKind, EdmPrimitiveTypeKind>();
+    temp.put(TokenKind.BooleanValue, EdmPrimitiveTypeKind.Boolean);
+    temp.put(TokenKind.StringValue, EdmPrimitiveTypeKind.String);
+    // TODO: Check if int64 is correct here or if it has to be decimal or single or double instead.
+    temp.put(TokenKind.IntegerValue, EdmPrimitiveTypeKind.Int64);
+    temp.put(TokenKind.GuidValue, EdmPrimitiveTypeKind.Guid);
+    temp.put(TokenKind.DateValue, EdmPrimitiveTypeKind.Date);
+    temp.put(TokenKind.DateTimeOffsetValue, EdmPrimitiveTypeKind.DateTimeOffset);
+    temp.put(TokenKind.TimeOfDayValue, EdmPrimitiveTypeKind.TimeOfDay);
+    temp.put(TokenKind.DecimalValue, EdmPrimitiveTypeKind.Decimal);
+    temp.put(TokenKind.DoubleValue, EdmPrimitiveTypeKind.Double);
+    temp.put(TokenKind.DurationValue, EdmPrimitiveTypeKind.Duration);
+    temp.put(TokenKind.BinaryValue, EdmPrimitiveTypeKind.Binary);
+
+    temp.put(TokenKind.GeographyPoint, EdmPrimitiveTypeKind.GeographyPoint);
+    temp.put(TokenKind.GeometryPoint, EdmPrimitiveTypeKind.GeometryPoint);
+    temp.put(TokenKind.GeographyLineString, EdmPrimitiveTypeKind.GeographyLineString);
+    temp.put(TokenKind.GeometryLineString, EdmPrimitiveTypeKind.GeometryLineString);
+    temp.put(TokenKind.GeographyPolygon, EdmPrimitiveTypeKind.GeographyPolygon);
+    temp.put(TokenKind.GeometryPolygon, EdmPrimitiveTypeKind.GeometryPolygon);
+    temp.put(TokenKind.GeographyMultiPoint, EdmPrimitiveTypeKind.GeographyMultiPoint);
+    temp.put(TokenKind.GeometryMultiPoint, EdmPrimitiveTypeKind.GeometryMultiPoint);
+    temp.put(TokenKind.GeographyMultiLineString, EdmPrimitiveTypeKind.GeographyMultiLineString);
+    temp.put(TokenKind.GeometryMultiLineString, EdmPrimitiveTypeKind.GeometryMultiLineString);
+    temp.put(TokenKind.GeographyMultiPolygon, EdmPrimitiveTypeKind.GeographyMultiPolygon);
+    temp.put(TokenKind.GeometryMultiPolygon, EdmPrimitiveTypeKind.GeometryMultiPolygon);
+    // TODO: Geo collections
+//    temp.put(TokenKind.GeographyCollection, EdmPrimitiveTypeKind.GeographyCollection);
+//    temp.put(TokenKind.GeometryCollection, EdmPrimitiveTypeKind.GeometryCollection);
+
+    tokenToPrimitiveType = Collections.unmodifiableMap(temp);
+  }
+
   public static void requireNext(UriTokenizer tokenizer, final TokenKind required) throws UriParserException {
     if (!tokenizer.next(required)) {
       throw new UriParserSyntaxException("Expected token '" + required.toString() + "' not found.",
@@ -88,7 +126,25 @@ public class ParserHelper {
 
         TokenKind.DurationValue,
         TokenKind.BinaryValue,
-        TokenKind.EnumValue);
+        TokenKind.EnumValue,
+
+        // Geography and geometry literals are defined to be primitive,
+        // although they contain several parts with their own meaning.
+        TokenKind.GeographyPoint,
+        TokenKind.GeometryPoint,
+        TokenKind.GeographyLineString,
+        TokenKind.GeometryLineString,
+        TokenKind.GeographyPolygon,
+        TokenKind.GeometryPolygon,
+        TokenKind.GeographyMultiPoint,
+        TokenKind.GeometryMultiPoint,
+        TokenKind.GeographyMultiLineString,
+        TokenKind.GeometryMultiLineString,
+        TokenKind.GeographyMultiPolygon,
+        TokenKind.GeometryMultiPolygon);
+        // TODO: Geo collections
+//        TokenKind.GeographyCollection,
+//        TokenKind.GeometryCollection);
   }
 
   protected static List<UriParameter> parseFunctionParameters(UriTokenizer tokenizer,
@@ -326,6 +382,7 @@ public class ParserHelper {
     } else if (nullable && tokenizer.next(TokenKind.NULL)) {
       return true;
 
+    // Special handling for frequently-used types and types with more than one token kind.
     } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean).equals(type)) {
       return tokenizer.next(TokenKind.BooleanValue);
     } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.String).equals(type)) {
@@ -338,31 +395,33 @@ public class ParserHelper {
       return tokenizer.next(TokenKind.IntegerValue);
     } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Guid).equals(type)) {
       return tokenizer.next(TokenKind.GuidValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Date).equals(type)) {
-      return tokenizer.next(TokenKind.DateValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.DateTimeOffset).equals(type)) {
-      return tokenizer.next(TokenKind.DateTimeOffsetValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.TimeOfDay).equals(type)) {
-      return tokenizer.next(TokenKind.TimeOfDayValue);
     } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Decimal).equals(type)) {
       // The order is important.
       // A decimal value should not be parsed as integer and let the tokenizer stop at the decimal point.
       return tokenizer.next(TokenKind.DecimalValue)
           || tokenizer.next(TokenKind.IntegerValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double).equals(type)) {
+    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Double).equals(type)
+        || odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Single).equals(type)) {
       // The order is important.
       // A floating-point value should not be parsed as decimal and let the tokenizer stop at 'E'.
       // A decimal value should not be parsed as integer and let the tokenizer stop at the decimal point.
       return tokenizer.next(TokenKind.DoubleValue)
           || tokenizer.next(TokenKind.DecimalValue)
           || tokenizer.next(TokenKind.IntegerValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Duration).equals(type)) {
-      return tokenizer.next(TokenKind.DurationValue);
-    } else if (odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Binary).equals(type)) {
-      return tokenizer.next(TokenKind.BinaryValue);
     } else if (type.getKind() == EdmTypeKind.ENUM) {
       return tokenizer.next(TokenKind.EnumValue);
     } else {
+      // Check the types that have not been checked already above.
+      for (final Entry<TokenKind, EdmPrimitiveTypeKind> entry : tokenToPrimitiveType.entrySet()) {
+        final EdmPrimitiveTypeKind kind = entry.getValue();
+        if ((kind == EdmPrimitiveTypeKind.Date || kind == EdmPrimitiveTypeKind.DateTimeOffset
+            || kind == EdmPrimitiveTypeKind.TimeOfDay || kind == EdmPrimitiveTypeKind.Duration
+            || kind == EdmPrimitiveTypeKind.Binary
+            || kind.isGeospatial())
+            && odata.createPrimitiveTypeInstance(kind).equals(type)) {
+          return tokenizer.next(entry.getKey());
+        }
+      }
       return false;
     }
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a283bddb/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
index 3b673a6..5a48cc1 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriTokenizer.java
@@ -84,6 +84,19 @@ public class UriTokenizer {
     BinaryValue,
     EnumValue,
 
+    GeographyPoint,
+    GeometryPoint,
+    GeographyLineString,
+    GeometryLineString,
+    GeographyPolygon,
+    GeometryPolygon,
+    GeographyMultiPoint,
+    GeometryMultiPoint,
+    GeographyMultiLineString,
+    GeometryMultiLineString,
+    GeographyMultiPolygon,
+    GeometryMultiPolygon,
+
     jsonArrayOrObject,
 
     Word,
@@ -322,6 +335,44 @@ public class UriTokenizer {
       found = nextEnumValue();
       break;
 
+    // Geo Values
+    case GeographyPoint:
+      found = nextGeoPoint(true);
+      break;
+    case GeometryPoint:
+      found = nextGeoPoint(false);
+      break;
+    case GeographyLineString:
+      found = nextGeoLineString(true);
+      break;
+    case GeometryLineString:
+      found = nextGeoLineString(false);
+      break;
+    case GeographyPolygon:
+      found = nextGeoPolygon(true);
+      break;
+    case GeometryPolygon:
+      found = nextGeoPolygon(false);
+      break;
+    case GeographyMultiPoint:
+      found = nextGeoMultiPoint(true);
+      break;
+    case GeometryMultiPoint:
+      found = nextGeoMultiPoint(false);
+      break;
+    case GeographyMultiLineString:
+      found = nextGeoMultiLineString(true);
+      break;
+    case GeometryMultiLineString:
+      found = nextGeoMultiLineString(false);
+      break;
+    case GeographyMultiPolygon:
+      found = nextGeoMultiPolygon(true);
+      break;
+    case GeometryMultiPolygon:
+      found = nextGeoMultiPolygon(false);
+      break;
+
     // Complex or Collection Value
     case jsonArrayOrObject:
       found = nextJsonArrayOrObject();
@@ -950,6 +1001,199 @@ public class UriTokenizer {
   }
 
   /**
+   * Moves past a geo prefix if found; otherwise leaves the index unchanged.
+   * @return whether a geo prefix has been found at the current index
+   */
+  private boolean nextGeoPrefix(final boolean isGeography) {
+    return nextConstantIgnoreCase(isGeography ? "geography" : "geometry");
+  }
+
+  /**
+   * Moves past an SRID if found; otherwise leaves the index unchanged.
+   * @return whether an SRID has been found at the current index
+   */
+  private boolean nextSrid() {
+    final int lastGoodIndex = index;
+    if (nextConstantIgnoreCase("SRID") && nextCharacter('=') && nextDigit()) {
+      // The digit checked above is mandatory, four more digits are optional.
+      nextDigit();
+      nextDigit();
+      nextDigit();
+      nextDigit();
+      return true;
+    } else {
+      index = lastGoodIndex;
+      return false;
+    }
+  }
+
+  /**
+   * Moves past a geo position if found; otherwise leaves the index unchanged.
+   * @return whether a geo position has been found at the current index
+   */
+  private boolean nextPosition() {
+    final int lastGoodIndex = index;
+    if ((nextDoubleValue() || nextDecimalValue() || nextIntegerValue(true))
+        && nextCharacter(' ')
+        && (nextDoubleValue() || nextDecimalValue() || nextIntegerValue(true))) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+      return false;
+    }
+  }
+
+  /**
+   * Moves past a geo-point data instance if found; otherwise leaves the index unchanged.
+   * @return whether a geo-point data instance has been found at the current index
+   */
+  private boolean nextPointData() {
+    final int lastGoodIndex = index;
+    if (nextCharacter('(') && nextPosition() && nextCharacter(')')) {
+      return true;
+    } else {
+      index = lastGoodIndex;
+      return false;
+    }
+  }
+
+  private boolean nextGeoPoint(final boolean isGeography) {
+    return nextGeoPrefix(isGeography) && nextCharacter('\'')
+        && nextSrid() && nextCharacter(';')
+        && nextConstantIgnoreCase("Point") && nextPointData()
+        && nextCharacter('\'');
+  }
+
+  /**
+   * Moves past geo LineString data if found; otherwise leaves the index unchanged.
+   * @param isRing whether the line is a closed ring (in that case it must have at least four positions,
+   *               and the last position must have the same coordinates as the first position)
+   * @return whether geo LineString data has been found at the current index
+   */
+  private boolean nextLineStringData(final boolean isRing) {
+    final int lastGoodIndex = index;
+    if (nextCharacter('(') && nextPosition()) {
+      int count = 1;
+      while (nextCharacter(',')) {
+        if (nextPosition()) {
+          count++;
+        } else {
+          index = lastGoodIndex;
+          return false;
+        }
+      }
+      // TODO: Check that the first and last ring positions are identical.
+      if (count < (isRing ? 4 : 2)) {
+        index = lastGoodIndex;
+        return false;
+      }
+      if (!nextCharacter(')')) {
+        index = lastGoodIndex;
+        return false;
+      }
+      return true;
+    } else {
+      index = lastGoodIndex;
+      return false;
+    }
+  }
+
+  private boolean nextGeoLineString(final boolean isGeography) {
+    return nextGeoPrefix(isGeography) && nextCharacter('\'')
+        && nextSrid() && nextCharacter(';')
+        && nextConstantIgnoreCase("LineString") && nextLineStringData(false)
+        && nextCharacter('\'');
+  }
+
+  /**
+   * Moves past geo polygon data if found; otherwise leaves the index unchanged.
+   * @return whether geo polygon data have been found at the current index
+   */
+  private boolean nextPolygonData() {
+    final int lastGoodIndex = index;
+    if (nextCharacter('(') && nextLineStringData(true)) {
+      // The polygon can have holes, described by further rings.
+      while (nextCharacter(',')) {
+        if (!nextLineStringData(true)) {
+          index = lastGoodIndex;
+          return false;
+        }
+      }
+      if (!nextCharacter(')')) {
+        index = lastGoodIndex;
+        return false;
+      }
+      return true;
+    } else {
+      index = lastGoodIndex;
+      return false;
+    }
+  }
+
+  private boolean nextGeoPolygon(final boolean isGeography) {
+    return nextGeoPrefix(isGeography) && nextCharacter('\'')
+        && nextSrid() && nextCharacter(';')
+        && nextConstantIgnoreCase("Polygon") && nextPolygonData()
+        && nextCharacter('\'');
+  }
+
+  private boolean nextMultiPoint() {
+    if (nextPointData()) {
+      while (nextCharacter(',')) {
+        if (!nextPointData()) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+
+  private boolean nextGeoMultiPoint(final boolean isGeography) {
+    return nextGeoPrefix(isGeography) && nextCharacter('\'')
+        && nextSrid() && nextCharacter(';')
+        && nextConstantIgnoreCase("MultiPoint") && nextCharacter('(') && nextMultiPoint() && nextCharacter(')')
+        && nextCharacter('\'');
+  }
+
+  private boolean nextMultiLineString() {
+    if (nextLineStringData(false)) {
+      while (nextCharacter(',')) {
+        if (!nextLineStringData(false)) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+
+  private boolean nextGeoMultiLineString(final boolean isGeography) {
+    return nextGeoPrefix(isGeography) && nextCharacter('\'')
+        && nextSrid() && nextCharacter(';')
+        && nextConstantIgnoreCase("MultiLineString")
+        && nextCharacter('(') && nextMultiLineString() && nextCharacter(')')
+        && nextCharacter('\'');
+  }
+
+  private boolean nextMultiPolygon() {
+    if (nextPolygonData()) {
+      while (nextCharacter(',')) {
+        if (!nextPolygonData()) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+
+  private boolean nextGeoMultiPolygon(final boolean isGeography) {
+    return nextGeoPrefix(isGeography) && nextCharacter('\'')
+        && nextSrid() && nextCharacter(';')
+        && nextConstantIgnoreCase("MultiPolygon")
+        && nextCharacter('(') && nextMultiPolygon() && nextCharacter(')')
+        && nextCharacter('\'');
+  }
+
+  /**
    * Moves past a JSON string if found; otherwise leaves the index unchanged.
    * @return whether a JSON string has been found at the current index
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a283bddb/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
index f495c5b..c764999 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/ExpressionParserTest.java
@@ -239,14 +239,17 @@ public class ExpressionParserTest {
     expression = parseMethod(TokenKind.ConcatMethod, "'a'", "'b'");
     assertEquals("{concat ['a', 'b']}", expression.toString());
 
-    // TODO: Geo methods.
-//    expression = parseMethod(TokenKind.GeoDistanceMethod,
-//        "geography'SRID=0;Point(1.2 3.4)'", "geography'SRID=0;Point(5.6 7.8)'");
-//    assertEquals("{geo.distance [geography'SRID=0;Point(1.2 3.4)', geography'SRID=0;Point(5.6 7.8)']}",
-//        expression.toString());
-//
-//    expression = parseMethod(TokenKind.GeoIntersectsMethod);
-//    assertEquals("{geo.intersects []}", expression.toString());
+    expression = parseMethod(TokenKind.GeoDistanceMethod,
+        "geography'SRID=0;Point(1.2 3.4)'", "geography'SRID=0;Point(5.6 7.8)'");
+    assertEquals("{geo.distance [geography'SRID=0;Point(1.2 3.4)', geography'SRID=0;Point(5.6 7.8)']}",
+        expression.toString());
+
+    expression = parseMethod(TokenKind.GeoIntersectsMethod,
+        "geometry'SRID=0;Point(1.2 3.4)'",
+        "geometry'SRID=0;Polygon((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1))'");
+    assertEquals("{geo.intersects [geometry'SRID=0;Point(1.2 3.4)', "
+        + "geometry'SRID=0;Polygon((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1))']}",
+        expression.toString());
 
     assertEquals("{startswith [null, 'b']}", parseMethod(TokenKind.StartswithMethod, null, "'b'").toString());
     assertEquals("{indexof ['a', null]}", parseMethod(TokenKind.IndexofMethod, "'a'", null).toString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a283bddb/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
index e130457..78c6204 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/UriTokenizerTest.java
@@ -560,6 +560,70 @@ public class UriTokenizerTest {
     assertFalse(new UriTokenizer("NOT").next(TokenKind.Word));
   }
 
+  @Test
+  public void geoPoint() {
+    assertTrue(new UriTokenizer("geography'SRID=4326;Point(1.23 4.56)'").next(TokenKind.GeographyPoint));
+    assertTrue(new UriTokenizer("GeOgRaPhY'SrId=4326;pOiNt(1 2)'").next(TokenKind.GeographyPoint));
+    assertTrue(new UriTokenizer("geography'srid=4326;point(1.2E3 4.5E-6)'").next(TokenKind.GeographyPoint));
+    wrongToken(TokenKind.GeographyPoint, "geography'SRID=4326;Point(1.23 4.56)'", 'x');
+
+    assertTrue(new UriTokenizer("geometry'SRID=0;Point(1 2)'").next(TokenKind.GeometryPoint));
+    assertFalse(new UriTokenizer("geometry'SRID=123456;Point(1 2)'").next(TokenKind.GeometryPoint));
+    assertFalse(new UriTokenizer("geometry'SRID=123456;Point(1)'").next(TokenKind.GeometryPoint));
+    wrongToken(TokenKind.GeometryPoint, "geometry'SRID=0;Point(1.23 4.56)'", ',');
+  }
+
+  @Test
+  public void geoLineString() {
+    assertTrue(new UriTokenizer("geography'SRID=4326;LineString(1.23 4.56,7 8)'")
+        .next(TokenKind.GeographyLineString));
+    wrongToken(TokenKind.GeographyLineString, "geography'SRID=4326;LineString(1.23 4.56,7 8)'", '{');
+
+    assertTrue(new UriTokenizer("geometry'SRID=0;LineString(1 2,3 4,5 6,7 8)'")
+        .next(TokenKind.GeometryLineString));
+    wrongToken(TokenKind.GeometryLineString, "geometry'SRID=0;LineString(1 2,3 4,5 6,7 8)'", '.');
+  }
+
+  @Test
+  public void geoPolygon() {
+    assertTrue(new UriTokenizer("geography'SRID=4326;Polygon((0 0,1 0,0 1,0 0))'").next(TokenKind.GeographyPolygon));
+    assertTrue(new UriTokenizer("geometry'SRID=0;Polygon((0 0,1 0,0 1,0 0))'").next(TokenKind.GeometryPolygon));
+    wrongToken(TokenKind.GeometryPolygon,
+        "geometry'SRID=0;Polygon((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1))'",
+        'x');
+  }
+
+  @Test
+  public void geoMultiPoint() {
+    assertTrue(new UriTokenizer("geography'SRID=4326;MultiPoint()'").next(TokenKind.GeographyMultiPoint));
+    assertTrue(new UriTokenizer("geography'SRID=4326;MultiPoint((0 0))'").next(TokenKind.GeographyMultiPoint));
+    assertTrue(new UriTokenizer("geometry'SRID=0;MultiPoint((0 0),(1 1))'").next(TokenKind.GeometryMultiPoint));
+    wrongToken(TokenKind.GeometryMultiPoint, "geometry'SRID=0;MultiPoint((0 0),(1 1),(2.3 4.5))'", 'x');
+  }
+
+  @Test
+  public void geoMultiLineString() {
+    assertTrue(new UriTokenizer("geography'SRID=4326;MultiLineString()'").next(TokenKind.GeographyMultiLineString));
+    assertTrue(new UriTokenizer("geography'SRID=4326;MultiLineString((1 2,3 4))'")
+        .next(TokenKind.GeographyMultiLineString));
+
+    wrongToken(TokenKind.GeometryMultiLineString,
+        "geometry'SRID=0;MultiLineString((1.23 4.56,7 8),(0 0,1 1),(2 2,3 3))'",
+        '}');
+  }
+
+  @Test
+  public void geoMultiPolygon() {
+    assertTrue(new UriTokenizer("geography'SRID=4326;MultiPolygon()'").next(TokenKind.GeographyMultiPolygon));
+    assertTrue(new UriTokenizer("geography'SRID=4326;MultiPolygon(((0 0,1 0,0 1,0 0)))'")
+        .next(TokenKind.GeographyMultiPolygon));
+
+    wrongToken(TokenKind.GeometryMultiPolygon,
+        "geometry'SRID=0;MultiPolygon(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)),"
+            + "((0 0,40 0,40 40,0 40,0 0),(10 10,20 10,20 20,10 20,10 10)))'",
+        'x');
+  }
+
   private void wrongToken(final TokenKind kind, final String value, final char disturbCharacter) {
     assertFalse(new UriTokenizer(disturbCharacter + value).next(kind));
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a283bddb/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
index fa7a0df..138e598 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
@@ -22,12 +22,12 @@ import java.util.Arrays;
 import java.util.Collections;
 
 import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.edmx.EdmxReference;
 import org.apache.olingo.server.api.uri.UriInfoKind;
 import org.apache.olingo.server.api.uri.UriResourceKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
 import org.apache.olingo.server.core.uri.testutil.FilterValidator;
 import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
 import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
@@ -38,11 +38,11 @@ import org.apache.olingo.server.tecsvc.provider.ContainerProvider;
 import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
 import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
 import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class TestUriParserImpl {
-  private final Edm edm = OData.newInstance().createServiceMetadata(
+  private static final OData oData = OData.newInstance();
+  private final Edm edm = oData.createServiceMetadata(
       new EdmTechProvider(), Collections.<EdmxReference> emptyList()).getEdm();
   private final TestUriValidator testUri = new TestUriValidator().setEdm(edm);
   private final ResourceValidator testRes = new ResourceValidator().setEdm(edm);
@@ -1031,16 +1031,17 @@ public class TestUriParserImpl {
   }
 
   @Test
-  @Ignore("Geo types are not supported yet.")
   public void geo() throws Exception {
-    testFilter.runOnETAllPrim("geo.distance(PropertySByte,PropertySByte)")
-        .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")
-        .isMethod(MethodKind.GEODISTANCE, 2);
-    testFilter.runOnETAllPrim("geo.length(PropertySByte)")
-        .is("<geo.length(<PropertySByte>)>")
-        .isMethod(MethodKind.GEOLENGTH, 1);
-    testFilter.runOnETAllPrim("geo.intersects(PropertySByte,PropertySByte)")
-        .is("<geo.intersects(<PropertySByte>,<PropertySByte>)>")
-        .isMethod(MethodKind.GEOINTERSECTS, 2);
+    testFilter.runOnETAllPrim("geo.distance(geometry'SRID=0;Point(0 0)',geometry'SRID=0;Point(1 1)') lt 1.5")
+        .left().isMethod(MethodKind.GEODISTANCE, 2)
+        .goParameter(0).isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.GeometryPoint))
+        .root().left()
+        .goParameter(1).isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.GeometryPoint));
+    testFilter.runOnETAllPrim("geo.length(geometry'SRID=0;LineString(0 0,1 1)') lt 1.5")
+        .left().isMethod(MethodKind.GEOLENGTH, 1)
+        .goParameter(0).isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.GeometryLineString));
+    testFilter.runOnETAllPrim("geo.intersects(geometry'SRID=0;Point(0 0)',null)")
+        .isMethod(MethodKind.GEOINTERSECTS, 2)
+        .goParameter(0).isLiteralType(oData.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.GeometryPoint));
   }
 }


[40/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] Fixed outdated versions

Posted by mi...@apache.org.
[OLINGO-841] Fixed outdated versions


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 58ead74ea131f91b9b97a4bf423a527b3dea8842
Parents: 26f7d2a
Author: Michael Bolz <mi...@sap.com>
Authored: Mon Jan 18 15:00:56 2016 +0100
Committer: Michael Bolz <mi...@sap.com>
Committed: Mon Jan 18 15:02:25 2016 +0100

----------------------------------------------------------------------
 ext/karaf/karaf-features/src/main/resources/features.xml  |  1 -
 .../apache/olingo/osgi/itests/server/CarServiceTest.java  |  2 +-
 samples/osgi/server/README.txt                            | 10 +++++-----
 3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/58ead74e/ext/karaf/karaf-features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-features/src/main/resources/features.xml b/ext/karaf/karaf-features/src/main/resources/features.xml
index 0f2b5f4..d4511a8 100644
--- a/ext/karaf/karaf-features/src/main/resources/features.xml
+++ b/ext/karaf/karaf-features/src/main/resources/features.xml
@@ -24,7 +24,6 @@
     <bundle>mvn:org.apache.commons/commons-lang3/${commons.lang3.version}</bundle>
     <bundle>mvn:org.codehaus.woodstox/stax2-api/${woodstox.stax2-api.version}</bundle>
     <bundle>mvn:com.fasterxml/aalto-xml/${aalto-xml.version}</bundle>
-    <bundle>wrap:mvn:org.antlr/antlr4-runtime/${antlr.version}/$Bundle-SymbolicName=antlr4-runtime&amp;Bundle-Version=${antlr.version}&amp;Export-Package=org.antlr.v4.runtime*</bundle>
 
     <bundle>mvn:com.fasterxml.jackson.core/jackson-core/${jackson.version}</bundle>
     <bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson.version}</bundle>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/58ead74e/ext/karaf/karaf-fit/src/test/java/org/apache/olingo/osgi/itests/server/CarServiceTest.java
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-fit/src/test/java/org/apache/olingo/osgi/itests/server/CarServiceTest.java b/ext/karaf/karaf-fit/src/test/java/org/apache/olingo/osgi/itests/server/CarServiceTest.java
index 06d35cb..50f0cba 100644
--- a/ext/karaf/karaf-fit/src/test/java/org/apache/olingo/osgi/itests/server/CarServiceTest.java
+++ b/ext/karaf/karaf-fit/src/test/java/org/apache/olingo/osgi/itests/server/CarServiceTest.java
@@ -96,7 +96,7 @@ public class CarServiceTest extends OlingoOSGiTestSupport {
         return new Option[] {
             olingoBaseConfig(),
             features(olingoUrl, "olingo-server", "olingo-client"),
-            mavenBundle("org.apache.olingo", "odata-server-osgi-sample", "4.1.0-SNAPSHOT"),
+            mavenBundle("org.apache.olingo", "odata-server-osgi-sample", "4.2.0-SNAPSHOT"),
             logLevel(LogLevel.INFO)
         };
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/58ead74e/samples/osgi/server/README.txt
----------------------------------------------------------------------
diff --git a/samples/osgi/server/README.txt b/samples/osgi/server/README.txt
index a8de60a..65ceaeb 100644
--- a/samples/osgi/server/README.txt
+++ b/samples/osgi/server/README.txt
@@ -86,7 +86,7 @@ To install the required bundles, you can simply install the Karaf olingo-server
 The following commands will install the olingo-server feature.
 
 ```
-feature:repo-add mvn:org.apache.olingo/odata-karaf-features/4.1.0-SNAPSHOT/xml/features
+feature:repo-add mvn:org.apache.olingo/odata-karaf-features/4.2.0-SNAPSHOT/xml/features
 feature:install olingo-server
 ```
 
@@ -95,16 +95,16 @@ feature:install olingo-server
 To install this sample bundle, run the karaf console command.
 
 ```
-bundle:install -s mvn:org.apache.olingo/odata-server-osgi-sample/4.1.0-SNAPSHOT
+bundle:install -s mvn:org.apache.olingo/odata-server-osgi-sample/4.2.0-SNAPSHOT
 ```
 
 Shown below is the output from running the above Karaf console commands.
 
 ```
-karaf@root()> feature:repo-add mvn:org.apache.olingo/odata-karaf-features/4.1.0-SNAPSHOT/xml/features
-Adding feature url mvn:org.apache.olingo/odata-karaf-features/4.1.0-SNAPSHOT/xml/features
+karaf@root()> feature:repo-add mvn:org.apache.olingo/odata-karaf-features/4.2.0-SNAPSHOT/xml/features
+Adding feature url mvn:org.apache.olingo/odata-karaf-features/4.2.0-SNAPSHOT/xml/features
 karaf@root()> feature:install olingo-server
-karaf@root()> bundle:install -s mvn:org.apache.olingo/odata-server-osgi-sample/4.1.0-SNAPSHOT
+karaf@root()> bundle:install -s mvn:org.apache.olingo/odata-server-osgi-sample/4.2.0-SNAPSHOT
 Bundle ID: 109
 ```
 


[22/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] $expand parser in Java + clean-up

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
deleted file mode 100644
index 36a0887..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
+++ /dev/null
@@ -1,115 +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.server.core.uri.parser;
-
-import java.util.ArrayDeque;
-import java.util.Deque;
-
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandItemImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectItemImpl;
-
-/**
- * UriContext object used for holding information for URI parsing.
- *
- */
-public class UriContext {
-
-  public static class LambdaVariable {
-    public String name;
-    public EdmType type;
-  }
-
-  /**
-   * Hold all currently allowed lambda variables
-   * As lambda functions can be nested there may be more than one allowed lambda variables at a time while parsing a
-   * $filter or $orderby expressions.
-   */
-  public Deque<LambdaVariable> allowedLambdaVariables;
-  /**
-   * Used to stack type information for nested $expand, $filter query options and other cases.
-   */
-  public Deque<EdmType> contextTypes;
-
-  /** Whether the context types are collections. */
-  public boolean isCollection;
-
-  // CHECKSTYLE:OFF (Maven checkstyle)
-  /**
-   * Set within method
-   * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandItem(org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandItemContext ctx)}
-   * and
-   * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandPathExtension(org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathExtensionContext ctx)}
-   * to allow nodes
-   * deeper in the expand tree at
-   * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitExpandPathExtension(org.apache.olingo.server.core.uri.antlr.UriParserParser.ExpandPathExtensionContext ctx)}
-   * appending path
-   * segments to the currently processed {@link ExpandItemImpl}.
-   */
-  public ExpandItemImpl contextExpandItemPath;
-  // CHECKSTYLE:ON (Maven checkstyle)
-  
-  //CHECKSTYLE:OFF (Maven checkstyle)
-  /**
-   * Set to true in method {@link UriParseTreeVisitor#visitExpandPath} right before 
-   * calling {@link  org.apache.olingo.server.core.uri.parser.UriParseTreeVisitor#readResourcePathSegment}
-   * After reading the path the variable is set back to false
-   * 
-   * readResourcePathSegment handles all navigation properties, it depends on the context if key predicates are allowed or not.
-   * In case of expand 
-   */
-  public boolean contextVisitExpandResourcePath;
-  //CHECKSTYLE:ON (Maven checkstyle)
-  
-  // CHECKSTYLE:OFF (Maven checkstyle)
-  /**
-   * Set within method
-   * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitSelectItem(org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectItemContext ctx)}
-   * to allow
-   * nodes
-   * deeper in the expand tree at
-   * {@link org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor#visitSelectSegment(org.apache.olingo.server.core.uri.antlr.UriParserParser.SelectSegmentContext ctx)}
-   * appending path segments to the
-   * currently processed {@link SelectItemImpl}.
-   */
-  public SelectItemImpl contextSelectItem;
-  // CHECKSTYLE:ON (Maven checkstyle)
-  /**
-   * Stores the currently processed UriInfo objects. There is one URI Info object for the resource path
-   * and one for each new first member access within $filter and $orderBy options.
-   */
-  public UriInfoImpl contextUriInfo;
-  public boolean contextReadingFunctionParameters;
-  
-  /**
-   * Set to true if the parser operates on query part.
-   */
-  public boolean contextReadingQueryPart;
-  
-  public UriContext() {
-
-    contextExpandItemPath = null;
-    contextReadingFunctionParameters = false;
-    contextSelectItem = null;
-    contextTypes = new ArrayDeque<EdmType>();
-    allowedLambdaVariables = new ArrayDeque<UriContext.LambdaVariable>();
-
-  }
-}
\ No newline at end of file


[19/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] $expand parser in Java + clean-up

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
index c27c960..a94026f 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
@@ -18,29 +18,19 @@
  */
 package org.apache.olingo.server.core.uri.antlr;
 
-import java.io.UnsupportedEncodingException;
 import java.util.Arrays;
 import java.util.Collections;
 
 import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
-import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.format.ContentType;
-import org.apache.olingo.commons.core.Encoder;
-import org.apache.olingo.commons.core.edm.primitivetype.EdmString;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.edmx.EdmxReference;
 import org.apache.olingo.server.api.uri.UriInfoKind;
 import org.apache.olingo.server.api.uri.UriResourceKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.uri.parser.UriParserException;
 import org.apache.olingo.server.core.uri.parser.UriParserSemanticException.MessageKeys;
 import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
 import org.apache.olingo.server.core.uri.parser.search.SearchParserException;
@@ -56,19 +46,17 @@ import org.apache.olingo.server.tecsvc.provider.EnumTypeProvider;
 import org.apache.olingo.server.tecsvc.provider.FunctionProvider;
 import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
 import org.apache.olingo.server.tecsvc.provider.TypeDefinitionProvider;
-import org.junit.Ignore;
 import org.junit.Test;
-import org.mockito.Mockito;
 
 public class TestFullResourcePath {
 
   private static final OData oData = OData.newInstance();
+  private static final Edm edm = oData.createServiceMetadata(
+      new EdmTechProvider(), Collections.<EdmxReference> emptyList()).getEdm();
   private final TestUriValidator testUri;
   private final FilterValidator testFilter;
 
   public TestFullResourcePath() {
-    final Edm edm = oData.createServiceMetadata(new EdmTechProvider(), Collections.<EdmxReference> emptyList())
-        .getEdm();
     testUri = new TestUriValidator().setEdm(edm);
     testFilter = new FilterValidator().setEdm(edm);
   }
@@ -1033,16 +1021,10 @@ public class TestFullResourcePath {
   public void resourcePathWithApostrophe() throws Exception {
     testUri.runEx("ESAllPrim'").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
     testUri.runEx("ESAllPrim'InvalidStuff").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-
-    testFilter.runOnETKeyNavEx("PropertyInt16' eq 0")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
-
-    testFilter.runOnETKeyNavEx("PropertyInt16 eq' 0")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
-
+    testFilter.runOnETKeyNavEx("PropertyInt16' eq 0").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
+    testFilter.runOnETKeyNavEx("PropertyInt16 eq' 0").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
     testFilter.runOnETKeyNavEx("PropertyInt16 eq 0'")
         .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
-
     testFilter.runOnETKeyNavEx("PropertyInt16 eq 'dsd''")
         .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
   }
@@ -1306,13 +1288,13 @@ public class TestFullResourcePath {
 
   @Test
   public void runEsNameParaKeys() throws Exception {
-    testUri.run(encode("ESAllKey(PropertyString='O''Neil',PropertyBoolean=true,PropertyByte=255,"
+    testUri.run("ESAllKey(PropertyString='O''Neil',PropertyBoolean=true,PropertyByte=255,"
         + "PropertySByte=-128,PropertyInt16=-32768,PropertyInt32=-2147483648,"
         + "PropertyInt64=-9223372036854775808,PropertyDecimal=1,PropertyDate=2013-09-25,"
         + "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00,"
         + "PropertyDuration=duration'P50903316DT2H25M4S',"
         + "PropertyGuid=12345678-1234-1234-1234-123456789012,"
-        + "PropertyTimeOfDay=12:34:55)"))
+        + "PropertyTimeOfDay=12:34:55)")
         .isKind(UriInfoKind.resource).goPath()
         .first()
         .isEntitySet("ESAllKey")
@@ -1380,12 +1362,11 @@ public class TestFullResourcePath {
         .isType(EntityTypeProvider.nameETTwoPrim)
         .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
 
-    // TODO: Keys cannot be specified twice.
-    //testUri.runEx("ESTwoPrim(1)/olingo.odata.test1.ETBase(1)")
-    //    .isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
-
-    //testUri.runEx("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase(1)")
-    //    .isExSemantic(MessageKeys.TYPE_FILTER_NOT_CHAINABLE);
+    // Keys cannot be specified twice.
+    testUri.runEx("ESTwoPrim(1)/olingo.odata.test1.ETBase(1)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+    testUri.runEx("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase(1)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
 
     testUri.runEx("ESBase/olingo.odata.test1.ETTwoPrim(1)").isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
   }
@@ -2321,8 +2302,7 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void runExpand() throws Exception {
-
+  public void expandStar() throws Exception {
     testUri.run("ESKeyNav(1)", "$expand=*")
         .isKind(UriInfoKind.resource).goPath().goExpand()
         .first()
@@ -2353,7 +2333,10 @@ public class TestFullResourcePath {
         .first()
         .isSegmentStar()
         .isLevelText("max");
+  }
 
+  @Test
+  public void expandNavigationRef() throws Exception {
     testUri.run("ESKeyNav(1)", "$expand=NavPropertyETKeyNavMany/$ref")
         .isKind(UriInfoKind.resource).goPath().goExpand()
         .first()
@@ -2441,7 +2424,10 @@ public class TestFullResourcePath {
         .goUpExpandValidator()
         .isSkipText("1")
         .isTopText("3");
+  }
 
+  @Test
+  public void expandNavigationCount() throws Exception {
     testUri.run("ESKeyNav(1)", "$expand=NavPropertyETKeyNavMany/$count")
         .isKind(UriInfoKind.resource).goPath().goExpand()
         .first()
@@ -2467,7 +2453,10 @@ public class TestFullResourcePath {
         .n().isCount()
         .goUpExpandValidator()
         .isFilterSerialized("<<PropertyInt16> gt <1>>");
+  }
 
+  @Test
+  public void expandNavigationOptions() throws Exception {
     testUri.run("ESKeyNav(1)", "$expand=NavPropertyETKeyNavMany($filter=PropertyInt16 eq 1)")
         .isKind(UriInfoKind.resource).goPath().goExpand()
         .first()
@@ -2521,7 +2510,6 @@ public class TestFullResourcePath {
         .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
         .isType(EntityTypeProvider.nameETKeyNav, true)
         .goUpExpandValidator()
-        .isSelectText("PropertyString")
         .goSelectItem(0).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
     testUri.run("ESKeyNav(1)", "$expand=NavPropertyETKeyNavMany($expand=NavPropertyETTwoKeyNavOne)")
@@ -2562,7 +2550,6 @@ public class TestFullResourcePath {
         .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
         .isType(EntityTypeProvider.nameETKeyNav, true)
         .goUpExpandValidator()
-        .isSelectText("PropertyString")
         .goSelectItem(0).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
     testUri.run("ESKeyNav(1)", "$expand=NavPropertyETKeyNavOne($levels=max)")
@@ -2594,6 +2581,12 @@ public class TestFullResourcePath {
         .isSkipText("1")
         .isTopText("2");
 
+    testUri.run("ESKeyNav(1)", "$expand=NavPropertyETKeyNavMany($search=Country AND Western)")
+        .isKind(UriInfoKind.resource).goPath().goExpand()
+        .first().goPath().first().isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+        .goUpExpandValidator()
+        .isSearchSerialized("{'Country' AND 'Western'}");
+
     testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='Hugo')", "$expand=NavPropertyETKeyNavMany")
         .isKind(UriInfoKind.resource).goPath()
         .first()
@@ -2604,7 +2597,10 @@ public class TestFullResourcePath {
         .goPath().first()
         .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
         .isType(EntityTypeProvider.nameETKeyNav, true);
+  }
 
+  @Test
+  public void expandTypeCasts() throws Exception {
     testUri.run("ESTwoKeyNav", "$expand=olingo.odata.test1.ETBaseTwoKeyNav/NavPropertyETKeyNavMany")
         .isKind(UriInfoKind.resource).goPath().first()
         .goExpand().first()
@@ -2635,15 +2631,13 @@ public class TestFullResourcePath {
         .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
 
     testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')",
-        "$expand=olingo.odata.test1.ETBaseTwoKeyNav"
-            + "/NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETTwoBaseTwoKeyNav")
+        "$expand=olingo.odata.test1.ETBaseTwoKeyNav/NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETTwoBaseTwoKeyNav")
         .isKind(UriInfoKind.resource).goPath().first()
         .isKeyPredicate(0, "PropertyInt16", "1")
         .isKeyPredicate(1, "PropertyString", "'2'")
         .goExpand().first()
         .isExpandStartType(EntityTypeProvider.nameETBaseTwoKeyNav)
         .goPath().first()
-        .isType(EntityTypeProvider.nameETTwoKeyNav)
         .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
         .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
 
@@ -2724,7 +2718,6 @@ public class TestFullResourcePath {
         .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
         .isType(EntityTypeProvider.nameETKeyNav)
         .goUpExpandValidator()
-        .isSelectText("PropertyInt16")
         .goSelectItem(0).isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
 
     testUri.run("ESKeyNav", "$expand=NavPropertyETKeyNavOne($select=PropertyCompNav/PropertyInt16)")
@@ -2735,7 +2728,9 @@ public class TestFullResourcePath {
         .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
         .isType(EntityTypeProvider.nameETKeyNav)
         .goUpExpandValidator()
-        .isSelectText("PropertyCompNav/PropertyInt16");
+        .goSelectItem(0)
+        .first().isComplexProperty("PropertyCompNav", ComplexTypeProvider.nameCTNavFiveProp, false)
+        .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
 
     testUri.runEx("ESKeyNav", "$expand=undefined")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
@@ -2744,7 +2739,7 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void runDuplicatedSystemQueryOptionsInExpand() throws UriParserException, UriValidationException {
+  public void duplicatedSystemQueryOptionsInExpand() throws Exception {
     testUri.runEx("ESKeyNav", "$expand=NavPropertyETKeyNavOne($select=PropertyInt16;$select=PropertyInt16)")
         .isExSyntax(UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION);
 
@@ -2768,11 +2763,7 @@ public class TestFullResourcePath {
 
     testUri.runEx("ESKeyNav", "$expand=NavPropertyETKeyNavOne($skip=2;$skip=2)")
         .isExSyntax(UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION);
-  }
 
-  @Test
-  @Ignore("$search in expand currently not implemented")
-  public void duplicatedSearchExpand() throws Exception {
     testUri.runEx("ESKeyNav", "$expand=NavPropertyETKeyNavOne($search=Test;$search=Test)")
         .isExSyntax(UriParserSyntaxException.MessageKeys.DOUBLE_SYSTEM_QUERY_OPTION);
   }
@@ -2906,8 +2897,7 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void runTop() throws Exception {
-    // top
+  public void top() throws Exception {
     testUri.run("ESKeyNav", "$top=1")
         .isKind(UriInfoKind.resource).goPath()
         .isEntitySet("ESKeyNav")
@@ -2918,20 +2908,16 @@ public class TestFullResourcePath {
         .isEntitySet("ESKeyNav")
         .isTopText("0");
 
-    testUri.run("ESKeyNav", "$top=-3")
-        .isKind(UriInfoKind.resource).goPath()
-        .isEntitySet("ESKeyNav")
-        .isTopText("-3");
-
     testUri.runEx("ESKeyNav", "$top=undefined")
         .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
     testUri.runEx("ESKeyNav", "$top=")
         .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
+    testUri.runEx("ESKeyNav", "$top=-3")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
   }
 
   @Test
-  public void runFormat() throws Exception {
-    // format
+  public void format() throws Exception {
     testUri.run("ESKeyNav(1)", "$format=atom")
         .isKind(UriInfoKind.resource).goPath()
         .isFormatText("atom");
@@ -2963,8 +2949,7 @@ public class TestFullResourcePath {
   }
 
   @Test
-  public void runCount() throws Exception {
-    // count
+  public void count() throws Exception {
     testUri.run("ESAllPrim", "$count=true")
         .isKind(UriInfoKind.resource).goPath()
         .isInlineCountText("true");
@@ -2979,20 +2964,19 @@ public class TestFullResourcePath {
 
   @Test
   public void skip() throws Exception {
-    // skip
     testUri.run("ESAllPrim", "$skip=3")
         .isKind(UriInfoKind.resource).goPath()
         .isSkipText("3");
     testUri.run("ESAllPrim", "$skip=0")
         .isKind(UriInfoKind.resource).goPath()
         .isSkipText("0");
-    testUri.run("ESAllPrim", "$skip=-3")
-        .isKind(UriInfoKind.resource).goPath()
-        .isSkipText("-3");
+
     testUri.runEx("ESAllPrim", "$skip=F")
         .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
     testUri.runEx("ESAllPrim", "$skip=")
         .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
+    testUri.runEx("ESAllPrim", "$skip=-3")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
   }
 
   @Test
@@ -3000,6 +2984,9 @@ public class TestFullResourcePath {
     testUri.run("ESAllPrim", "$skiptoken=foo")
         .isKind(UriInfoKind.resource).goPath()
         .isSkipTokenText("foo");
+
+    testUri.runEx("ESAllPrim", "$skiptoken=")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
   }
 
   @Test
@@ -3010,7 +2997,6 @@ public class TestFullResourcePath {
 
   @Test
   public void misc() throws Exception {
-
     testUri.run("")
         .isKind(UriInfoKind.service);
     testUri.run("/")
@@ -3227,56 +3213,47 @@ public class TestFullResourcePath {
         .isType(EntityTypeProvider.nameETTwoKeyNav)
         .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
         .n().isValue();
-
   }
 
-  // TODO
   @Test
   public void filter() throws Exception {
+    testFilter.runOnETAllPrim("PropertyBoolean")
+        .is("<PropertyBoolean>")
+        .isType(PropertyProvider.nameBoolean);
 
-    testFilter.runOnETTwoKeyNav("PropertyString")
-        .is("<PropertyString>")
-        .isType(PropertyProvider.nameString);
-
-    testFilter.runOnETTwoKeyNav("PropertyComp/PropertyInt16")
-        .is("<PropertyComp/PropertyInt16>")
-        .isType(PropertyProvider.nameInt16);
+    testFilter.runOnETTwoKeyNav("PropertyComp/PropertyInt16 gt 0")
+        .is("<<PropertyComp/PropertyInt16> gt <0>>")
+        .left().isType(PropertyProvider.nameInt16);
 
-    testFilter.runOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyDate")
-        .is("<PropertyComp/PropertyComp/PropertyDate>")
-        .isType(PropertyProvider.nameDate);
+    testFilter.runOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyDate ne null")
+        .is("<<PropertyComp/PropertyComp/PropertyDate> ne <null>>")
+        .left().isType(PropertyProvider.nameDate);
 
-    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne")
-        .is("<NavPropertyETTwoKeyNavOne>")
-        .isType(EntityTypeProvider.nameETTwoKeyNav);
+    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne eq null")
+        .is("<<NavPropertyETTwoKeyNavOne> eq <null>>")
+        .left().isType(EntityTypeProvider.nameETTwoKeyNav);
 
-    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyString")
-        .is("<NavPropertyETTwoKeyNavOne/PropertyString>")
-        .isType(PropertyProvider.nameString);
-
-    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyComp")
-        .is("<NavPropertyETTwoKeyNavOne/PropertyComp>")
-        .isType(ComplexTypeProvider.nameCTPrimComp);
+    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyString eq ''")
+        .is("<<NavPropertyETTwoKeyNavOne/PropertyString> eq <''>>")
+        .left().isType(PropertyProvider.nameString);
 
-    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyComp/PropertyComp")
-        .is("<NavPropertyETTwoKeyNavOne/PropertyComp/PropertyComp>")
-        .isType(ComplexTypeProvider.nameCTAllPrim);
+    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyComp eq null")
+        .is("<<NavPropertyETTwoKeyNavOne/PropertyComp> eq <null>>")
+        .left().isType(ComplexTypeProvider.nameCTPrimComp);
 
-    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyComp/PropertyInt16")
-        .is("<NavPropertyETTwoKeyNavOne/PropertyComp/PropertyInt16>")
-        .isType(PropertyProvider.nameInt16);
+    testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyComp/PropertyComp eq null")
+        .is("<<NavPropertyETTwoKeyNavOne/PropertyComp/PropertyComp> eq <null>>")
+        .left().isType(ComplexTypeProvider.nameCTAllPrim);
 
     testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/PropertyComp/PropertyInt16 eq 1")
         .is("<<NavPropertyETTwoKeyNavOne/PropertyComp/PropertyInt16> eq <1>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt16)
-        .root().right()
-        .isLiteral("1");
+        .left().isType(PropertyProvider.nameInt16)
+        .root().right().isLiteral("1");
 
     testFilter.runOnETTwoKeyNav("NavPropertyETKeyNavMany(1)/NavPropertyETTwoKeyNavMany(PropertyString='2')/"
         + "PropertyString eq 'SomeString'")
         .is("<<NavPropertyETKeyNavMany/NavPropertyETTwoKeyNavMany/PropertyString> eq <'SomeString'>>")
-        .root().left()
+        .left()
         .isType(PropertyProvider.nameString)
         .isMember().goPath()
         .first()
@@ -3293,7 +3270,7 @@ public class TestFullResourcePath {
 
     testFilter.runOnETTwoKeyNav("olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate eq 2013-11-12")
         .is("<<PropertyDate> eq <2013-11-12>>")
-        .root().left()
+        .left()
         .isType(PropertyProvider.nameDate)
         .isMember().isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
         .first().isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false)
@@ -3303,7 +3280,7 @@ public class TestFullResourcePath {
 
     testFilter.runOnCTTwoPrim("olingo.odata.test1.CTBase/AdditionalPropString eq 'SomeString'")
         .is("<<AdditionalPropString> eq <'SomeString'>>")
-        .root().left()
+        .left()
         .isType(PropertyProvider.nameString)
         .isMember().isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
         .first().isPrimitiveProperty("AdditionalPropString", PropertyProvider.nameString, false)
@@ -3314,7 +3291,7 @@ public class TestFullResourcePath {
     testFilter
         .runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate eq 2013-11-12")
         .is("<<NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate> eq <2013-11-12>>")
-        .root().left()
+        .left()
         .isType(PropertyProvider.nameDate)
         .root().right()
         .isLiteral("2013-11-12");
@@ -3322,20 +3299,15 @@ public class TestFullResourcePath {
     testFilter
         .runOnETTwoKeyNav("PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase/AdditionalPropString eq 'SomeString'")
         .is("<<PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase/AdditionalPropString> eq <'SomeString'>>")
-        .root().left()
+        .left()
         .isType(PropertyProvider.nameString)
         .root().right()
         .isLiteral("'SomeString'");
 
-    testFilter.runOnETTwoKeyNavEx("invalid")
-        .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
-    // TODO: This should throw an exception because the top node of the filter tree must be boolean.
-    // testFilter.runOnETTwoKeyNavEx("PropertyComp")
-    //     .isExSemantic(MessageKeys.UNKNOWN_TYPE);
-    testFilter.runOnETTwoKeyNavEx("PropertyComp/invalid")
-        .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
-    testFilter.runOnETTwoKeyNavEx("concat('a','b')/invalid")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
+    testFilter.runOnETTwoKeyNavEx("invalid").isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
+    testFilter.runOnETTwoKeyNavEx("PropertyComp").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
+    testFilter.runOnETTwoKeyNavEx("PropertyComp/invalid").isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
+    testFilter.runOnETTwoKeyNavEx("concat('a','b')/invalid").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/concat('a','b')")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyInt16 eq '1'")
@@ -3347,437 +3319,307 @@ public class TestFullResourcePath {
     testFilter.runOnETTwoKeyNavEx("PropertyComp/PropertyInt64 eq 1")
         .isExSemantic(MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
     testFilter.runOnETTwoKeyNavEx("NavPropertyETKeyNavMany/PropertyInt16 gt 42")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
+        .isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
     testFilter.runOnETTwoKeyNavEx("NavPropertyETKeyNavMany/NavPropertyETTwoKeyNavOne eq null")
-        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
+        .isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
+  }
 
+  @Test
+  public void filterBinaryOperators() throws Exception {
     testFilter.runOnETAllPrim("PropertySByte eq PropertySByte")
         .is("<<PropertySByte> eq <PropertySByte>>")
         .isBinary(BinaryOperatorKind.EQ)
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
+        .left().isType(PropertyProvider.nameSByte)
+        .root().right().isType(PropertyProvider.nameSByte);
 
     testFilter.runOnETAllPrim("PropertySByte ne PropertySByte")
         .is("<<PropertySByte> ne <PropertySByte>>")
         .isBinary(BinaryOperatorKind.NE)
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-
-    testFilter.runOnETAllPrim("PropertySByte add PropertySByte")
-        .is("<<PropertySByte> add <PropertySByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-
-    testFilter.runOnETAllPrim("PropertyByte add PropertyByte")
-        .is("<<PropertyByte> add <PropertyByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameByte);
-    testFilter.runOnETAllPrim("PropertyInt16 add PropertyInt16")
-        .is("<<PropertyInt16> add <PropertyInt16>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt16)
-        .root().right()
-        .isType(PropertyProvider.nameInt16);
-    testFilter.runOnETAllPrim("PropertyInt32 add PropertyInt32")
-        .is("<<PropertyInt32> add <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt32)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-
-    testFilter.runOnETAllPrim("PropertyInt64 add PropertyInt64")
-        .is("<<PropertyInt64> add <PropertyInt64>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameInt64);
-    testFilter.runOnETAllPrim("PropertySingle add PropertySingle")
-        .is("<<PropertySingle> add <PropertySingle>>")
-        .root().left()
-        .isType(PropertyProvider.nameSingle)
-        .root().right()
-        .isType(PropertyProvider.nameSingle);
-    testFilter.runOnETAllPrim("PropertyDouble add PropertyDouble")
-        .is("<<PropertyDouble> add <PropertyDouble>>")
-        .root().left()
-        .isType(PropertyProvider.nameDouble)
-        .root().right()
-        .isType(PropertyProvider.nameDouble);
-    testFilter.runOnETAllPrim("PropertyDecimal add PropertyDecimal")
-        .is("<<PropertyDecimal> add <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
-    testFilter.runOnETAllPrim("PropertySByte add PropertyDecimal")
-        .is("<<PropertySByte> add <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
-    testFilter.runOnETAllPrim("PropertySByte add PropertyInt32")
-        .is("<<PropertySByte> add <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertySByte add PropertyInt64")
-        .is("<<PropertySByte> add <PropertyInt64>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameInt64);
-    testFilter.runOnETAllPrim("PropertyDateTimeOffset add PropertyDuration")
-        .is("<<PropertyDateTimeOffset> add <PropertyDuration>>")
-        .root().left()
-        .isType(PropertyProvider.nameDateTimeOffset)
-        .root().right()
-        .isType(PropertyProvider.nameDuration);
-    testFilter.runOnETAllPrim("PropertyDuration add PropertyDuration")
-        .is("<<PropertyDuration> add <PropertyDuration>>")
-        .root().left()
-        .isType(PropertyProvider.nameDuration)
-        .root().right()
-        .isType(PropertyProvider.nameDuration);
-    testFilter.runOnETAllPrim("PropertyDate add PropertyDuration")
-        .is("<<PropertyDate> add <PropertyDuration>>")
-        .root().left()
-        .isType(PropertyProvider.nameDate)
-        .root().right()
-        .isType(PropertyProvider.nameDuration);
-    testFilter.runOnETAllPrim("PropertySByte sub PropertySByte")
-        .is("<<PropertySByte> sub <PropertySByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-    testFilter.runOnETAllPrim("PropertyByte sub PropertyByte")
-        .is("<<PropertyByte> sub <PropertyByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameByte);
-    testFilter.runOnETAllPrim("PropertyInt16 sub PropertyInt16")
-        .is("<<PropertyInt16> sub <PropertyInt16>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt16)
-        .root().right()
-        .isType(PropertyProvider.nameInt16);
-    testFilter.runOnETAllPrim("PropertyInt32 sub PropertyInt32")
-        .is("<<PropertyInt32> sub <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt32)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertyInt64 sub PropertyInt64")
-        .is("<<PropertyInt64> sub <PropertyInt64>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameInt64);
-    testFilter.runOnETAllPrim("PropertySingle sub PropertySingle")
-        .is("<<PropertySingle> sub <PropertySingle>>")
-        .root().left()
-        .isType(PropertyProvider.nameSingle)
-        .root().right()
-        .isType(PropertyProvider.nameSingle);
-    testFilter.runOnETAllPrim("PropertyDouble sub PropertyDouble")
-        .is("<<PropertyDouble> sub <PropertyDouble>>")
-        .root().left()
-        .isType(PropertyProvider.nameDouble)
-        .root().right()
-        .isType(PropertyProvider.nameDouble);
-    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyDecimal")
-        .is("<<PropertyDecimal> sub <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
-    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyInt32")
-        .is("<<PropertyDecimal> sub <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyInt64")
-        .is("<<PropertyDecimal> sub <PropertyInt64>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameInt64);
-    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyByte")
-        .is("<<PropertyDecimal> sub <PropertyByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameByte);
-    testFilter.runOnETAllPrim("PropertyDateTimeOffset sub PropertyDuration")
-        .is("<<PropertyDateTimeOffset> sub <PropertyDuration>>")
-        .root().left()
-        .isType(PropertyProvider.nameDateTimeOffset)
-        .root().right()
-        .isType(PropertyProvider.nameDuration);
-    testFilter.runOnETAllPrim("PropertyDuration sub PropertyDuration")
-        .is("<<PropertyDuration> sub <PropertyDuration>>")
-        .root().left()
-        .isType(PropertyProvider.nameDuration)
-        .root().right()
-        .isType(PropertyProvider.nameDuration);
-    testFilter.runOnETAllPrim("PropertyDateTimeOffset sub PropertyDateTimeOffset")
-        .is("<<PropertyDateTimeOffset> sub <PropertyDateTimeOffset>>")
-        .root().left()
-        .isType(PropertyProvider.nameDateTimeOffset)
-        .root().right()
-        .isType(PropertyProvider.nameDateTimeOffset);
-    testFilter.runOnETAllPrim("PropertyDate sub PropertyDuration")
-        .is("<<PropertyDate> sub <PropertyDuration>>")
-        .root().left()
-        .isType(PropertyProvider.nameDate)
-        .root().right()
-        .isType(PropertyProvider.nameDuration);
-    testFilter.runOnETAllPrim("PropertyDate sub PropertyDate")
-        .is("<<PropertyDate> sub <PropertyDate>>")
-        .root().left()
-        .isType(PropertyProvider.nameDate)
-        .root().right()
-        .isType(PropertyProvider.nameDate);
-    testFilter.runOnETAllPrim("PropertySByte mul PropertySByte")
-        .is("<<PropertySByte> mul <PropertySByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-    testFilter.runOnETAllPrim("PropertyByte mul PropertyByte")
-        .is("<<PropertyByte> mul <PropertyByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameByte);
-    testFilter.runOnETAllPrim("PropertyInt16 mul PropertyInt16")
-        .is("<<PropertyInt16> mul <PropertyInt16>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt16)
-        .root().right()
-        .isType(PropertyProvider.nameInt16);
-    testFilter.runOnETAllPrim("PropertyInt32 mul PropertyInt32")
-        .is("<<PropertyInt32> mul <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt32)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertyInt64 mul PropertyInt64")
-        .is("<<PropertyInt64> mul <PropertyInt64>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameInt64);
-    testFilter.runOnETAllPrim("PropertySingle mul PropertySingle")
-        .is("<<PropertySingle> mul <PropertySingle>>")
-        .root().left()
-        .isType(PropertyProvider.nameSingle)
-        .root().right()
-        .isType(PropertyProvider.nameSingle);
-    testFilter.runOnETAllPrim("PropertyDouble mul PropertyDouble")
-        .is("<<PropertyDouble> mul <PropertyDouble>>")
-        .root().left()
-        .isType(PropertyProvider.nameDouble)
-        .root().right()
-        .isType(PropertyProvider.nameDouble);
-    testFilter.runOnETAllPrim("PropertyDecimal mul PropertyDecimal")
-        .is("<<PropertyDecimal> mul <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
-    testFilter.runOnETAllPrim("PropertyInt64 mul PropertyInt32")
-        .is("<<PropertyInt64> mul <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertyInt64 mul PropertySByte")
-        .is("<<PropertyInt64> mul <PropertySByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-    testFilter.runOnETAllPrim("PropertyInt64 mul PropertyDecimal")
-        .is("<<PropertyInt64> mul <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
-    testFilter.runOnETAllPrim("PropertySByte div PropertySByte")
-        .is("<<PropertySByte> div <PropertySByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-    testFilter.runOnETAllPrim("PropertyByte div PropertyByte")
-        .is("<<PropertyByte> div <PropertyByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameByte);
-    testFilter.runOnETAllPrim("PropertyInt16 div PropertyInt16")
-        .is("<<PropertyInt16> div <PropertyInt16>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt16)
-        .root().right()
-        .isType(PropertyProvider.nameInt16);
-    testFilter.runOnETAllPrim("PropertyInt32 div PropertyInt32")
-        .is("<<PropertyInt32> div <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt32)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertyInt64 div PropertyInt64")
-        .is("<<PropertyInt64> div <PropertyInt64>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameInt64);
-    testFilter.runOnETAllPrim("PropertySingle div PropertySingle")
-        .is("<<PropertySingle> div <PropertySingle>>")
-        .root().left()
-        .isType(PropertyProvider.nameSingle)
-        .root().right()
-        .isType(PropertyProvider.nameSingle);
-    testFilter.runOnETAllPrim("PropertyDouble div PropertyDouble")
-        .is("<<PropertyDouble> div <PropertyDouble>>")
-        .root().left()
-        .isType(PropertyProvider.nameDouble)
-        .root().right()
-        .isType(PropertyProvider.nameDouble);
-    testFilter.runOnETAllPrim("PropertyDecimal div PropertyDecimal")
-        .is("<<PropertyDecimal> div <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
-    testFilter.runOnETAllPrim("PropertyByte div PropertyInt32")
-        .is("<<PropertyByte> div <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertyByte div PropertyDecimal")
-        .is("<<PropertyByte> div <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
-    testFilter.runOnETAllPrim("PropertyByte div PropertySByte")
-        .is("<<PropertyByte> div <PropertySByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-
-    testFilter.runOnETAllPrim("PropertyByte div 0")
-        .is("<<PropertyByte> div <0>>");
-
-    testFilter.runOnETAllPrim("0 div 0")
-        .is("<<0> div <0>>");
-
-    testFilter.runOnETAllPrim("PropertySByte mod PropertySByte")
-        .is("<<PropertySByte> mod <PropertySByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameSByte)
-        .root().right()
-        .isType(PropertyProvider.nameSByte);
-    testFilter.runOnETAllPrim("PropertyByte mod PropertyByte")
-        .is("<<PropertyByte> mod <PropertyByte>>")
-        .root().left()
-        .isType(PropertyProvider.nameByte)
-        .root().right()
-        .isType(PropertyProvider.nameByte);
-    testFilter.runOnETAllPrim("PropertyInt16 mod PropertyInt16")
-        .is("<<PropertyInt16> mod <PropertyInt16>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt16)
-        .root().right()
-        .isType(PropertyProvider.nameInt16);
-    testFilter.runOnETAllPrim("PropertyInt32 mod PropertyInt32")
-        .is("<<PropertyInt32> mod <PropertyInt32>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt32)
-        .root().right()
-        .isType(PropertyProvider.nameInt32);
-    testFilter.runOnETAllPrim("PropertyInt64 mod PropertyInt64")
-        .is("<<PropertyInt64> mod <PropertyInt64>>")
-        .root().left()
-        .isType(PropertyProvider.nameInt64)
-        .root().right()
-        .isType(PropertyProvider.nameInt64);
-    testFilter.runOnETAllPrim("PropertySingle mod PropertySingle")
-        .is("<<PropertySingle> mod <PropertySingle>>")
-        .root().left()
-        .isType(PropertyProvider.nameSingle)
-        .root().right()
-        .isType(PropertyProvider.nameSingle);
-    testFilter.runOnETAllPrim("PropertyDouble mod PropertyDouble")
-        .is("<<PropertyDouble> mod <PropertyDouble>>")
-        .root().left()
-        .isType(PropertyProvider.nameDouble)
-        .root().right()
-        .isType(PropertyProvider.nameDouble);
-    testFilter.runOnETAllPrim("PropertyDecimal mod PropertyDecimal")
-        .is("<<PropertyDecimal> mod <PropertyDecimal>>")
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
+        .left().isType(PropertyProvider.nameSByte)
+        .root().right().isType(PropertyProvider.nameSByte);
+
+    testFilter.runOnETAllPrim("PropertySByte add PropertySByte gt 0")
+        .is("<<<PropertySByte> add <PropertySByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameSByte);
+
+    testFilter.runOnETAllPrim("PropertyByte add PropertyByte gt 0")
+        .is("<<<PropertyByte> add <PropertyByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameByte);
+    testFilter.runOnETAllPrim("PropertyInt16 add PropertyInt16 gt 0")
+        .is("<<<PropertyInt16> add <PropertyInt16>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt16)
+        .root().left().right().isType(PropertyProvider.nameInt16);
+    testFilter.runOnETAllPrim("PropertyInt32 add PropertyInt32 gt 0")
+        .is("<<<PropertyInt32> add <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt32)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyInt64 add PropertyInt64 gt 0")
+        .is("<<<PropertyInt64> add <PropertyInt64>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameInt64);
+    testFilter.runOnETAllPrim("PropertySingle add PropertySingle gt 0")
+        .is("<<<PropertySingle> add <PropertySingle>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSingle)
+        .root().left().right().isType(PropertyProvider.nameSingle);
+    testFilter.runOnETAllPrim("PropertyDouble add PropertyDouble gt 0")
+        .is("<<<PropertyDouble> add <PropertyDouble>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDouble)
+        .root().left().right().isType(PropertyProvider.nameDouble);
+    testFilter.runOnETAllPrim("PropertyDecimal add PropertyDecimal gt 0")
+        .is("<<<PropertyDecimal> add <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
+    testFilter.runOnETAllPrim("PropertySByte add PropertyDecimal gt 0")
+        .is("<<<PropertySByte> add <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
+    testFilter.runOnETAllPrim("PropertySByte add PropertyInt32 gt 0")
+        .is("<<<PropertySByte> add <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertySByte add PropertyInt64 gt 0")
+        .is("<<<PropertySByte> add <PropertyInt64>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameInt64);
+    testFilter.runOnETAllPrim("PropertyDateTimeOffset add PropertyDuration ne null")
+        .is("<<<PropertyDateTimeOffset> add <PropertyDuration>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDateTimeOffset)
+        .root().left().right().isType(PropertyProvider.nameDuration);
+    testFilter.runOnETAllPrim("PropertyDuration add PropertyDuration ne null")
+        .is("<<<PropertyDuration> add <PropertyDuration>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDuration)
+        .root().left().right().isType(PropertyProvider.nameDuration);
+    testFilter.runOnETAllPrim("PropertyDate add PropertyDuration ne null")
+        .is("<<<PropertyDate> add <PropertyDuration>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDate)
+        .root().left().right().isType(PropertyProvider.nameDuration);
+    testFilter.runOnETAllPrim("PropertySByte sub PropertySByte gt 0")
+        .is("<<<PropertySByte> sub <PropertySByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameSByte);
+    testFilter.runOnETAllPrim("PropertyByte sub PropertyByte gt 0")
+        .is("<<<PropertyByte> sub <PropertyByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameByte);
+    testFilter.runOnETAllPrim("PropertyInt16 sub PropertyInt16 gt 0")
+        .is("<<<PropertyInt16> sub <PropertyInt16>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt16)
+        .root().left().right().isType(PropertyProvider.nameInt16);
+    testFilter.runOnETAllPrim("PropertyInt32 sub PropertyInt32 gt 0")
+        .is("<<<PropertyInt32> sub <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt32)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyInt64 sub PropertyInt64 gt 0")
+        .is("<<<PropertyInt64> sub <PropertyInt64>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameInt64);
+    testFilter.runOnETAllPrim("PropertySingle sub PropertySingle gt 0")
+        .is("<<<PropertySingle> sub <PropertySingle>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSingle)
+        .root().left().right().isType(PropertyProvider.nameSingle);
+    testFilter.runOnETAllPrim("PropertyDouble sub PropertyDouble gt 0")
+        .is("<<<PropertyDouble> sub <PropertyDouble>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDouble)
+        .root().left().right().isType(PropertyProvider.nameDouble);
+    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyDecimal gt 0")
+        .is("<<<PropertyDecimal> sub <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
+    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyInt32 gt 0")
+        .is("<<<PropertyDecimal> sub <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyInt64 gt 0")
+        .is("<<<PropertyDecimal> sub <PropertyInt64>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameInt64);
+    testFilter.runOnETAllPrim("PropertyDecimal sub PropertyByte gt 0")
+        .is("<<<PropertyDecimal> sub <PropertyByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameByte);
+    testFilter.runOnETAllPrim("PropertyDateTimeOffset sub PropertyDuration ne null")
+        .is("<<<PropertyDateTimeOffset> sub <PropertyDuration>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDateTimeOffset)
+        .root().left().right().isType(PropertyProvider.nameDuration);
+    testFilter.runOnETAllPrim("PropertyDuration sub PropertyDuration ne null")
+        .is("<<<PropertyDuration> sub <PropertyDuration>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDuration)
+        .root().left().right().isType(PropertyProvider.nameDuration);
+    testFilter.runOnETAllPrim("PropertyDateTimeOffset sub PropertyDateTimeOffset ne null")
+        .is("<<<PropertyDateTimeOffset> sub <PropertyDateTimeOffset>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDateTimeOffset)
+        .root().left().right().isType(PropertyProvider.nameDateTimeOffset);
+    testFilter.runOnETAllPrim("PropertyDate sub PropertyDuration ne null")
+        .is("<<<PropertyDate> sub <PropertyDuration>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDate)
+        .root().left().right().isType(PropertyProvider.nameDuration);
+    testFilter.runOnETAllPrim("PropertyDate sub PropertyDate ne null")
+        .is("<<<PropertyDate> sub <PropertyDate>> ne <null>>")
+        .left().left().isType(PropertyProvider.nameDate)
+        .root().left().right().isType(PropertyProvider.nameDate);
+    testFilter.runOnETAllPrim("PropertySByte mul PropertySByte gt 0")
+        .is("<<<PropertySByte> mul <PropertySByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameSByte);
+    testFilter.runOnETAllPrim("PropertyByte mul PropertyByte gt 0")
+        .is("<<<PropertyByte> mul <PropertyByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameByte);
+    testFilter.runOnETAllPrim("PropertyInt16 mul PropertyInt16 gt 0")
+        .is("<<<PropertyInt16> mul <PropertyInt16>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt16)
+        .root().left().right().isType(PropertyProvider.nameInt16);
+    testFilter.runOnETAllPrim("PropertyInt32 mul PropertyInt32 gt 0")
+        .is("<<<PropertyInt32> mul <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt32)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyInt64 mul PropertyInt64 gt 0")
+        .is("<<<PropertyInt64> mul <PropertyInt64>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameInt64);
+    testFilter.runOnETAllPrim("PropertySingle mul PropertySingle gt 0")
+        .is("<<<PropertySingle> mul <PropertySingle>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSingle)
+        .root().left().right().isType(PropertyProvider.nameSingle);
+    testFilter.runOnETAllPrim("PropertyDouble mul PropertyDouble gt 0")
+        .is("<<<PropertyDouble> mul <PropertyDouble>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDouble)
+        .root().left().right().isType(PropertyProvider.nameDouble);
+    testFilter.runOnETAllPrim("PropertyDecimal mul PropertyDecimal gt 0")
+        .is("<<<PropertyDecimal> mul <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
+    testFilter.runOnETAllPrim("PropertyInt64 mul PropertyInt32 gt 0")
+        .is("<<<PropertyInt64> mul <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyInt64 mul PropertySByte gt 0")
+        .is("<<<PropertyInt64> mul <PropertySByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameSByte);
+    testFilter.runOnETAllPrim("PropertyInt64 mul PropertyDecimal gt 0")
+        .is("<<<PropertyInt64> mul <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
+    testFilter.runOnETAllPrim("PropertySByte div PropertySByte gt 0")
+        .is("<<<PropertySByte> div <PropertySByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameSByte);
+    testFilter.runOnETAllPrim("PropertyByte div PropertyByte gt 0")
+        .is("<<<PropertyByte> div <PropertyByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameByte);
+    testFilter.runOnETAllPrim("PropertyInt16 div PropertyInt16 gt 0")
+        .is("<<<PropertyInt16> div <PropertyInt16>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt16)
+        .root().left().right().isType(PropertyProvider.nameInt16);
+    testFilter.runOnETAllPrim("PropertyInt32 div PropertyInt32 gt 0")
+        .is("<<<PropertyInt32> div <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt32)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyInt64 div PropertyInt64 gt 0")
+        .is("<<<PropertyInt64> div <PropertyInt64>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameInt64);
+    testFilter.runOnETAllPrim("PropertySingle div PropertySingle gt 0")
+        .is("<<<PropertySingle> div <PropertySingle>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSingle)
+        .root().left().right().isType(PropertyProvider.nameSingle);
+    testFilter.runOnETAllPrim("PropertyDouble div PropertyDouble gt 0")
+        .is("<<<PropertyDouble> div <PropertyDouble>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDouble)
+        .root().left().right().isType(PropertyProvider.nameDouble);
+    testFilter.runOnETAllPrim("PropertyDecimal div PropertyDecimal gt 0")
+        .is("<<<PropertyDecimal> div <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
+    testFilter.runOnETAllPrim("PropertyByte div PropertyInt32 gt 0")
+        .is("<<<PropertyByte> div <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyByte div PropertyDecimal gt 0")
+        .is("<<<PropertyByte> div <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
+    testFilter.runOnETAllPrim("PropertyByte div PropertySByte gt 0")
+        .is("<<<PropertyByte> div <PropertySByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameSByte);
+
+    testFilter.runOnETAllPrim("PropertyByte div 0 gt 0")
+        .is("<<<PropertyByte> div <0>> gt <0>>");
+
+    testFilter.runOnETAllPrim("0 div 0 gt 0")
+        .is("<<<0> div <0>> gt <0>>");
+
+    testFilter.runOnETAllPrim("PropertySByte mod PropertySByte gt 0")
+        .is("<<<PropertySByte> mod <PropertySByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSByte)
+        .root().left().right().isType(PropertyProvider.nameSByte);
+    testFilter.runOnETAllPrim("PropertyByte mod PropertyByte gt 0")
+        .is("<<<PropertyByte> mod <PropertyByte>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameByte)
+        .root().left().right().isType(PropertyProvider.nameByte);
+    testFilter.runOnETAllPrim("PropertyInt16 mod PropertyInt16 gt 0")
+        .is("<<<PropertyInt16> mod <PropertyInt16>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt16)
+        .root().left().right().isType(PropertyProvider.nameInt16);
+    testFilter.runOnETAllPrim("PropertyInt32 mod PropertyInt32 gt 0")
+        .is("<<<PropertyInt32> mod <PropertyInt32>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt32)
+        .root().left().right().isType(PropertyProvider.nameInt32);
+    testFilter.runOnETAllPrim("PropertyInt64 mod PropertyInt64 gt 0")
+        .is("<<<PropertyInt64> mod <PropertyInt64>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameInt64)
+        .root().left().right().isType(PropertyProvider.nameInt64);
+    testFilter.runOnETAllPrim("PropertySingle mod PropertySingle gt 0")
+        .is("<<<PropertySingle> mod <PropertySingle>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameSingle)
+        .root().left().right().isType(PropertyProvider.nameSingle);
+    testFilter.runOnETAllPrim("PropertyDouble mod PropertyDouble gt 0")
+        .is("<<<PropertyDouble> mod <PropertyDouble>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDouble)
+        .root().left().right().isType(PropertyProvider.nameDouble);
+    testFilter.runOnETAllPrim("PropertyDecimal mod PropertyDecimal gt 0")
+        .is("<<<PropertyDecimal> mod <PropertyDecimal>> gt <0>>")
+        .left().left().isType(PropertyProvider.nameDecimal)
+        .root().left().right().isType(PropertyProvider.nameDecimal);
 
     testFilter.runOnETAllPrim("PropertyDecimal ge PropertyDecimal")
         .is("<<PropertyDecimal> ge <PropertyDecimal>>")
         .isBinary(BinaryOperatorKind.GE)
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
+        .left().isType(PropertyProvider.nameDecimal)
+        .root().right().isType(PropertyProvider.nameDecimal);
     testFilter.runOnETAllPrim("PropertyDecimal lt PropertyDecimal")
         .is("<<PropertyDecimal> lt <PropertyDecimal>>")
         .isBinary(BinaryOperatorKind.LT)
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
+        .left().isType(PropertyProvider.nameDecimal)
+        .root().right().isType(PropertyProvider.nameDecimal);
     testFilter.runOnETAllPrim("PropertyDecimal le PropertyDecimal")
         .is("<<PropertyDecimal> le <PropertyDecimal>>")
         .isBinary(BinaryOperatorKind.LE)
-        .root().left()
-        .isType(PropertyProvider.nameDecimal)
-        .root().right()
-        .isType(PropertyProvider.nameDecimal);
+        .left().isType(PropertyProvider.nameDecimal)
+        .root().right().isType(PropertyProvider.nameDecimal);
 
-    // Numeric promotion: Double is considered the widest type
-    testFilter.runOnETAllPrim("PropertyDecimal sub NaN")
+    // Numeric promotion: Double is considered the widest type.
+    testFilter.runOnETAllPrim("PropertyDecimal ne NaN")
         .right().isLiteral("NaN").isType(PropertyProvider.nameDouble);
-    testFilter.runOnETAllPrim("PropertyDecimal sub -INF")
+    testFilter.runOnETAllPrim("PropertyDecimal gt -INF")
         .right().isLiteral("-INF").isType(PropertyProvider.nameDouble);
-    testFilter.runOnETAllPrim("PropertyDecimal sub INF")
+    testFilter.runOnETAllPrim("PropertyDecimal lt INF")
         .right().isLiteral("INF").isType(PropertyProvider.nameDouble);
   }
 
-  // TODO
   @Test
-  @Ignore
   public void filterProperties() throws Exception {
     testFilter.runOnETAllPrim("PropertyBoolean eq true")
         .is("<<PropertyBoolean> eq <true>>")
         .isBinary(BinaryOperatorKind.EQ)
         .root().left().goPath().isPrimitiveProperty("PropertyBoolean", PropertyProvider.nameBoolean, false)
         .goUpFilterValidator()
-        .root().right().isTrue();
+        .root().right().isLiteral("true");
 
     testFilter.runOnETAllPrim("PropertyDecimal eq 1.25")
         .is("<<PropertyDecimal> eq <1.25>>")
@@ -3917,37 +3759,43 @@ public class TestFullResourcePath {
         .first().isComplex("PropertyCompMixedEnumDef")
         .n().isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false);
 
-    testFilter.runOnETAllPrim("PropertyByte mod 0")
-        .is("<<PropertyByte> mod <0>>");
+    testFilter.runOnETAllPrim("PropertyByte mod 0 gt 0")
+        .is("<<<PropertyByte> mod <0>> gt <0>>");
+  }
 
-    testFilter.runOnETAllPrim("olingo.odata.test1.UFCRTETTwoKeyNavParamCTTwoPrim(ParameterCTTwoPrim=@ParamAlias)")
-        .is("<UFCRTETTwoKeyNavParamCTTwoPrim>")
-        .goPath()
+  @Test
+  public void filterFunctions() throws Exception {
+    testFilter.runOnETAllPrim(
+        "olingo.odata.test1.UFCRTETTwoKeyNavParamCTTwoPrim(ParameterCTTwoPrim=@ParamAlias) eq null")
+        .is("<<UFCRTETTwoKeyNavParamCTTwoPrim> eq <null>>")
+        .left().goPath()
         .first()
         .isFunction("UFCRTETTwoKeyNavParamCTTwoPrim")
         .isParameterAlias(0, "ParameterCTTwoPrim", "@ParamAlias");
 
-    testFilter.runOnETTwoKeyNav("PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNavParam"
-        + "(ParameterString=PropertyComp/PropertyComp/PropertyString)(PropertyInt16=1,PropertyString='2')"
-        + "/PropertyString eq 'SomeString'")
-        .is("<<PropertyComp/BFCCTPrimCompRTESTwoKeyNavParam/PropertyString> eq <'SomeString'>>")
+    testFilter.runOnETTwoKeyNav("PropertyComp/olingo.odata.test1.BFCCTPrimCompRTETTwoKeyNavParam"
+        + "(ParameterString=PropertyComp/PropertyComp/PropertyString)/PropertyString eq 'SomeString'")
+        .is("<<PropertyComp/BFCCTPrimCompRTETTwoKeyNavParam/PropertyString> eq <'SomeString'>>")
         .root().left().goPath()
-        .first()
-        .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isFunction("BFCCTPrimCompRTESTwoKeyNavParam")
-        .isParameter(0, "ParameterString", "PropertyComp/PropertyComp/PropertyString")
-        .goParameter(0)
-        .isMember()
+        .first().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
+        .n().isFunction("BFCCTPrimCompRTETTwoKeyNavParam")
+        .goParameter(0).isMember()
         .goPath()
-        .first().isComplex("PropertyComp")
-        .n().isComplex("PropertyComp")
-        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false).goUpFilterValidator()
-        .goUpToResourceValidator()
+        .first().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
+        .n().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false)
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+        .goUpFilterValidator().goUpToResourceValidator()
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    testFilter.runOnETTwoKeyNav("PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()"
+        + "(PropertyInt16=1,PropertyString='2')/PropertyString eq 'SomeString'")
+        .is("<<PropertyComp/BFCCTPrimCompRTESTwoKeyNav/PropertyString> eq <'SomeString'>>")
+        .root().left().goPath()
+        .first().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
+        .n().isFunction("BFCCTPrimCompRTESTwoKeyNav")
         .isKeyPredicate(0, "PropertyInt16", "1")
         .isKeyPredicate(1, "PropertyString", "'2'")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
     testFilter.runOnETTwoKeyNav("PropertyComp/olingo.odata.test1.BFCCTPrimCompRTETTwoKeyNavParam"
         + "(ParameterString=null)/PropertyString eq 'SomeString'")
@@ -3957,9 +3805,7 @@ public class TestFullResourcePath {
         .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
         .n()
         .isFunction("BFCCTPrimCompRTETTwoKeyNavParam")
-        .goParameter(0)
-        .isNull()
-        .goUpToResourceValidator()
+        .isParameter(0, "ParameterString", null)
         .n()
         .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
@@ -3969,59 +3815,43 @@ public class TestFullResourcePath {
         .root().left().goPath()
         .first()
         .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
-        .n()
-        .isFunction("BFCESTwoKeyNavRTString");
+        .n().isFunction("BFCESTwoKeyNavRTString");
 
-    testFilter.runOnETTwoKeyNav("$it/olingo.odata.test1.BFESTwoKeyNavRTESTwoKeyNav()/PropertyString eq 'SomeString'")
-        .is("<<$it/BFESTwoKeyNavRTESTwoKeyNav/PropertyString> eq <'SomeString'>>")
+    testFilter.runOnETKeyNav("$it/olingo.odata.test1.BFCETKeyNavRTETKeyNav()/PropertyString eq 'SomeString'")
+        .is("<<$it/BFCETKeyNavRTETKeyNav/PropertyString> eq <'SomeString'>>")
         .root().left().goPath()
-        .first()
-        .isIt()
-        .n()
-        .isFunction("BFESTwoKeyNavRTESTwoKeyNav")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+        .first().isIt()
+        .n().isFunction("BFCETKeyNavRTETKeyNav")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
-    testFilter.runOnETTwoKeyNav("olingo.odata.test1.BFESTwoKeyNavRTESTwoKeyNav()/PropertyString eq 'SomeString'")
-        .is("<<BFESTwoKeyNavRTESTwoKeyNav/PropertyString> eq <'SomeString'>>")
+    testFilter.runOnETTwoKeyNav("olingo.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()/PropertyString eq 'SomeString'")
+        .is("<<BFCESTwoKeyNavRTCTTwoPrim/PropertyString> eq <'SomeString'>>")
         .root().left().goPath()
-        .first()
-        .isFunction("BFESTwoKeyNavRTESTwoKeyNav")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+        .first().isFunction("BFCESTwoKeyNavRTCTTwoPrim")
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
     testFilter.runOnETTwoKeyNav("NavPropertyETTwoKeyNavOne/olingo.odata.test1.BFCETTwoKeyNavRTETTwoKeyNav()"
         + "/PropertyComp/PropertyComp/PropertyString eq 'Walldorf'")
         .is("<<NavPropertyETTwoKeyNavOne/BFCETTwoKeyNavRTETTwoKeyNav/PropertyComp/PropertyComp/PropertyString> "
             + "eq <'Walldorf'>>")
         .root().left().goPath()
-        .first()
-        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
-        .n()
-        .isFunction("BFCETTwoKeyNavRTETTwoKeyNav")
-        .n()
-        .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false)
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+        .first().isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .n().isFunction("BFCETTwoKeyNavRTETTwoKeyNav")
+        .n().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
+        .n().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false)
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
-    testFilter.runOnETTwoKeyNav("PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNavParam"
-        + "(ParameterString='1')"
-        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
-        + "/PropertyString eq 'SomeString'")
-        .is("<<PropertyComp/BFCCTPrimCompRTESTwoKeyNavParam/olingo.odata.test1.ETBaseTwoKeyNav/PropertyString> "
+    testFilter.runOnETTwoKeyNav("PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()"
+        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')/PropertyString eq 'SomeString'")
+        .is("<<PropertyComp/BFCCTPrimCompRTESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav/PropertyString> "
             + "eq <'SomeString'>>")
         .root().left().goPath()
-        .first()
-        .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isFunction("BFCCTPrimCompRTESTwoKeyNavParam")
-        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .first().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
+        .n().isFunction("BFCCTPrimCompRTESTwoKeyNav")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
         .isKeyPredicate(0, "PropertyInt16", "2")
         .isKeyPredicate(1, "PropertyString", "'3'")
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
 
     testFilter.runOnETTwoKeyNavSingle("$it/olingo.odata.test1.BFCETTwoKeyNavRTCTTwoPrim()/olingo.odata.test1.CTBase"
         + "/PropertyString eq 'SomeString'")
@@ -4071,59 +3901,58 @@ public class TestFullResourcePath {
         .root().left().goPath()
         .first()
         .isFunction("UFCRTETTwoKeyNavParam")
-        .isParameter(0, "ParameterInt16", "PropertyInt16")
-        .n()
-        .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
-        .n()
-        .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false)
-        .n()
-        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+        .goParameter(0)
+        .isMember().goPath().first().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+        .goUpFilterValidator().goUpToResourceValidator()
+        .n().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
+        .n().isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false)
+        .n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
   }
 
   @Test
   public void methods() throws Exception {
     testFilter.runOnETKeyNav("indexof(PropertyString,'47') eq 5")
         .is("<<indexof(<PropertyString>,<'47'>)> eq <5>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.INDEXOF, 2)
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<'47'>");
 
     testFilter.runOnETKeyNav("tolower(PropertyString) eq 'foo'")
         .is("<<tolower(<PropertyString>)> eq <'foo'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TOLOWER, 1)
         .isParameterText(0, "<PropertyString>");
 
     testFilter.runOnETKeyNav("toupper(PropertyString) eq 'FOO'")
         .is("<<toupper(<PropertyString>)> eq <'FOO'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TOUPPER, 1)
         .isParameterText(0, "<PropertyString>");
 
     testFilter.runOnETKeyNav("trim(PropertyString) eq 'fooba'")
         .is("<<trim(<PropertyString>)> eq <'fooba'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TRIM, 1)
         .isParameterText(0, "<PropertyString>");
 
     testFilter.runOnETKeyNav("substring(PropertyString,4) eq 'foo'")
         .is("<<substring(<PropertyString>,<4>)> eq <'foo'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.SUBSTRING, 2)
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<4>");
 
     testFilter.runOnETKeyNav("substring(PropertyString,4) eq 'foo'")
         .is("<<substring(<PropertyString>,<4>)> eq <'foo'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.SUBSTRING, 2)
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<4>");
 
     testFilter.runOnETKeyNav("substring(PropertyString,2,4) eq 'foo'")
         .is("<<substring(<PropertyString>,<2>,<4>)> eq <'foo'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.SUBSTRING, 3)
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<2>")
@@ -4131,355 +3960,355 @@ public class TestFullResourcePath {
 
     testFilter.runOnETKeyNav("concat(PropertyString,PropertyCompTwoPrim/PropertyString) eq 'foo'")
         .is("<<concat(<PropertyString>,<PropertyCompTwoPrim/PropertyString>)> eq <'foo'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.CONCAT, 2)
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<PropertyCompTwoPrim/PropertyString>");
 
     testFilter.runOnETKeyNav("concat(PropertyString,'bar') eq 'foobar'")
         .is("<<concat(<PropertyString>,<'bar'>)> eq <'foobar'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.CONCAT, 2)
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<'bar'>");
 
     testFilter.runOnETKeyNav("concat(PropertyString,'bar') eq 'foobar'")
         .is("<<concat(<PropertyString>,<'bar'>)> eq <'foobar'>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.CONCAT, 2)
         .isParameterText(0, "<PropertyString>")
         .isParameterText(1, "<'bar'>");
 
     testFilter.runOnETKeyNav("length(PropertyString) eq 32")
         .is("<<length(<PropertyString>)> eq <32>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.LENGTH, 1)
         .isParameterText(0, "<PropertyString>");
 
     testFilter.runOnETAllPrim("year(PropertyDate) eq 2013")
         .is("<<year(<PropertyDate>)> eq <2013>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.YEAR, 1)
         .isParameterText(0, "<PropertyDate>");
 
     testFilter.runOnETAllPrim("year(2013-09-25) eq 2013")
         .is("<<year(<2013-09-25>)> eq <2013>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.YEAR, 1)
         .isParameterText(0, "<2013-09-25>");
 
     testFilter.runOnETAllPrim("year(PropertyDateTimeOffset) eq 2013")
         .is("<<year(<PropertyDateTimeOffset>)> eq <2013>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.YEAR, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("year(2013-09-25T12:34:56.123456789012-10:24) eq 2013")
         .is("<<year(<2013-09-25T12:34:56.123456789012-10:24>)> eq <2013>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.YEAR, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("month(PropertyDate) eq 9")
         .is("<<month(<PropertyDate>)> eq <9>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MONTH, 1)
         .isParameterText(0, "<PropertyDate>");
 
     testFilter.runOnETAllPrim("month(2013-09-25) eq 9")
         .is("<<month(<2013-09-25>)> eq <9>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MONTH, 1)
         .isParameterText(0, "<2013-09-25>");
 
     testFilter.runOnETAllPrim("month(PropertyDateTimeOffset) eq 9")
         .is("<<month(<PropertyDateTimeOffset>)> eq <9>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MONTH, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("month(2013-09-25T12:34:56.123456789012-10:24) eq 9")
         .is("<<month(<2013-09-25T12:34:56.123456789012-10:24>)> eq <9>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MONTH, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("day(PropertyDate) eq 25")
         .is("<<day(<PropertyDate>)> eq <25>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.DAY, 1)
         .isParameterText(0, "<PropertyDate>");
 
     testFilter.runOnETAllPrim("day(2013-09-25) eq 25")
         .is("<<day(<2013-09-25>)> eq <25>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.DAY, 1)
         .isParameterText(0, "<2013-09-25>");
 
     testFilter.runOnETAllPrim("day(PropertyDateTimeOffset) eq 25")
         .is("<<day(<PropertyDateTimeOffset>)> eq <25>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.DAY, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("day(2013-09-25T12:34:56.123456789012-10:24) eq 25")
         .is("<<day(<2013-09-25T12:34:56.123456789012-10:24>)> eq <25>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.DAY, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("hour(PropertyDateTimeOffset) eq 2")
         .is("<<hour(<PropertyDateTimeOffset>)> eq <2>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.HOUR, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("hour(PropertyDateTimeOffset) eq 2")
         .is("<<hour(<PropertyDateTimeOffset>)> eq <2>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.HOUR, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("hour(2013-09-25T12:34:56.123456789012-10:24) eq 2")
         .is("<<hour(<2013-09-25T12:34:56.123456789012-10:24>)> eq <2>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.HOUR, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("hour(PropertyTimeOfDay) eq 2")
         .is("<<hour(<PropertyTimeOfDay>)> eq <2>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.HOUR, 1)
         .isParameterText(0, "<PropertyTimeOfDay>");
 
     testFilter.runOnETAllPrim("hour(12:34:55.123456789012) eq 12")
         .is("<<hour(<12:34:55.123456789012>)> eq <12>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.HOUR, 1)
         .isParameterText(0, "<12:34:55.123456789012>");
 
     testFilter.runOnETAllPrim("minute(PropertyDateTimeOffset) eq 34")
         .is("<<minute(<PropertyDateTimeOffset>)> eq <34>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MINUTE, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("minute(2013-09-25T12:34:56.123456789012-10:24) eq 34")
         .is("<<minute(<2013-09-25T12:34:56.123456789012-10:24>)> eq <34>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MINUTE, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("minute(PropertyTimeOfDay) eq 34")
         .is("<<minute(<PropertyTimeOfDay>)> eq <34>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MINUTE, 1)
         .isParameterText(0, "<PropertyTimeOfDay>");
 
     testFilter.runOnETAllPrim("minute(12:34:55.123456789012) eq 34")
         .is("<<minute(<12:34:55.123456789012>)> eq <34>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MINUTE, 1)
         .isParameterText(0, "<12:34:55.123456789012>");
 
     testFilter.runOnETAllPrim("second(PropertyDateTimeOffset) eq 56")
         .is("<<second(<PropertyDateTimeOffset>)> eq <56>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.SECOND, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("second(2013-09-25T12:34:56.123456789012-10:24) eq 56")
         .is("<<second(<2013-09-25T12:34:56.123456789012-10:24>)> eq <56>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.SECOND, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("second(PropertyTimeOfDay) eq 56")
         .is("<<second(<PropertyTimeOfDay>)> eq <56>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.SECOND, 1)
         .isParameterText(0, "<PropertyTimeOfDay>");
 
     testFilter.runOnETAllPrim("second(12:34:55.123456789012) eq 56")
         .is("<<second(<12:34:55.123456789012>)> eq <56>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.SECOND, 1)
         .isParameterText(0, "<12:34:55.123456789012>");
 
     testFilter.runOnETAllPrim("fractionalseconds(PropertyDateTimeOffset) eq 123456789012")
         .is("<<fractionalseconds(<PropertyDateTimeOffset>)> eq <123456789012>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FRACTIONALSECONDS, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("fractionalseconds(2013-09-25T12:34:56.123456789012-10:24) eq 123456789012")
         .is("<<fractionalseconds(<2013-09-25T12:34:56.123456789012-10:24>)> eq <123456789012>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FRACTIONALSECONDS, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("fractionalseconds(PropertyTimeOfDay) eq 123456789012")
         .is("<<fractionalseconds(<PropertyTimeOfDay>)> eq <123456789012>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FRACTIONALSECONDS, 1)
         .isParameterText(0, "<PropertyTimeOfDay>");
 
     testFilter.runOnETAllPrim("fractionalseconds(12:34:55.123456789012) eq 123456789012")
         .is("<<fractionalseconds(<12:34:55.123456789012>)> eq <123456789012>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FRACTIONALSECONDS, 1)
         .isParameterText(0, "<12:34:55.123456789012>");
 
     testFilter.runOnETAllPrim("totalseconds(PropertyDuration) eq 4711")
         .is("<<totalseconds(<PropertyDuration>)> eq <4711>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TOTALSECONDS, 1)
         .isParameterText(0, "<PropertyDuration>");
 
     testFilter.runOnETAllPrim("totalseconds(duration'P10DT5H34M21.123456789012S') eq 4711")
         .is("<<totalseconds(<duration'P10DT5H34M21.123456789012S'>)> eq <4711>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TOTALSECONDS, 1)
         .isParameterText(0, "<duration'P10DT5H34M21.123456789012S'>");
 
     testFilter.runOnETAllPrim("date(PropertyDateTimeOffset) eq 2013-09-25")
         .is("<<date(<PropertyDateTimeOffset>)> eq <2013-09-25>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.DATE, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("date(2013-09-25T12:34:56.123456789012-10:24) eq 2013-09-25")
         .is("<<date(<2013-09-25T12:34:56.123456789012-10:24>)> eq <2013-09-25>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.DATE, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("time(PropertyDateTimeOffset) eq 12:34:55.123456789012")
         .is("<<time(<PropertyDateTimeOffset>)> eq <12:34:55.123456789012>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TIME, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("time(2013-09-25T12:34:56.123456789012-10:24) eq 12:34:55.123456789012")
         .is("<<time(<2013-09-25T12:34:56.123456789012-10:24>)> eq <12:34:55.123456789012>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TIME, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
     testFilter.runOnETAllPrim("round(PropertyDouble) eq 17")
         .is("<<round(<PropertyDouble>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.ROUND, 1)
         .isParameterText(0, "<PropertyDouble>");
 
     testFilter.runOnETAllPrim("round(17.45e1) eq 17")
         .is("<<round(<17.45e1>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.ROUND, 1)
         .isParameterText(0, "<17.45e1>");
 
     testFilter.runOnETAllPrim("round(PropertyDecimal) eq 17")
         .is("<<round(<PropertyDecimal>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.ROUND, 1)
         .isParameterText(0, "<PropertyDecimal>");
 
     testFilter.runOnETAllPrim("round(17.45) eq 17")
         .is("<<round(<17.45>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.ROUND, 1)
         .isParameterText(0, "<17.45>");
 
     testFilter.runOnETAllPrim("floor(PropertyDouble) eq 17")
         .is("<<floor(<PropertyDouble>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FLOOR, 1)
         .isParameterText(0, "<PropertyDouble>");
 
     testFilter.runOnETAllPrim("floor(17.45e1) eq 17")
         .is("<<floor(<17.45e1>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FLOOR, 1)
         .isParameterText(0, "<17.45e1>");
 
     testFilter.runOnETAllPrim("floor(PropertyDecimal) eq 17")
         .is("<<floor(<PropertyDecimal>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FLOOR, 1)
         .isParameterText(0, "<PropertyDecimal>");
 
     testFilter.runOnETAllPrim("floor(17.45) eq 17")
         .is("<<floor(<17.45>)> eq <17>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.FLOOR, 1)
         .isParameterText(0, "<17.45>");
 
     testFilter.runOnETAllPrim("ceiling(PropertyDouble) eq 18")
         .is("<<ceiling(<PropertyDouble>)> eq <18>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.CEILING, 1)
         .isParameterText(0, "<PropertyDouble>");
 
     testFilter.runOnETAllPrim("ceiling(17.55e1) eq 18")
         .is("<<ceiling(<17.55e1>)> eq <18>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.CEILING, 1)
         .isParameterText(0, "<17.55e1>");
 
     testFilter.runOnETAllPrim("ceiling(PropertyDecimal) eq 18")
         .is("<<ceiling(<PropertyDecimal>)> eq <18>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.CEILING, 1)
         .isParameterText(0, "<PropertyDecimal>");
 
     testFilter.runOnETAllPrim("ceiling(17.55) eq 18")
         .is("<<ceiling(<17.55>)> eq <18>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.CEILING, 1)
         .isParameterText(0, "<17.55>");
 
     testFilter.runOnETAllPrim("totaloffsetminutes(PropertyDateTimeOffset) eq 4711")
         .is("<<totaloffsetminutes(<PropertyDateTimeOffset>)> eq <4711>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TOTALOFFSETMINUTES, 1)
         .isParameterText(0, "<PropertyDateTimeOffset>");
 
     testFilter.runOnETAllPrim("totaloffsetminutes(2013-09-25T12:34:56.123456789012-10:24) eq 4711")
         .is("<<totaloffsetminutes(<2013-09-25T12:34:56.123456789012-10:24>)> eq <4711>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.TOTALOFFSETMINUTES, 1)
         .isParameterText(0, "<2013-09-25T12:34:56.123456789012-10:24>");
 
-    testFilter.runOnETAllPrim("mindatetime()")
-        .is("<mindatetime()>")
-        .isMethod(MethodKind.MINDATETIME, 0);
+    testFilter.runOnETAllPrim("mindatetime() ne null")
+        .is("<<mindatetime()> ne <null>>")
+        .left().isMethod(MethodKind.MINDATETIME, 0);
 
     testFilter.runOnETAllPrim("mindatetime() eq 2013-09-25T12:34:56.123456789012-10:24")
         .is("<<mindatetime()> eq <2013-09-25T12:34:56.123456789012-10:24>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MINDATETIME, 0);
 
-    testFilter.runOnETAllPrim("maxdatetime()")
-        .is("<maxdatetime()>")
-        .isMethod(MethodKind.MAXDATETIME, 0);
+    testFilter.runOnETAllPrim("maxdatetime() ne null")
+        .is("<<maxdatetime()> ne <null>>")
+        .left().isMethod(MethodKind.MAXDATETIME, 0);
 
     testFilter.runOnETAllPrim("maxdatetime() eq 2013-09-25T12:34:56.123456789012-10:24")
         .is("<<maxdatetime()> eq <2013-09-25T12:34:56.123456789012-10:24>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.MAXDATETIME, 0);
 
-    testFilter.runOnETAllPrim("now()")
-        .is("<now()>")
-        .isMethod(MethodKind.NOW, 0);
+    testFilter.runOnETAllPrim("now() ne null")
+        .is("<<now()> ne <null>>")
+        .left().isMethod(MethodKind.NOW, 0);
 
     testFilter.runOnETAllPrim("now() eq 2013-09-25T12:34:56.123456789012-10:24")
         .is("<<now()> eq <2013-09-25T12:34:56.123456789012-10:24>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.NOW, 0);
 
     testFilter.runOnETTwoKeyNav("$it/PropertyString eq 'SomeString'")
         .is("<<$it/PropertyString> eq <'SomeString'>>")
-        .root().left()
+        .left()
         .goPath()
         .first().isUriPathInfoKind(UriResourceKind.it)
         .isType(EntityTypeProvider.nameETTwoKeyNav, false)
@@ -4487,7 +4316,7 @@ public class TestFullResourcePath {
 
     testFilter.runOnCTTwoPrim("$it/PropertyString eq 'SomeString'")
         .is("<<$it/PropertyString> eq <'SomeString'>>")
-        .root().left()
+        .left()
         .goPath()
         .first().isUriPathInfoKind(UriResourceKind.it)
         .isType(ComplexTypeProvider.nameCTTwoPrim, false)
@@ -4495,7 +4324,7 @@ public class TestFullResourcePath {
 
     testFilter.runOnString("$it eq 'Walldorf'")
         .is("<<$it> eq <'Walldorf'>>")
-        .root().left()
+        .left()
         .goPath()
         .first().isUriPathInfoKind(UriResourceKind.it)
         .isType(PropertyProvider.nameString, false);
@@ -4512,7 +4341,7 @@ public class TestFullResourcePath {
 
     testFilter.runOnString("endswith($it,'sap.com') eq false")
         .is("<<endswith(<$it>,<'sap.com'>)> eq <false>>")
-        .root().left()
+        .left()
         .isMethod(MethodKind.ENDSWITH, 2)
         .isParameterText(0, "<$it>")
         .isParameterText(1, "<'sap.com'>")
@@ -4644,44 +4473,42 @@ public class TestFullResourcePath {
         .n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
   }
 
-  // TODO: Implement cast method.
   @Test
   public void castMethod() throws Exception {
-    testFilter.runOnETKeyNav("cast(olingo.odata.test1.ETBaseTwoKeyNav)")
-        .is("<cast(<olingo.odata.test1.ETBaseTwoKeyNav>)>")
-        .root()
+    testFilter.runOnETKeyNav("cast(olingo.odata.test1.ETBaseTwoKeyNav) ne null")
+        .is("<<cast(<olingo.odata.test1.ETBaseTwoKeyNav>)> ne <n

<TRUNCATED>

[18/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] $expand parser in Java + clean-up

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
index 6df6759..6102fd8 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
@@ -18,16 +18,22 @@
  */
 package org.apache.olingo.server.core.uri.antlr;
 
-import org.antlr.v4.runtime.Lexer;
-import org.apache.olingo.server.core.uri.testutil.TokenValidator;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.olingo.server.core.uri.parser.UriTokenizer;
+import org.apache.olingo.server.core.uri.parser.UriTokenizer.TokenKind;
 import org.junit.Test;
 
+/**
+ * Tests originally written for the ANTLR lexer.
+ */
 public class TestLexer {
 
   private TokenValidator test = null;
 
-  private static final String cPCT_ENCODED = "%45%46%47" + "%22" + "%5C";// last two chars are not in
-  // cPCT_ENCODED_UNESCAPED
+  // The last two chars are not in cPCT_ENCODED_UNESCAPED.
+  private static final String cPCT_ENCODED = "%45%46%47" + "%22" + "%5C";
   private static final String cUNRESERVED = "ABCabc123-._~";
   private static final String cOTHER_DELIMS = "!()*+,;";
   private static final String cSUB_DELIMS = "$&'=" + cOTHER_DELIMS;
@@ -39,265 +45,279 @@ public class TestLexer {
   }
 
   @Test
-  public void test() {
-
-    // test.log(1).run("ESAllPrim?$orderby=PropertyDouble eq 3.5E+38");
+  public void unary() {
+    test.run("-a eq a").has(TokenKind.MinusOperator, TokenKind.ODataIdentifier, TokenKind.EqualsOperator,
+        TokenKind.ODataIdentifier).isInput();
   }
 
-  // ;------------------------------------------------------------------------------
-  // ; 0. URI
-  // ;------------------------------------------------------------------------------
-
   @Test
-  public void testUnary() {
-    test.run("- a eq a").isAllInput();
+  public void uriTokens() {
+//    test.run("#").isType(TokenKind.FRAGMENT).isInput();
+    test.run("$count").has(TokenKind.COUNT).isInput();
+    test.run("$ref").has(TokenKind.REF).isInput();
+    test.run("$value").has(TokenKind.VALUE).isInput();
   }
 
   @Test
-  public void testUriTokens() {
-    test.globalMode(UriLexer.MODE_QUERY);
-    test.run("#").isText("#").isType(UriLexer.FRAGMENT);
-    test.run("$count").isText("$count").isType(UriLexer.COUNT);
-    test.run("$ref").isText("$ref").isType(UriLexer.REF);
-    test.run("$value").isText("$value").isType(UriLexer.VALUE);
+  public void queryOptionsTokens() {
+    test.run("$skip=1").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$skip=2").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$skip=123").has(TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+
+    test.run("$top=1").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$top=2").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$top=123").has(TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+
+    test.run("$levels=1").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$levels=2").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$levels=123").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+    test.run("$levels=max").has(TokenKind.LEVELS, TokenKind.EQ, TokenKind.MAX).isInput();
+
+//    test.run("$format=atom").has(TokenKind.FORMAT, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$format=json").has(TokenKind.FORMAT, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$format=xml").has(TokenKind.FORMAT,, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$format=abc/def").has(TokenKind.FORMAT, TokenKind.EQ,
+//        TokenKind.ODataIdentifier, TokenKind.SLASH, TokenKind.ODataIdentifier).isInput();
+
+//    test.run("$id=123").has(TokenKind.ID, TokenKind.EQ, TokenKind.IntegerValue).isInput();
+//    test.run("$id=ABC").has(TokenKind.ID, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+
+//    test.run("$skiptoken=ABC").has(TokenKind.SKIPTOKEN, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+//    test.run("$skiptoken=ABC").has(TokenKind.SKIPTOKEN, TokenKind.EQ, TokenKind.ODataIdentifier).isInput();
+
+    test.run("$search=\"ABC\"").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase).isInput();
+    test.run("$search=ABC").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word).isInput();
+    test.run("$search=\"A%20B%20C\"").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase).isInput();
+    test.run("$search=Test Test").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word,
+        TokenKind.AndOperatorSearch, TokenKind.Word).isInput();
+    test.run("$search=Test&$filter=ABC eq 1").has(TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word);
   }
 
-  // ;------------------------------------------------------------------------------
-  // ; 2. Query Options
-  // ;------------------------------------------------------------------------------
   @Test
-  public void testQueryOptionsTokens() {
-
-    test.globalMode(UriLexer.MODE_QUERY);
-    test.run("$skip=1").isAllText("$skip=1").isType(UriLexer.SKIP_QO);
-    test.run("$skip=2").isAllText("$skip=2").isType(UriLexer.SKIP_QO);
-    test.run("$skip=123").isAllText("$skip=123").isType(UriLexer.SKIP_QO);
-
-    test.run("$top=1").isAllText("$top=1").isType(UriLexer.TOP);
-    test.run("$top=2").isAllText("$top=2").isType(UriLexer.TOP);
-    test.run("$top=123").isAllText("$top=123").isType(UriLexer.TOP);
-
-    test.run("$levels=1").isAllText("$levels=1").isType(UriLexer.LEVELS);
-    test.run("$levels=2").isAllText("$levels=2").isType(UriLexer.LEVELS);
-    test.run("$levels=123").isAllText("$levels=123").isType(UriLexer.LEVELS);
-    test.run("$levels=max").isAllText("$levels=max").isType(UriLexer.LEVELS);
-
-    test.run("$format=atom").isAllText("$format=atom").isType(UriLexer.FORMAT);
-    test.run("$format=json").isAllText("$format=json").isType(UriLexer.FORMAT);
-    test.run("$format=xml").isAllText("$format=xml").isType(UriLexer.FORMAT);
-    test.run("$format=abc/def").isAllText("$format=abc/def").isType(UriLexer.FORMAT);
-
-    test.run("$id=123").isAllText("$id=123").isType(UriLexer.ID);
-    test.run("$id=ABC").isAllText("$id=ABC").isType(UriLexer.ID);
-
-    test.run("$skiptoken=ABC").isAllText("$skiptoken=ABC").isType(UriLexer.SKIPTOKEN);
-    test.run("$skiptoken=ABC").isAllText("$skiptoken=ABC").isType(UriLexer.SKIPTOKEN);
-
-    test.run("$search=\"ABC\"").isAllText("$search=\"ABC\"").isType(UriLexer.SEARCH);
-    test.run("$search=ABC").isAllText("$search=ABC").isType(UriLexer.SEARCH);
-    test.run("$search=\"A%20B%20C\"").isAllText("$search=\"A%20B%20C\"").isType(UriLexer.SEARCH);
-    test.run("$search=Test Test").isAllText("$search=Test Test").isType(UriLexer.SEARCH);
-    test.run("$search=Test&$filter=ABC eq 1").isAllText("$search=Test&$filter=ABC eq 1").isType(UriLexer.SEARCH);
-  }
-  
-  @Test
-  public void testQueryOptionsDefaultMode() {
-    // First set query mode, than use expand(switches to default mode) and use nested system query options
-    test.globalMode(UriLexer.MODE_QUERY);
-    test.run("$expand=ABC($skip=1)").isAllText("$expand=ABC($skip=1)").at(4).isType(UriLexer.SKIP_QO);
-    test.run("$expand=ABC($skip=2)").isAllText("$expand=ABC($skip=2)").at(4).isType(UriLexer.SKIP_QO);
-    test.run("$expand=ABC($skip=123)").isAllText("$expand=ABC($skip=123)").at(4).isType(UriLexer.SKIP_QO);
-    test.run("$expand=ABC($search=abc)").isAllText("$expand=ABC($search=abc)").at(4).isType(UriLexer.SEARCH_INLINE);
-    test.run("$expand=ABC($search=\"123\")").isAllText("$expand=ABC($search=\"123\")")
-                                            .at(4).isType(UriLexer.SEARCH_INLINE)
-                                            .at(6).isType(UriLexer.SEARCHPHRASE);
-    test.run("$expand=ABC($top=1)").isAllText("$expand=ABC($top=1)").at(4).isType(UriLexer.TOP);
-    test.run("$expand=ABC($top=2)").isAllText("$expand=ABC($top=2)").at(4).isType(UriLexer.TOP);
-    test.run("$expand=ABC($top=123)").isAllText("$expand=ABC($top=123)").at(4).isType(UriLexer.TOP);
-    
-    test.run("$expand=ABC($expand=DEF($skip=1))").isAllText("$expand=ABC($expand=DEF($skip=1))")
-                                                 .at(8).isType(UriLexer.SKIP_QO);
-    test.run("$expand=ABC($expand=DEF($skip=2))").isAllText("$expand=ABC($expand=DEF($skip=2))")
-                                                 .at(8).isType(UriLexer.SKIP_QO);
-    test.run("$expand=ABC($expand=DEF($skip=123))").isAllText("$expand=ABC($expand=DEF($skip=123))")
-                                                 .at(8).isType(UriLexer.SKIP_QO);
-    
-    test.run("$expand=ABC($expand=DEF($top=1))").isAllText("$expand=ABC($expand=DEF($top=1))")
-                                                .at(8).isType(UriLexer.TOP);
-    test.run("$expand=ABC($expand=DEF($top=2))").isAllText("$expand=ABC($expand=DEF($top=2))")
-                                                .at(8).isType(UriLexer.TOP);
-    test.run("$expand=ABC($expand=DEF($top=123))").isAllText("$expand=ABC($expand=DEF($top=123))")
-                                                  .at(8).isType(UriLexer.TOP);
-    test.run("$expand=ABC($expand=DEF($search=Test Test))").isAllText("$expand=ABC($expand=DEF($search=Test Test))")
-                                                        .at(8).isType(UriLexer.SEARCH_INLINE)
-                                                        .at(10).isType(UriLexer.SEARCHWORD)
-                                                        .at(12).isType(UriLexer.SEARCHWORD);
+  public void queryOptionsDefaultMode() {
+    test.run("$expand=ABC($skip=1)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($skip=123)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($search=abc)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($search=\"123\")").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($top=1)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+    test.run("$expand=ABC($top=123)").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE).isInput();
+
+    test.run("$expand=ABC($expand=DEF($skip=1))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+    test.run("$expand=ABC($expand=DEF($skip=123))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.SKIP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+
+    test.run("$expand=ABC($expand=DEF($top=1))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+    test.run("$expand=ABC($expand=DEF($top=123))").has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+        TokenKind.OPEN, TokenKind.TOP, TokenKind.EQ, TokenKind.IntegerValue, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
+
+    test.run("$expand=ABC($expand=DEF($search=Test Test))")
+        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Word,
+            TokenKind.AndOperatorSearch, TokenKind.Word, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
     test.run("$expand=ABC($expand=DEF($search=\"Test\" \"Test\"))")
-                .isAllText("$expand=ABC($expand=DEF($search=\"Test\" \"Test\"))")
-                .at(8).isType(UriLexer.SEARCH_INLINE)
-                .at(10).isType(UriLexer.SEARCHPHRASE)
-                .at(12).isType(UriLexer.SEARCHPHRASE);
+        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase,
+            TokenKind.AndOperatorSearch, TokenKind.Phrase, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
     test.run("$expand=ABC($expand=DEF($search=\"Test\" \"Test\";$filter=PropertyInt16 eq 0;$orderby=PropertyInt16))")
-                .isAllText("$expand=ABC($expand=DEF($search=\"Test\" \"Test\";$filter=PropertyInt16 " + 
-                           "eq 0;$orderby=PropertyInt16))")
-                .at(8).isType(UriLexer.SEARCH_INLINE)
-                .at(10).isType(UriLexer.SEARCHPHRASE)
-                .at(12).isType(UriLexer.SEARCHPHRASE)
-                .at(13).isType(UriLexer.SEMI)
-                .at(14).isType(UriLexer.FILTER)
-                .at(22).isType(UriLexer.ORDERBY);
+        .has(TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.EXPAND, TokenKind.EQ, TokenKind.ODataIdentifier,
+            TokenKind.OPEN, TokenKind.SEARCH, TokenKind.EQ, TokenKind.Phrase,
+            TokenKind.AndOperatorSearch, TokenKind.Phrase, TokenKind.SEMI,
+            TokenKind.FILTER, TokenKind.EQ, TokenKind.ODataIdentifier, TokenKind.EqualsOperator,
+            TokenKind.IntegerValue, TokenKind.SEMI,
+            TokenKind.ORDERBY, TokenKind.EQ, TokenKind.ODataIdentifier, TokenKind.CLOSE, TokenKind.CLOSE)
+        .isInput();
   }
-  
-  // ;------------------------------------------------------------------------------
-  // ; 4. Expressions
-  // ;------------------------------------------------------------------------------
-  @Test
-  public void testQueryExpressions() {
-    test.globalMode(Lexer.DEFAULT_MODE);
-
-    test.run("$it").isText("$it").isType(UriLexer.IT);
-
-    test.run("$filter=contains(").at(2).isText("contains(").isType(UriLexer.CONTAINS_WORD);
-
-    test.run("$filter=containsabc").at(2).isText("containsabc")
-    .isType(UriLexer.ODATAIDENTIFIER); // test that this is a ODI
-
-    test.run("$filter=startswith(").at(2).isText("startswith(").isType(UriLexer.STARTSWITH_WORD);
-    test.run("$filter=endswith(").at(2).isText("endswith(").isType(UriLexer.ENDSWITH_WORD);
-    test.run("$filter=length(").at(2).isText("length(").isType(UriLexer.LENGTH_WORD);
-    test.run("$filter=indexof(").at(2).isText("indexof(").isType(UriLexer.INDEXOF_WORD);
-    test.run("$filter=substring(").at(2).isText("substring(").isType(UriLexer.SUBSTRING_WORD);
-    test.run("$filter=tolower(").at(2).isText("tolower(").isType(UriLexer.TOLOWER_WORD);
-    test.run("$filter=toupper(").at(2).isText("toupper(").isType(UriLexer.TOUPPER_WORD);
-    test.run("$filter=trim(").at(2).isText("trim(").isType(UriLexer.TRIM_WORD);
-    test.run("$filter=concat(").at(2).isText("concat(").isType(UriLexer.CONCAT_WORD);
 
+  @Test
+  public void queryExpressions() {
+    test.run("$it").has(TokenKind.IT).isText("$it");
+
+    test.run("$filter=contains(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ContainsMethod).isText("contains(");
+
+    test.run("$filter=containsabc").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ODataIdentifier)
+        .isText("containsabc");
+
+    test.run("$filter=startswith(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.StartswithMethod)
+        .isText("startswith(");
+    test.run("$filter=endswith(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.EndswithMethod).isText("endswith(");
+    test.run("$filter=length(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.LengthMethod).isText("length(");
+    test.run("$filter=indexof(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.IndexofMethod).isText("indexof(");
+    test.run("$filter=substring(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.SubstringMethod).isText("substring(");
+    test.run("$filter=tolower(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.TolowerMethod).isText("tolower(");
+    test.run("$filter=toupper(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ToupperMethod).isText("toupper(");
+    test.run("$filter=trim(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.TrimMethod).isText("trim(");
+    test.run("$filter=concat(").has(TokenKind.FILTER, TokenKind.EQ, TokenKind.ConcatMethod).isText("concat(");
   }
 
-  // ;------------------------------------------------------------------------------
-  // ; 7. Literal Data Values
-  // ;------------------------------------------------------------------------------
-
   @Test
-  public void testLiteralDataValues() {
-    test.globalMode(Lexer.DEFAULT_MODE);
+  public void literalDataValues() {
     // null
-    test.run("null").isInput().isType(UriLexer.NULLVALUE);
+    test.run("null").has(TokenKind.NULL).isInput();
 
     // binary
-    test.run("binary'ABCD'").isInput().isType(UriLexer.BINARY);
-    test.run("BiNaRy'ABCD'").isInput().isType(UriLexer.BINARY);
+    test.run("binary'ABCD'").has(TokenKind.BinaryValue).isInput();
+    test.run("BiNaRy'ABCD'").has(TokenKind.BinaryValue).isInput();
 
     // boolean
-    test.run("true").isInput().isType(UriLexer.TRUE);
-    test.run("false").isInput().isType(UriLexer.FALSE);
-    test.run("TrUe").isInput().isType(UriLexer.BOOLEAN);
-    test.run("FaLsE").isInput().isType(UriLexer.BOOLEAN);
+    test.run("true").has(TokenKind.BooleanValue).isInput();
+    test.run("false").has(TokenKind.BooleanValue).isInput();
+    test.run("TrUe").has(TokenKind.BooleanValue).isInput();
+    test.run("FaLsE").has(TokenKind.BooleanValue).isInput();
 
     // Lexer rule INT
-    test.run("123").isInput().isType(UriLexer.INT);
-    test.run("123456789").isInput().isType(UriLexer.INT);
-    test.run("+123").isInput().isType(UriLexer.INT);
-    test.run("+123456789").isInput().isType(UriLexer.INT);
-    test.run("-123").isInput().isType(UriLexer.INT);
-    test.run("-123456789").isInput().isType(UriLexer.INT);
+    test.run("123").has(TokenKind.IntegerValue).isInput();
+    test.run("123456789").has(TokenKind.IntegerValue).isInput();
+    test.run("+123").has(TokenKind.IntegerValue).isInput();
+    test.run("+123456789").has(TokenKind.IntegerValue).isInput();
+    test.run("-123").has(TokenKind.IntegerValue).isInput();
+    test.run("-123456789").has(TokenKind.IntegerValue).isInput();
 
     // Lexer rule DECIMAL
-    test.run("0.1").isInput().isType(UriLexer.DECIMAL);
-    test.run("1.1").isInput().isType(UriLexer.DECIMAL);
-    test.run("+0.1").isInput().isType(UriLexer.DECIMAL);
-    test.run("+1.1").isInput().isType(UriLexer.DECIMAL);
-    test.run("-0.1").isInput().isType(UriLexer.DECIMAL);
-    test.run("-1.1").isInput().isType(UriLexer.DECIMAL);
+    test.run("0.1").has(TokenKind.DecimalValue).isInput();
+    test.run("1.1").has(TokenKind.DecimalValue).isInput();
+    test.run("+0.1").has(TokenKind.DecimalValue).isInput();
+    test.run("+1.1").has(TokenKind.DecimalValue).isInput();
+    test.run("-0.1").has(TokenKind.DecimalValue).isInput();
+    test.run("-1.1").has(TokenKind.DecimalValue).isInput();
 
     // Lexer rule EXP
-    test.run("1.1e+1").isInput().isType(UriLexer.DECIMAL);
-    test.run("1.1e-1").isInput().isType(UriLexer.DECIMAL);
+    test.run("1.1e+1").has(TokenKind.DoubleValue).isInput();
+    test.run("1.1e-1").has(TokenKind.DoubleValue).isInput();
 
-    test.run("NaN").isInput().isType(UriLexer.NANINFINITY);
-    test.run("-INF").isInput().isType(UriLexer.NANINFINITY);
-    test.run("INF").isInput().isType(UriLexer.NANINFINITY);
+    test.run("NaN").has(TokenKind.DoubleValue).isInput();
+    test.run("-INF").has(TokenKind.DoubleValue).isInput();
+    test.run("INF").has(TokenKind.DoubleValue).isInput();
 
     // Lexer rule GUID
-    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").isInput().isType(UriLexer.GUID);
-    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").isInput().isType(UriLexer.GUID);
+    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").has(TokenKind.GuidValue).isInput();
+    test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").has(TokenKind.GuidValue).isInput();
 
     // Lexer rule DATE
-    test.run("2013-11-15").isInput().isType(UriLexer.DATE);
+    test.run("2013-11-15").has(TokenKind.DateValue).isInput();
 
     // Lexer rule DATETIMEOFFSET
-    test.run("2013-11-15T13:35Z").isInput().isType(UriLexer.DATETIMEOFFSET);
-    test.run("2013-11-15T13:35:10Z").isInput().isType(UriLexer.DATETIMEOFFSET);
-    test.run("2013-11-15T13:35:10.1234Z").isInput().isType(UriLexer.DATETIMEOFFSET);
+    test.run("2013-11-15T13:35Z").has(TokenKind.DateTimeOffsetValue).isInput();
+    test.run("2013-11-15T13:35:10Z").has(TokenKind.DateTimeOffsetValue).isInput();
+    test.run("2013-11-15T13:35:10.1234Z").has(TokenKind.DateTimeOffsetValue).isInput();
 
-    test.run("2013-11-15T13:35:10.1234+01:30").isInput().isType(UriLexer.DATETIMEOFFSET);
-    test.run("2013-11-15T13:35:10.1234-01:12").isInput().isType(UriLexer.DATETIMEOFFSET);
+    test.run("2013-11-15T13:35:10.1234+01:30").has(TokenKind.DateTimeOffsetValue).isInput();
+    test.run("2013-11-15T13:35:10.1234-01:12").has(TokenKind.DateTimeOffsetValue).isInput();
 
-    test.run("2013-11-15T13:35Z").isInput().isType(UriLexer.DATETIMEOFFSET);
+    test.run("2013-11-15T13:35Z").has(TokenKind.DateTimeOffsetValue).isInput();
 
     // Lexer rule DURATION
-    test.run("duration'PT67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT67.89S'").isInput().isType(UriLexer.DURATION);
-
-    test.run("duration'PT5M'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT5M67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT5M67.89S'").isInput().isType(UriLexer.DURATION);
-
-    test.run("duration'PT4H'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT4H67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT4H67.89S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT4H5M'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT4H5M67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'PT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
-
-    test.run("duration'P3D'");
-    test.run("duration'P3DT67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT67.89S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT5M'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT5M67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT5M67.89S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT4H'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT4H67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT4H67.89S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT4H5M'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT4H5M67S'").isInput().isType(UriLexer.DURATION);
-    test.run("duration'P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
-
-    test.run("DuRaTiOn'P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
-    test.run("DuRaTiOn'-P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
-
-    test.run("20:00").isInput().isType(UriLexer.TIMEOFDAY);
-    test.run("20:15:01").isInput().isType(UriLexer.TIMEOFDAY);
-    test.run("20:15:01.02").isInput().isType(UriLexer.TIMEOFDAY);
-
-    test.run("20:15:01.02").isInput().isType(UriLexer.TIMEOFDAY);
+    test.run("duration'PT67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("duration'PT5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("duration'PT4H'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'PT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("duration'P3D'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT5M67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H5M'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H5M67S'").has(TokenKind.DurationValue).isInput();
+    test.run("duration'P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("DuRaTiOn'P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+    test.run("DuRaTiOn'-P3DT4H5M67.89S'").has(TokenKind.DurationValue).isInput();
+
+    test.run("20:00").has(TokenKind.TimeOfDayValue).isInput();
+    test.run("20:15:01").has(TokenKind.TimeOfDayValue).isInput();
+    test.run("20:15:01.02").has(TokenKind.TimeOfDayValue).isInput();
+
+    test.run("20:15:01.02").has(TokenKind.TimeOfDayValue).isInput();
 
     // String
-    test.run("'ABC'").isText("'ABC'").isType(UriLexer.STRING);
-    test.run("'A%20C'").isInput().isType(UriLexer.STRING);
-    test.run("'%20%20%20ABC'").isInput().isType(UriLexer.STRING);
-
+    test.run("'ABC'").has(TokenKind.StringValue).isInput();
+    test.run("'A%20C'").has(TokenKind.StringValue).isInput();
+    test.run("'%20%20%20ABC'").has(TokenKind.StringValue).isInput();
   }
 
   @Test
-  public void testDelims() {
-    String reserved = "/";
-    test.globalMode(UriLexer.MODE_QUERY);
+  public void delims() {
+    final String reserved = "/";
     // Test lexer rule UNRESERVED
-    test.run("$format=A/" + cUNRESERVED).isAllInput().isType(UriLexer.FORMAT);
-    test.run("$format=A/" + cUNRESERVED + reserved).isType(UriLexer.FORMAT).at(4).isText(cUNRESERVED);
+//    test.run("$format=A/" + cUNRESERVED).has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/" + cUNRESERVED + reserved).has(TokenKind.FORMAT).isText(cUNRESERVED);
     // Test lexer rule PCT_ENCODED
-    test.run("$format=A/" + cPCT_ENCODED).isAllInput().isType(UriLexer.FORMAT);
-    test.run("$format=A/" + cPCT_ENCODED + reserved).isType(UriLexer.FORMAT).at(4).isText(cPCT_ENCODED);
+//    test.run("$format=A/" + cPCT_ENCODED).has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/" + cPCT_ENCODED + reserved).has(TokenKind.FORMAT).isText(cPCT_ENCODED);
     // Test lexer rule SUB_DELIMS
-    test.run("$format=A/" + cSUB_DELIMS).isAllInput().isType(UriLexer.FORMAT);
-    test.run("$format=A/" + cSUB_DELIMS + reserved).isType(UriLexer.FORMAT).at(4).isText("$");
+//    test.run("$format=A/" + cSUB_DELIMS).has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/" + cSUB_DELIMS + reserved).has(TokenKind.FORMAT).isText("$");
     // Test lexer rule PCHAR rest
-    test.run("$format=A/:@").isAllText("$format=A/:@").isType(UriLexer.FORMAT);
-    test.run("$format=A/:@" + reserved).isType(UriLexer.FORMAT).at(4).isText(":@");
+//    test.run("$format=A/:@").has(TokenKind.FORMAT).isInput();
+//    test.run("$format=A/:@" + reserved).has(TokenKind.FORMAT).isText(":@");
     // Test lexer rule PCHAR all
-    test.run("$format=" + cPCHAR + "/" + cPCHAR).isAllInput().isType(UriLexer.FORMAT);
-
+//    test.run("$format=" + cPCHAR + "/" + cPCHAR).has(TokenKind.FORMAT).isInput();
   }
 
+  public class TokenValidator {
+
+    private String input = null;
+    private UriTokenizer tokenizer = null;
+    private String curText = null;
+
+    public TokenValidator run(final String uri) {
+      input = uri;
+      tokenizer = new UriTokenizer(uri);
+      curText = "";
+      return this;
+    }
+
+    public TokenValidator has(final TokenKind... expected) {
+      for (final TokenKind kind : expected) {
+        assertTrue(tokenizer.next(kind));
+        curText += tokenizer.getText();
+      }
+      return this;
+    }
+
+    public TokenValidator isText(final String expected) {
+      assertEquals(expected, tokenizer.getText());
+      return this;
+    }
+
+    public TokenValidator isInput() {
+      assertEquals(input, curText);
+      assertTrue(tokenizer.next(TokenKind.EOF));
+      return this;
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
index 8790766..dd517f9 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
@@ -27,7 +27,7 @@ import org.apache.olingo.server.api.edmx.EdmxReference;
 import org.apache.olingo.server.api.uri.UriInfoKind;
 import org.apache.olingo.server.api.uri.UriResourceKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
+import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
 import org.apache.olingo.server.core.uri.testutil.FilterValidator;
 import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
 import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
@@ -67,8 +67,7 @@ public class TestUriParserImpl {
       + "," + PropertyDateTimeOffset + "," + PropertyDuration + "," + PropertyGuid + "," + PropertyTimeOfDay;
 
   @Test
-  public void testBoundFunctionImport_VarParameters() {
-
+  public void boundFunctionImport_VarParameters() {
     // no input
     testRes.run("ESKeyNav(1)/olingo.odata.test1.BFCETKeyNavRTETKeyNav()")
     .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
@@ -89,9 +88,8 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testFunctionBound_varReturnType() {
-
-    String esTwoKeyNav = "ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')";
+  public void functionBound_varReturnType() {
+    final String esTwoKeyNav = "ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')";
 
     // returning primitive
     testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()")
@@ -151,8 +149,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void runActionImport_VarReturnType() {
-
+  public void actionImport_VarReturnType() {
     testRes.run(ContainerProvider.AIRT_STRING).isKind(UriInfoKind.resource)
     .first()
     .isActionImport(ContainerProvider.AIRT_STRING)
@@ -189,7 +186,6 @@ public class TestUriParserImpl {
 
   @Test
   public void count() {
-
     // count entity set
     testRes.run("ESAllPrim/$count")
     .at(0)
@@ -216,7 +212,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void runCrossJoin() throws Exception {
+  public void crossJoin() throws Exception {
     testUri.run("$crossjoin(ESAllKey)")
     .isKind(UriInfoKind.crossjoin)
     .isCrossJoinEntityList(Arrays.asList("ESAllKey"));
@@ -226,29 +222,15 @@ public class TestUriParserImpl {
     .isCrossJoinEntityList(Arrays.asList("ESAllKey", "ESTwoPrim"));
   }
 
-  @Test(expected = UriValidationException.class)
-  public void testEntityFailOnValidation1() throws Exception {
+  @Test
+  public void entityFailOnValidation() throws Exception {
     // simple entity set; with qualifiedentityTypeName; with filter
-    testUri.run("$entity/olingo.odata.test1.ETTwoPrim", "$filter=PropertyInt16 eq 123&$id=ESAllKey")
-    .isIdText("ESAllKey")
-    .goFilter().is("<<PropertyInt16> eq <123>>");
-  }
-
-  @Test(expected = UriParserSyntaxException.class)
-  public void testEntityFailOnValidation2() throws Exception {
-    // simple entity set; with qualifiedentityTypeName; with 2xformat(before and after), expand, filter
-    testUri.run("$entity/olingo.odata.test1.ETTwoPrim",
-        "$format=xml&$expand=*&abc=123&$id=ESBase&xyz=987&$filter=PropertyInt16 eq 123&$format=atom&$select=*")
-        .isFormatText("atom")
-        .isCustomParameter(0, "abc", "123")
-        .isIdText("ESBase")
-        .isCustomParameter(1, "xyz", "987")
-        .isSelectItemStar(0);
+    testUri.runEx("$entity/olingo.odata.test1.ETTwoPrim", "$filter=PropertyInt16 eq 123&$id=ESAllKey")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
   }
 
   @Test
-  public void testEntity() throws Exception {
-
+  public void entity() throws Exception {
     // simple entity set
     testUri.run("$entity", "$id=ESAllPrim").isKind(UriInfoKind.entityId)
     .isKind(UriInfoKind.entityId)
@@ -311,14 +293,11 @@ public class TestUriParserImpl {
     .isKind(UriInfoKind.entityId)
     .isEntityType(EntityTypeProvider.nameETBase)
     .isIdText("ESTwoPrim")
-    .isExpandText("*")
     .goExpand().first().isSegmentStar();
-
   }
 
   @Test
   public void entitySet() throws Exception {
-
     // plain entity set
     testRes.run("ESAllPrim")
     .isEntitySet("ESAllPrim")
@@ -342,7 +321,7 @@ public class TestUriParserImpl {
     .isKeyPredicate(1, "PropertyString", "'ABC'");
 
     // with all keys
-    testRes.run("ESAllKey(" + encode(allKeys) + ")")
+    testRes.run("ESAllKey(" + allKeys + ")")
     .isEntitySet("ESAllKey")
     .isKeyPredicate(0, "PropertyString", "'ABC'")
     .isKeyPredicate(1, "PropertyInt16", "1")
@@ -360,10 +339,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testEntitySet_NavigationProperty() {
-
-    // plain entity set ...
-
+  public void entitySet_NavigationProperty() {
     // with navigation property
     testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
     .at(0)
@@ -467,10 +443,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testEntitySet_Property() {
-
-    // plain entity set ...
-
+  public void entitySet_Property() {
     // with property
     testRes.run("ESAllPrim(1)/PropertyString")
     .at(0)
@@ -499,8 +472,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testEntitySet_TypeFilter() {
-
+  public void entitySet_TypeFilter() {
     // filter
     testRes.run("ESTwoPrim/olingo.odata.test1.ETBase")
     .at(0)
@@ -556,57 +528,53 @@ public class TestUriParserImpl {
     .at(1)
     .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false)
     .isType(PropertyProvider.nameString);
-
   }
 
   @Test
   public void unary() throws Exception {
-    testFilter.runOnETAllPrim("not PropertyBoolean").isCompr("<not <PropertyBoolean>>");
-    testFilter.runOnETAllPrim("-PropertyInt16 eq PropertyInt16").isCompr("<<- <PropertyInt16>> eq <PropertyInt16>>");
+    testFilter.runOnETAllPrim("not PropertyBoolean").is("<not <PropertyBoolean>>");
+    testFilter.runOnETAllPrim("-PropertyInt16 eq PropertyInt16").is("<<- <PropertyInt16>> eq <PropertyInt16>>");
   }
 
-  // TODO: Use correct types.
   @Test
-  @Ignore
   public void filterComplexMixedPriority() throws Exception {
-    testFilter.runOnETAllPrim("PropertyInt16 or PropertyInt32 and PropertyInt64")
-        .isCompr("<<PropertyInt16> or <<PropertyInt32> and <PropertyInt64>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 or PropertyInt32 and PropertyInt64 eq PropertyByte")
-        .isCompr("<<PropertyInt16> or <<PropertyInt32> and <<PropertyInt64> eq <PropertyByte>>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 or PropertyInt32 eq PropertyInt64 and PropertyByte")
-        .isCompr("<<PropertyInt16> or <<<PropertyInt32> eq <PropertyInt64>> and <PropertyByte>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 or PropertyInt32 eq PropertyInt64 and PropertyByte eq PropertySByte")
-        .isCompr("<<PropertyInt16> or <<<PropertyInt32> eq <PropertyInt64>> "
+    testFilter.runOnETAllPrim("PropertyBoolean or true and false")
+        .is("<<PropertyBoolean> or <<true> and <false>>>");
+    testFilter.runOnETAllPrim("PropertyBoolean or true and PropertyInt64 eq PropertyByte")
+        .is("<<PropertyBoolean> or <<true> and <<PropertyInt64> eq <PropertyByte>>>>");
+    testFilter.runOnETAllPrim("PropertyBoolean or PropertyInt32 eq PropertyInt64 and true")
+        .is("<<PropertyBoolean> or <<<PropertyInt32> eq <PropertyInt64>> and <true>>>");
+    testFilter.runOnETAllPrim("PropertyBoolean or PropertyInt32 eq PropertyInt64 and PropertyByte eq PropertySByte")
+        .is("<<PropertyBoolean> or <<<PropertyInt32> eq <PropertyInt64>> "
             + "and <<PropertyByte> eq <PropertySByte>>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 and PropertyByte")
-        .isCompr("<<<PropertyInt16> eq <PropertyInt32>> or <<PropertyInt64> and <PropertyByte>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 and PropertyByte eq PropertySByte")
-        .isCompr("<<<PropertyInt16> eq <PropertyInt32>> "
-            + "or <<PropertyInt64> and <<PropertyByte> eq <PropertySByte>>>>");
-    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 eq PropertyByte and PropertySByte")
-        .isCompr("<<<PropertyInt16> eq <PropertyInt32>> "
-            + "or <<<PropertyInt64> eq <PropertyByte>> and <PropertySByte>>>");
+    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyBoolean and true")
+        .is("<<<PropertyInt16> eq <PropertyInt32>> or <<PropertyBoolean> and <true>>>");
+    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyBoolean and PropertyByte eq PropertySByte")
+        .is("<<<PropertyInt16> eq <PropertyInt32>> "
+            + "or <<PropertyBoolean> and <<PropertyByte> eq <PropertySByte>>>>");
+    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 eq PropertyByte and PropertyBoolean")
+        .is("<<<PropertyInt16> eq <PropertyInt32>> "
+            + "or <<<PropertyInt64> eq <PropertyByte>> and <PropertyBoolean>>>");
     testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 eq PropertyByte "
         + "and PropertySByte eq PropertyDecimal")
-        .isCompr("<<<PropertyInt16> eq <PropertyInt32>> or <<<PropertyInt64> eq <PropertyByte>> "
+        .is("<<<PropertyInt16> eq <PropertyInt32>> or <<<PropertyInt64> eq <PropertyByte>> "
             + "and <<PropertySByte> eq <PropertyDecimal>>>>");
   }
 
   @Test
   public void filterSimpleSameBinaryBinaryBinaryPriority() throws Exception {
-    testFilter.runOnETAllPrim("1 add 2 add 3 add 4").isCompr("<<< <1> add   <2>> add  <3>>  add <4>>");
-    testFilter.runOnETAllPrim("1 add 2 add 3 div 4").isCompr("<<  <1> add   <2>> add <<3>   div <4>>>");
-    testFilter.runOnETAllPrim("1 add 2 div 3 add 4").isCompr("<<  <1> add  <<2>  div  <3>>> add <4>>");
-    testFilter.runOnETAllPrim("1 add 2 div 3 div 4").isCompr("<   <1> add <<<2>  div  <3>>  div <4>>>");
-    testFilter.runOnETAllPrim("1 div 2 add 3 add 4").isCompr("<<< <1> div   <2>> add  <3>>  add <4>>");
-    testFilter.runOnETAllPrim("1 div 2 add 3 div 4").isCompr("<<  <1> div   <2>> add <<3>   div <4>>>");
-    testFilter.runOnETAllPrim("1 div 2 div 3 add 4").isCompr("<<< <1> div   <2>> div  <3>>  add <4>>");
-    testFilter.runOnETAllPrim("1 div 2 div 3 div 4").isCompr("<<< <1> div   <2>> div  <3>>  div <4>>");
+    testFilter.runOnETAllPrim("1 add 2 add 3 add 4 ge 0").isCompr("<<<< <1> add   <2>> add  <3>>  add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 add 2 add 3 div 4 ge 0").isCompr("<<<  <1> add   <2>> add <<3>   div <4>>> ge <0>>");
+    testFilter.runOnETAllPrim("1 add 2 div 3 add 4 ge 0").isCompr("<<<  <1> add  <<2>  div  <3>>> add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 add 2 div 3 div 4 ge 0").isCompr("<<   <1> add <<<2>  div  <3>>  div <4>>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 add 3 add 4 ge 0").isCompr("<<<< <1> div   <2>> add  <3>>  add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 add 3 div 4 ge 0").isCompr("<<<  <1> div   <2>> add <<3>   div <4>>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 div 3 add 4 ge 0").isCompr("<<<< <1> div   <2>> div  <3>>  add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 div 3 div 4 ge 0").isCompr("<<<< <1> div   <2>> div  <3>>  div <4>> ge <0>>");
   }
 
   @Test
-  public void testFunctionImport_VarParameters() {
-
+  public void functionImport_VarParameters() {
     // no input
     testRes.run("FINRTInt16()")
     .isFunctionImport("FINRTInt16")
@@ -627,7 +595,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testFunctionImport_VarReturning() {
+  public void functionImport_VarReturning() {
     // returning primitive
     testRes.run("FINRTInt16()")
     .isFunctionImport("FINRTInt16")
@@ -666,8 +634,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testFunctionImportChain() {
-
+  public void functionImportChain() {
     // test chain; returning single complex
     testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)/PropertyInt16")
     .at(0)
@@ -710,12 +677,10 @@ public class TestUriParserImpl {
     .isKeyPredicate(1, "PropertyString", "'ABC'")
     .at(1)
     .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
   }
 
   @Test
-  public void testMetaData() throws Exception {
-
+  public void metaData() throws Exception {
     // Parsing the fragment may be used if a uri has to be parsed on the consumer side.
     // On the producer side this feature is currently not supported, so the context fragment
     // part is only available as text.
@@ -879,12 +844,12 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testRef() throws Exception {
+  public void ref() throws Exception {
     testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/$ref");
   }
 
   @Test
-  public void testSingleton() {
+  public void singleton() {
     // plain singleton
     testRes.run("SINav")
     .isSingleton("SINav")
@@ -892,10 +857,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testNavigationProperty() {
-
-    // plain entity set ...
-
+  public void navigationProperty() {
     // with navigation property
     testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
     .at(0).isEntitySet("ESKeyNav")
@@ -969,10 +931,7 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testSingleton_Property() {
-
-    // plain singleton ...
-
+  public void singleton_Property() {
     // with property
     testRes.run("SINav/PropertyInt16")
     .at(0)
@@ -1002,72 +961,51 @@ public class TestUriParserImpl {
   }
 
   @Test
-  public void testValue() throws Exception {
+  public void value() throws Exception {
     testUri.run("ESAllPrim(1)/PropertyString/$value");
   }
 
-  @Test(expected = UriValidationException.class)
-  public void testMemberStartingWithCastFailOnValidation1() throws Exception {
+  @Test
+  public void memberStartingWithCastFailOnValidation1() throws Exception {
     // on EntityType entry
-    testUri.run("ESTwoKeyNav(ParameterInt16=1,PropertyString='ABC')",
+    testUri.runEx("ESTwoKeyNav(Property16=1,PropertyString='ABC')",
         "$filter=olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate")
-        .goFilter().root().isMember()
-        .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
-        // .at(0)
-        // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
-        // .isType(EntityTypeProvider.nameETTwoKeyNav, false)
-        // .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
-        .at(0).isType(PropertyProvider.nameDate);
+        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
   }
 
-  @Test(expected = UriValidationException.class)
-  public void testMemberStartingWithCastFailOnValidation2() throws Exception {
-    testUri.run("FICRTCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')",
+  @Test
+  public void memberStartingWithCastFailOnValidation2() throws Exception {
+    testUri.runEx("FICRTCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')",
         "$filter=olingo.odata.test1.CTBase/AdditionalPropString")
-        .goFilter().root().isMember()
-        .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
-        // .at(0)
-        // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
-        // .isType(ComplexTypeProvider.nameCTTwoPrim, false)
-        // .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase)
-        .at(0).isType(PropertyProvider.nameString);
+        .isExSemantic(UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE);
   }
 
   @Test
-  public void testMemberStartingWithCast() throws Exception {
-
+  public void memberStartingWithCast() throws Exception {
     // on EntityType collection
-    testUri.run("ESTwoKeyNav", "$filter=olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate")
-    .goFilter().root().isMember()
+    testFilter.runOnETTwoKeyNav("olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate eq null")
+    .left()
+    .isMember()
     .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
-    // .at(0)
-    // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
-    // .isType(EntityTypeProvider.nameETTwoKeyNav, true)
-    // .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
     .at(0).isType(PropertyProvider.nameDate);
 
     // on Complex collection
     testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')",
-        "$filter=olingo.odata.test1.CTBase/AdditionalPropString")
-        .goFilter().root().isMember()
+        "$filter=olingo.odata.test1.CTBase/AdditionalPropString eq null")
+        .goFilter().left().isMember()
         .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
-        // .at(0)
-        // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
-        // .isType(ComplexTypeProvider.nameCTTwoPrim, true)
-        // .isTypeFilterOnCollection(ComplexTypeProvider.nameCTBase)
         .at(0).isType(PropertyProvider.nameString);
-
   }
 
   @Test
-  public void testComplexTypeCastFollowingAsCollection() throws Exception {
+  public void complexTypeCastFollowingAsCollection() throws Exception {
     testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')/olingo.odata.test1.CTBase");
   }
 
   @Test
-  public void testAlias() throws Exception {
-    testUri.run("ESAllPrim", "$filter=PropertyInt16 eq @p1&@p1=1")
-    .goFilter().is("<<PropertyInt16> eq <@p1>>");
+  public void alias() throws Exception {
+    testFilter.runOnETAllPrim("PropertyInt16 eq @p1&@p1=1")
+        .is("<<PropertyInt16> eq <@p1>>");
   }
 
   @Test
@@ -1087,26 +1025,22 @@ public class TestUriParserImpl {
   @Test
   public void customQueryOption() throws Exception {
     testUri.run("ESTwoKeyNav", "custom")
-    .isCustomParameter(0, "custom", "");
+        .isCustomParameter(0, "custom", "");
     testUri.run("ESTwoKeyNav", "custom=ABC")
-    .isCustomParameter(0, "custom", "ABC");
+        .isCustomParameter(0, "custom", "ABC");
   }
 
   @Test
   @Ignore("Geo types are not supported yet.")
   public void geo() throws Exception {
     testFilter.runOnETAllPrim("geo.distance(PropertySByte,PropertySByte)")
-    .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")
-    .isMethod(MethodKind.GEODISTANCE, 2);
+        .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")
+        .isMethod(MethodKind.GEODISTANCE, 2);
     testFilter.runOnETAllPrim("geo.length(PropertySByte)")
-    .is("<geo.length(<PropertySByte>)>")
-    .isMethod(MethodKind.GEOLENGTH, 1);
+        .is("<geo.length(<PropertySByte>)>")
+        .isMethod(MethodKind.GEOLENGTH, 1);
     testFilter.runOnETAllPrim("geo.intersects(PropertySByte,PropertySByte)")
-    .is("<geo.intersects(<PropertySByte>,<PropertySByte>)>")
-    .isMethod(MethodKind.GEOINTERSECTS, 2);
-  }
-
-  private final String encode(final String uriPart) {
-    return uriPart.replaceAll(":", "%3A");
+        .is("<geo.intersects(<PropertySByte>,<PropertySByte>)>")
+        .isMethod(MethodKind.GEOINTERSECTS, 2);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java
index f54ad04..af523aa 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java
@@ -18,12 +18,18 @@
  */
 package org.apache.olingo.server.core.uri.parser;
 
+import java.util.Collections;
+
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmEntityContainer;
 import org.apache.olingo.commons.api.edm.EdmEntitySet;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
 import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.uri.UriInfoKind;
 import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
 import org.junit.Test;
@@ -33,17 +39,57 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 /**
- * All Tests which involves the <code>Parser</code> implementation
- * (and with that also the <code>UriParseTreeVisitor</code>).
+ * Tests of the <code>Parser</code> implementation that require mocking of the EDM.
  */
 public class ParserTest {
 
+  @Test
+  public void navPropertySameNameAsEntitySet() throws Exception {
+    final String namespace = "namespace";
+    final String entityTypeName = "ETNavProp";
+    final FullQualifiedName nameETNavProp = new FullQualifiedName(namespace, entityTypeName);
+    final String entitySetName = "ESNavProp";
+    final String keyPropertyName = "a";
+    EdmProperty keyProperty = Mockito.mock(EdmProperty.class);
+    Mockito.when(keyProperty.getType())
+        .thenReturn(OData.newInstance().createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Byte));
+    EdmKeyPropertyRef keyPropertyRef = Mockito.mock(EdmKeyPropertyRef.class);
+    Mockito.when(keyPropertyRef.getName()).thenReturn(keyPropertyName);
+    Mockito.when(keyPropertyRef.getProperty()).thenReturn(keyProperty);
+    EdmNavigationProperty navProperty = Mockito.mock(EdmNavigationProperty.class);
+    Mockito.when(navProperty.getName()).thenReturn(entitySetName);
+    Mockito.when(navProperty.isCollection()).thenReturn(true);
+    EdmEntityType entityType = Mockito.mock(EdmEntityType.class);
+    Mockito.when(entityType.getFullQualifiedName()).thenReturn(nameETNavProp);
+    Mockito.when(entityType.getKeyPredicateNames()).thenReturn(Collections.singletonList(keyPropertyName));
+    Mockito.when(entityType.getKeyPropertyRefs()).thenReturn(Collections.singletonList(keyPropertyRef));
+    Mockito.when(entityType.getNavigationProperty(entitySetName)).thenReturn(navProperty);
+    Mockito.when(navProperty.getType()).thenReturn(entityType);
+    EdmEntitySet entitySet = Mockito.mock(EdmEntitySet.class);
+    Mockito.when(entitySet.getName()).thenReturn(entitySetName);
+    Mockito.when(entitySet.getEntityType()).thenReturn(entityType);
+    EdmEntityContainer container = Mockito.mock(EdmEntityContainer.class);
+    Mockito.when(container.getEntitySet(entitySetName)).thenReturn(entitySet);
+    Edm mockedEdm = Mockito.mock(Edm.class);
+    Mockito.when(mockedEdm.getEntityContainer()).thenReturn(container);
+    new TestUriValidator().setEdm(mockedEdm)
+        .run("ESNavProp(1)/ESNavProp(2)/ESNavProp(3)/ESNavProp")
+        .goPath()
+        .at(0).isEntitySet(entitySetName)
+        .at(0).isKeyPredicate(0, keyPropertyName, "1")
+        .at(1).isNavProperty(entitySetName, nameETNavProp, false)
+        .at(1).isKeyPredicate(0, keyPropertyName, "2")
+        .at(2).isNavProperty(entitySetName, nameETNavProp, false)
+        .at(2).isKeyPredicate(0, keyPropertyName, "3")
+        .at(3).isNavProperty(entitySetName, nameETNavProp, true);
+  }
+
   /**
    * Test for EntitySet and NavigationProperty with same name defined in metadata.
    * (related to Olingo issue OLINGO-741)
    */
   @Test
-  public void parseEntitySetAndNavigationPropertyWithSameName() throws Exception {
+  public void expandNavigationPropertyWithSameNameAsEntitySet() throws Exception {
     TestUriValidator testUri = new TestUriValidator();
 
     Edm mockEdm = Mockito.mock(Edm.class);
@@ -60,7 +106,7 @@ public class ParserTest {
     Mockito.when(typeCategory.getNamespace()).thenReturn("NS");
     Mockito.when(esCategory.getEntityType()).thenReturn(typeCategory);
     Mockito.when(productsNavigation.getName()).thenReturn("Products");
-    Mockito.when(typeCategory.getProperty("Products")).thenReturn(productsNavigation);
+    Mockito.when(typeCategory.getNavigationProperty("Products")).thenReturn(productsNavigation);
     Mockito.when(container.getEntitySet("Category")).thenReturn(esCategory);
     Mockito.when(container.getEntitySet("Products")).thenReturn(esProduct);
     Mockito.when(productsType.getFullQualifiedName()).thenReturn(nameProducts);
@@ -122,7 +168,7 @@ public class ParserTest {
           .isType(new FullQualifiedName("NS", "Category"), false);
       fail("Expected exception was not thrown.");
     } catch (final UriParserException e) {
-      assertEquals("NavigationProperty 'Category' not found in type 'NS.Products'", e.getMessage());
+      assertEquals("Navigation Property 'Category' not found in type 'NS.Products'.", e.getMessage());
     }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
index 5638227..35245b4 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.server.core.uri.testutil;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -151,12 +152,6 @@ public class ExpandValidator implements TestValidator {
     return this;
   }
 
-  public ExpandValidator isSelectText(final String text) {
-    final QueryOption option = expandItem.getSelectOption();
-    assertEquals(text, option.getText());
-    return this;
-  }
-
   public ExpandValidator isSelectItemStar(final int index) {
     SelectOption select = expandItem.getSelectOption();
     SelectItem item = select.getSelectItems().get(index);
@@ -171,12 +166,6 @@ public class ExpandValidator implements TestValidator {
     return this;
   }
 
-  public ExpandValidator isFilterOptionText(final String text) {
-    QueryOption option = expandItem.getFilterOption();
-    assertEquals(text, option.getText());
-    return this;
-  }
-
   public ExpandValidator isFilterSerialized(final String serialized) {
     FilterOption filter = expandItem.getFilterOption();
 
@@ -201,7 +190,13 @@ public class ExpandValidator implements TestValidator {
   }
 
   public ExpandValidator isExpandStartType(final FullQualifiedName fullName) {
+    assertNotNull(expandItem.getStartTypeFilter());
     assertEquals(fullName, expandItem.getStartTypeFilter().getFullQualifiedName());
     return this;
   }
+
+  public ExpandValidator isSearchSerialized(final String serialized) {
+    assertEquals(serialized, expandItem.getSearchOption().getSearchExpression().toString());
+    return this;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
index 0800dd0..161299c 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
@@ -46,13 +46,16 @@ import org.apache.olingo.server.api.uri.queryoption.expression.Member;
 import org.apache.olingo.server.api.uri.queryoption.expression.Method;
 import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.TypeLiteral;
+import org.apache.olingo.server.api.uri.queryoption.expression.Unary;
 import org.apache.olingo.server.core.uri.UriResourceFunctionImpl;
 import org.apache.olingo.server.core.uri.parser.Parser;
 import org.apache.olingo.server.core.uri.parser.UriParserException;
 import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
 import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
+import org.apache.olingo.server.core.uri.queryoption.expression.BinaryImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.MemberImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.MethodImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.UnaryImpl;
 import org.apache.olingo.server.core.uri.validator.UriValidationException;
 
 public class FilterValidator implements TestValidator {
@@ -127,7 +130,7 @@ public class FilterValidator implements TestValidator {
   }
 
   public FilterValidator runOrderByOnETTwoKeyNavEx(final String orderBy) throws UriParserException {
-    return runUriOrderByEx("ESTwoKeyNav", "$orderby=" + orderBy.trim());
+    return runUriEx("ESTwoKeyNav", "$orderby=" + orderBy.trim());
   }
 
   public FilterValidator runOnETTwoKeyNav(final String filter) throws UriParserException, UriValidationException {
@@ -225,19 +228,6 @@ public class FilterValidator implements TestValidator {
     return this;
   }
 
-  public FilterValidator runUriOrderByEx(final String path, final String query) {
-    exception = null;
-    try {
-      new Parser(edm, odata).parseUri(path, query, null);
-      fail("Expected exception not thrown.");
-    } catch (final UriParserException e) {
-      exception = e;
-    } catch (final UriValidationException e) {
-      exception = e;
-    }
-    return this;
-  }
-
   // --- Navigation ---
 
   public ExpandValidator goUpToExpandValidator() {
@@ -274,8 +264,8 @@ public class FilterValidator implements TestValidator {
   // --- Validation ---
 
   /**
-   * Validates the serialized filterTree against a given filterString
-   * The given expected filterString is compressed before to allow better readable code in the unit tests
+   * Validates the serialized filterTree against a given filterString.
+   * The given expected filterString is compressed before to allow better readable code in the unit tests.
    * @param toBeCompr
    * @return {@link FilterValidator}
    */
@@ -310,14 +300,19 @@ public class FilterValidator implements TestValidator {
     EdmType actualType = null;
 
     if (curExpression instanceof Member) {
-      Member member = (Member) curExpression;
-      actualType = member.getType();
+      actualType = ((Member) curExpression).getType();
     } else if (curExpression instanceof TypeLiteral) {
-      TypeLiteral typeLiteral = (TypeLiteral) curExpression;
-      actualType = typeLiteral.getType();
+      actualType = ((TypeLiteral) curExpression).getType();
     } else if (curExpression instanceof Literal) {
-      Literal typeLiteral = (Literal) curExpression;
-      actualType = typeLiteral.getType();
+      actualType = ((Literal) curExpression).getType();
+    } else if (curExpression instanceof Enumeration) {
+      actualType = ((Enumeration) curExpression).getType();
+    } else if (curExpression instanceof Unary) {
+      actualType = ((UnaryImpl) curExpression).getType();
+    } else if (curExpression instanceof Binary) {
+      actualType = ((BinaryImpl) curExpression).getType();
+    } else if (curExpression instanceof Method) {
+      actualType = ((MethodImpl) curExpression).getType();
     }
 
     if (actualType == null) {
@@ -349,7 +344,6 @@ public class FilterValidator implements TestValidator {
 
     curExpression = ((Binary) curExpression).getRightOperand();
     return this;
-
   }
 
   public FilterValidator isLiteral(final String literalText) {
@@ -361,9 +355,9 @@ public class FilterValidator implements TestValidator {
     assertEquals(literalText, actualLiteralText);
     return this;
   }
-  
-  public FilterValidator isLiteralType(EdmType edmType) {
-    if(!(curExpression instanceof Literal)) {
+
+  public FilterValidator isLiteralType(final EdmType edmType) {
+    if (!(curExpression instanceof Literal)) {
       fail("Current expression is not a literal");
     }
     
@@ -374,7 +368,7 @@ public class FilterValidator implements TestValidator {
   }
 
   public FilterValidator isNullLiteralType() {
-    if(!(curExpression instanceof Literal)) {
+    if (!(curExpression instanceof Literal)) {
       fail("Current expression is not a literal");
     }
 
@@ -495,12 +489,4 @@ public class FilterValidator implements TestValidator {
     assertEquals(messageKey, exception.getMessageKey());
     return this;
   }
-
-  public FilterValidator isNull() {
-    return isLiteral("null");
-  }
-
-  public FilterValidator isTrue() {
-    return isLiteral("true");
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
index 1dbe62b..fbce5c9 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
@@ -140,6 +140,20 @@ public class TestUriValidator implements TestValidator {
     return this;
   }
 
+  public TestUriValidator isSelectItemStar(final int index) {
+    final SelectOption select = uriInfo.getSelectOption();
+    SelectItem item = select.getSelectItems().get(index);
+    assertTrue(item.isStar());
+    return this;
+  }
+
+  public TestUriValidator isSelectItemAllOp(final int index, final FullQualifiedName fqn) {
+    final SelectOption select = uriInfo.getSelectOption();
+    SelectItem item = select.getSelectItems().get(index);
+    assertEquals(fqn, item.getAllOperationsInSchemaNameSpace());
+    return this;
+  }
+
   // Validation
   public TestUriValidator isKind(final UriInfoKind kind) {
     assertEquals(kind, uriInfo.getKind());
@@ -202,16 +216,6 @@ public class TestUriValidator implements TestValidator {
     return this;
   }
 
-  public TestUriValidator isExpandText(final String text) {
-    assertEquals(text, uriInfo.getExpandOption().getText());
-    return this;
-  }
-
-  public TestUriValidator isSelectText(final String text) {
-    assertEquals(text, uriInfo.getSelectOption().getText());
-    return this;
-  }
-
   public TestUriValidator isFormatText(final String text) {
     assertEquals(text, uriInfo.getFormatOption().getText());
     return this;
@@ -234,18 +238,4 @@ public class TestUriValidator implements TestValidator {
     assertEquals(fullName, uriInfo.getEntityTypeCast().getFullQualifiedName());
     return this;
   }
-
-  public TestUriValidator isSelectItemStar(final int index) {
-    final SelectOption select = uriInfo.getSelectOption();
-    SelectItem item = select.getSelectItems().get(index);
-    assertTrue(item.isStar());
-    return this;
-  }
-
-  public TestUriValidator isSelectItemAllOp(final int index, final FullQualifiedName fqn) {
-    final SelectOption select = uriInfo.getSelectOption();
-    SelectItem item = select.getSelectItems().get(index);
-    assertEquals(fqn, item.getAllOperationsInSchemaNameSpace());
-    return this;
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8925274c/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
deleted file mode 100644
index 547c2ea..0000000
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
+++ /dev/null
@@ -1,127 +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.server.core.uri.testutil;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.List;
-
-import org.antlr.v4.runtime.ANTLRInputStream;
-import org.antlr.v4.runtime.Token;
-import org.apache.olingo.server.core.uri.antlr.UriLexer;
-
-public class TokenValidator {
-
-  private String input = null;
-  private List<? extends Token> tokens = null;
-  private Token curToken = null;
-  private Exception curException = null;
-
-  private int startMode;
-
-  // --- Execution ---
-
-  public TokenValidator run(final String uri) {
-    input = uri;
-    tokens = parseInput(uri);
-    first();
-    return this;
-  }
-
-  // --- Navigation ---
-
-  // navigate within the tokenlist
-  public TokenValidator first() {
-    try {
-      curToken = tokens.get(0);
-    } catch (IndexOutOfBoundsException ex) {
-      curToken = null;
-    }
-    return this;
-  }
-
-  public TokenValidator last() {
-    curToken = tokens.get(tokens.size() - 1);
-    return this;
-  }
-
-  public TokenValidator at(final int index) {
-    try {
-      curToken = tokens.get(index);
-    } catch (IndexOutOfBoundsException ex) {
-      curToken = null;
-    }
-    return this;
-  }
-
-  // --- Validation ---
-
-  public TokenValidator isText(final String expected) {
-    assertEquals(expected, curToken.getText());
-    return this;
-  }
-
-  public TokenValidator isAllText(final String expected) {
-    String actual = "";
-
-    for (Token curToken : tokens) {
-      actual += curToken.getText();
-    }
-    assertEquals(expected, actual);
-    return this;
-  }
-
-  public TokenValidator isAllInput() {
-    String actual = "";
-
-    for (Token curToken : tokens) {
-      actual += curToken.getText();
-    }
-    assertEquals(input, actual);
-    return this;
-  }
-
-  public TokenValidator isInput() {
-    assertEquals(input, curToken.getText());
-    return this;
-  }
-
-  public TokenValidator isType(final int expected) {
-    assertEquals(UriLexer.VOCABULARY.getDisplayName(expected), UriLexer.VOCABULARY.getDisplayName(curToken.getType()));
-    return this;
-  }
-
-  public TokenValidator isExType(final Class<?> exClass) {
-    assertEquals(exClass, curException.getClass());
-    return this;
-  }
-
-  public void globalMode(final int mode) {
-    startMode = mode;
-  }
-
-  // --- Helper ---
-
-  private List<? extends Token> parseInput(final String input) {
-    ANTLRInputStream inputStream = new ANTLRInputStream(input);
-    UriLexer lexer = new UriLexer(inputStream);
-    lexer.mode(startMode);
-    return lexer.getAllTokens();
-  }
-}


[06/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp ServerCore

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
index b6b6fda..b0312ce 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriContext.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -63,19 +63,20 @@ public class UriContext {
    */
   public ExpandItemImpl contextExpandItemPath;
   // CHECKSTYLE:ON (Maven checkstyle)
-  
-  //CHECKSTYLE:OFF (Maven checkstyle)
+
+  // CHECKSTYLE:OFF (Maven checkstyle)
   /**
-   * Set to true in method {@link UriParseTreeVisitor#visitExpandPath} right before 
-   * calling {@link  org.apache.olingo.server.core.uri.parser.UriParseTreeVisitor#readResourcePathSegment}
-   * After reading the path the variable is set back to false
-   * 
-   * readResourcePathSegment handles all navigation properties, it depends on the context if key predicates are allowed or not.
-   * In case of expand 
+   * Set to true in method {@link UriParseTreeVisitor#visitExpandPath} right before
+   * calling {@link org.apache.olingo.server.core.uri.parser.UriParseTreeVisitor#readResourcePathSegment} After reading
+   * the path the variable is set back to false
+   *
+   * readResourcePathSegment handles all navigation properties, it depends on the context if key predicates are allowed
+   * or not.
+   * In case of expand
    */
   public boolean contextVisitExpandResourcePath;
-  //CHECKSTYLE:ON (Maven checkstyle)
-  
+  // CHECKSTYLE:ON (Maven checkstyle)
+
   // CHECKSTYLE:OFF (Maven checkstyle)
   /**
    * Set within method
@@ -95,12 +96,12 @@ public class UriContext {
    */
   public UriInfoImpl contextUriInfo;
   public boolean contextReadingFunctionParameters;
-  
+
   /**
    * Set to true if the parser operates on query part.
    */
   public boolean contextReadingQueryPart;
-  
+
   public UriContext() {
 
     contextExpandItemPath = null;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
index 4649ac5..72bab53 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -93,7 +93,7 @@ public class UriDecoder {
    * @return list of elements (can be empty)
    */
   static List<String> splitSkipEmpty(final String input, final char c) {
-    if(input.isEmpty() || input.length() == 1 && input.charAt(0) == c) {
+    if (input.isEmpty() || input.length() == 1 && input.charAt(0) == c) {
       return Collections.emptyList();
     }
 
@@ -103,13 +103,13 @@ public class UriDecoder {
     int end;
 
     while ((end = input.indexOf(c, start)) >= 0) {
-      if(start != end) {
+      if (start != end) {
         list.add(input.substring(start, end));
       }
       start = end + 1;
     }
 
-    if(input.charAt(input.length()-1) != c) {
+    if (input.charAt(input.length() - 1) != c) {
       list.add(input.substring(start));
     }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
index 1e33a19..e4772c4 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParseTreeVisitor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -82,9 +82,7 @@ import org.apache.olingo.server.core.uri.UriResourceStartingTypeFilterImpl;
 import org.apache.olingo.server.core.uri.UriResourceTypedImpl;
 import org.apache.olingo.server.core.uri.UriResourceValueImpl;
 import org.apache.olingo.server.core.uri.UriResourceWithKeysImpl;
-import org.apache.olingo.server.core.uri.antlr.UriLexer;
-import org.apache.olingo.server.core.uri.antlr.UriParserBaseVisitor;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser;
+import org.apache.olingo.server.core.uri.antlr.*;
 import org.apache.olingo.server.core.uri.antlr.UriParserParser.AllEOFContext;
 import org.apache.olingo.server.core.uri.antlr.UriParserParser.AllExprContext;
 import org.apache.olingo.server.core.uri.antlr.UriParserParser.AltAddContext;
@@ -311,7 +309,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
     final boolean checkFirst =
         context.contextUriInfo.getLastResourcePart() == null
-            || context.contextUriInfo.getLastResourcePart() instanceof UriResourceRootImpl;
+        || context.contextUriInfo.getLastResourcePart() instanceof UriResourceRootImpl;
 
     String odi = ctx.vODI.getText();
 
@@ -335,7 +333,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       EdmEntitySet edmEntitySet = edmEntityContainer.getEntitySet(odi);
       if (edmEntitySet != null
           && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
+          || parts.get(0) instanceof UriResourceRoot)) {
         ensureNamespaceIsNull(ctx.vNS);
         context.contextUriInfo.addResourcePart(
             new UriResourceEntitySetImpl().setEntitSet(edmEntitySet));
@@ -346,7 +344,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       EdmSingleton edmSingleton = edmEntityContainer.getSingleton(odi);
       if (edmSingleton != null
           && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
+          || parts.get(0) instanceof UriResourceRoot)) {
         ensureNamespaceIsNull(ctx.vNS);
         context.contextUriInfo.addResourcePart(
             new UriResourceSingletonImpl().setSingleton(edmSingleton));
@@ -357,7 +355,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
       EdmActionImport edmActionImport = edmEntityContainer.getActionImport(odi);
       if (edmActionImport != null
           && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
+          || parts.get(0) instanceof UriResourceRoot)) {
         ensureNamespaceIsNull(ctx.vNS);
         context.contextUriInfo.addResourcePart(
             new UriResourceActionImpl().setActionImport(edmActionImport));
@@ -366,15 +364,15 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
       // check FunctionImport
       EdmFunctionImport edmFunctionImport = edmEntityContainer.getFunctionImport(odi);
-      
-      if(edmFunctionImport != null && context.contextReadingQueryPart) {
-        throw wrap(new UriParserSemanticException("Function Imports are not allowed in $filter or $orderby", 
+
+      if (edmFunctionImport != null && context.contextReadingQueryPart) {
+        throw wrap(new UriParserSemanticException("Function Imports are not allowed in $filter or $orderby",
             UriParserSemanticException.MessageKeys.FUNCTION_IMPORT_NOT_ALLOWED, odi));
       }
-      
+
       if (edmFunctionImport != null
           && (parts.isEmpty() || !(parts.get(0) instanceof UriResourcePartTyped)
-              || parts.get(0) instanceof UriResourceRoot)) {
+          || parts.get(0) instanceof UriResourceRoot)) {
 
         // read the URI parameters
         if (ctx.vlNVO.isEmpty()) {
@@ -391,7 +389,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         ctx.vlNVO.remove(0);
 
         UriResourceFunctionImpl uriResource = new UriResourceFunctionImpl()
-            .setFunctionImport(edmFunctionImport, parameters);
+        .setFunctionImport(edmFunctionImport, parameters);
 
         // collect parameter names
         List<String> names = new ArrayList<String>();
@@ -479,7 +477,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
             ctx.depth() > 2 ? // path evaluation inside an expression or for the resource path?
                 UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE
                 : UriParserSemanticException.MessageKeys.PROPERTY_NOT_IN_TYPE,
-            structType.getFullQualifiedName().getFullQualifiedNameAsString(), odi));
+                structType.getFullQualifiedName().getFullQualifiedNameAsString(), odi));
       }
 
       if (property instanceof EdmProperty) {
@@ -488,13 +486,13 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
             || property.getType().getKind() == EdmTypeKind.DEFINITION) {
           // create simple property
           UriResourcePrimitivePropertyImpl simpleResource = new UriResourcePrimitivePropertyImpl()
-              .setProperty((EdmProperty) property);
+          .setProperty((EdmProperty) property);
           context.contextUriInfo.addResourcePart(simpleResource);
           return null;
         } else {
           // create complex property
           UriResourceComplexPropertyImpl complexResource = new UriResourceComplexPropertyImpl()
-              .setProperty((EdmProperty) property);
+          .setProperty((EdmProperty) property);
           context.contextUriInfo.addResourcePart(complexResource);
           return null;
         }
@@ -507,7 +505,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         }
 
         UriResourceNavigationPropertyImpl navigationResource = new UriResourceNavigationPropertyImpl()
-            .setNavigationProperty((EdmNavigationProperty) property);
+        .setNavigationProperty((EdmNavigationProperty) property);
         context.contextUriInfo.addResourcePart(navigationResource);
         return null;
       } else {
@@ -534,8 +532,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
           if (lastResourcePart == null) {
             // this may be the case if a member expression within a filter starts with a typeCast
             UriResourceStartingTypeFilterImpl uriResource = new UriResourceStartingTypeFilterImpl()
-                .setType(filterEntityType)
-                .setCollection(source.isCollection);
+            .setType(filterEntityType)
+            .setCollection(source.isCollection);
             if (source.isCollection) {
               uriResource.setCollectionTypeFilter(filterEntityType);
             } else {
@@ -601,15 +599,15 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
             throw wrap(new UriParserSemanticException(
                 "Complex typefilter '" + getName(source.type) + "'not compatible type of previous path segment '"
                     + getName(filterComplexType) + "'",
-                UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER, getName(source.type)));
+                    UriParserSemanticException.MessageKeys.INCOMPATIBLE_TYPE_FILTER, getName(source.type)));
           }
 
           // is simple complex type cast
           if (lastResourcePart == null) {
             // this may be the case if a member expression within a filter starts with a typeCast
             UriResourceStartingTypeFilterImpl uriResource = new UriResourceStartingTypeFilterImpl()
-                .setType(filterComplexType)
-                .setCollection(source.isCollection);
+            .setType(filterComplexType)
+            .setCollection(source.isCollection);
 
             if (source.isCollection) {
               uriResource.setCollectionTypeFilter(filterComplexType);
@@ -698,8 +696,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
       if (function != null) {
         UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl()
-            .setFunction(function)
-            .setParameters(parameters);
+        .setFunction(function)
+        .setParameters(parameters);
         context.contextUriInfo.addResourcePart(pathInfoFunction);
 
         // mark parameters as consumed
@@ -712,8 +710,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
       if (function != null) {
         UriResourceFunctionImpl pathInfoFunction = new UriResourceFunctionImpl()
-            .setFunction(function)
-            .setParameters(parameters);
+        .setFunction(function)
+        .setParameters(parameters);
         context.contextUriInfo.addResourcePart(pathInfoFunction);
 
         // mark parameters as consumed
@@ -1073,16 +1071,16 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitCeilingMethodCallExpr(final CeilingMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.CEILING)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.CEILING)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitConcatMethodCallExpr(final ConcatMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.CONCAT)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this))
-        .addParameter((ExpressionImpl) ctx.vE2.accept(this));
+    .setMethod(MethodKind.CONCAT)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this))
+    .addParameter((ExpressionImpl) ctx.vE2.accept(this));
   }
 
   @Override
@@ -1141,9 +1139,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitContainsMethodCallExpr(final ContainsMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.CONTAINS)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this))
-        .addParameter((ExpressionImpl) ctx.vE2.accept(this));
+    .setMethod(MethodKind.CONTAINS)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this))
+    .addParameter((ExpressionImpl) ctx.vE2.accept(this));
   }
 
   @Override
@@ -1176,31 +1174,31 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public Object visitDateMethodCallExpr(final DateMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.DATE)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.DATE)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitDayMethodCallExpr(final DayMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.DAY)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.DAY)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitGeoDistanceMethodCallExpr(final GeoDistanceMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.GEODISTANCE)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this))
-        .addParameter((ExpressionImpl) ctx.vE2.accept(this));
+    .setMethod(MethodKind.GEODISTANCE)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this))
+    .addParameter((ExpressionImpl) ctx.vE2.accept(this));
   }
 
   @Override
   public Object visitEndsWithMethodCallExpr(final EndsWithMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.ENDSWITH)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this))
-        .addParameter((ExpressionImpl) ctx.vE2.accept(this));
+    .setMethod(MethodKind.ENDSWITH)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this))
+    .addParameter((ExpressionImpl) ctx.vE2.accept(this));
   }
 
   @Override
@@ -1332,7 +1330,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
     return expandItem;
   }
 
-  private void validate(UriInfoResource uriInfoResource, ExpandItemImpl expandItem) {
+  private void validate(final UriInfoResource uriInfoResource, final ExpandItemImpl expandItem) {
     if (uriInfoResource != null) {
       EdmEntityType type = getEntityType(uriInfoResource);
       EdmEntityType name = getEntityType(expandItem.getResourcePath());
@@ -1343,15 +1341,15 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
           throw wrap(new UriParserSemanticException(
               "NavigationProperty '" + name.getName() + "' not found in type '"
                   + type.getFullQualifiedName().getFullQualifiedNameAsString() + "'",
-              UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE,
-              name.getFullQualifiedName().getFullQualifiedNameAsString(),
-              type.getFullQualifiedName().getFullQualifiedNameAsString()));
+                  UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE,
+                  name.getFullQualifiedName().getFullQualifiedNameAsString(),
+                  type.getFullQualifiedName().getFullQualifiedNameAsString()));
         }
       }
     }
   }
 
-  private EdmEntityType getEntityType(UriInfoResource test) {
+  private EdmEntityType getEntityType(final UriInfoResource test) {
     List<UriResource> parts = test.getUriResourceParts();
     if (!parts.isEmpty()) {
       UriResource lastPart = parts.get(parts.size() - 1);
@@ -1419,7 +1417,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   public Object visitFilter(final FilterContext ctx) {
     context.contextReadingQueryPart = true;
     final FilterOptionImpl result = new FilterOptionImpl().setExpression((ExpressionImpl) ctx.children.get(2)
-                                                          .accept(this));
+        .accept(this));
     context.contextReadingQueryPart = false;
 
     return result;
@@ -1429,7 +1427,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   public Object visitFilterExpressionEOF(final FilterExpressionEOFContext ctx) {
     context.contextReadingQueryPart = true;
     final FilterOptionImpl result = new FilterOptionImpl().setExpression((ExpressionImpl) ctx.children.get(0)
-                                                          .accept(this));
+        .accept(this));
     context.contextReadingQueryPart = false;
 
     return result;
@@ -1438,53 +1436,53 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitFloorMethodCallExpr(final FloorMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.FLOOR)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.FLOOR)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitFractionalsecondsMethodCallExpr(final FractionalsecondsMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.FRACTIONALSECONDS)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.FRACTIONALSECONDS)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitGeoLengthMethodCallExpr(final GeoLengthMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.GEOLENGTH)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.GEOLENGTH)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitHourMethodCallExpr(final HourMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.HOUR)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.HOUR)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitIndexOfMethodCallExpr(final IndexOfMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.INDEXOF)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this))
-        .addParameter((ExpressionImpl) ctx.vE2.accept(this));
+    .setMethod(MethodKind.INDEXOF)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this))
+    .addParameter((ExpressionImpl) ctx.vE2.accept(this));
   }
 
   @Override
   public Object visitInlinecount(final InlinecountContext ctx) {
     final String text = ctx.children.get(2).getText();
     return new CountOptionImpl()
-        .setValue(text.equalsIgnoreCase("true") ? true : false)
-        .setText(text);
+    .setValue(text.equalsIgnoreCase("true") ? true : false)
+    .setText(text);
   }
 
   @Override
   public ExpressionImpl visitGeoIntersectsMethodCallExpr(final GeoIntersectsMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.GEOINTERSECTS)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this))
-        .addParameter((ExpressionImpl) ctx.vE2.accept(this));
+    .setMethod(MethodKind.GEOINTERSECTS)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this))
+    .addParameter((ExpressionImpl) ctx.vE2.accept(this));
   }
 
   @Override
@@ -1509,8 +1507,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitLengthMethodCallExpr(final LengthMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.LENGTH)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.LENGTH)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
@@ -1534,7 +1532,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitMaxDateTimeMethodCallExpr(final MaxDateTimeMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.MAXDATETIME);
+    .setMethod(MethodKind.MAXDATETIME);
   }
 
   @Override
@@ -1589,21 +1587,21 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitMinDateTimeMethodCallExpr(final MinDateTimeMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.MINDATETIME);
+    .setMethod(MethodKind.MINDATETIME);
   }
 
   @Override
   public ExpressionImpl visitMinuteMethodCallExpr(final MinuteMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.MINUTE)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.MINUTE)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitMonthMethodCallExpr(final MonthMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.MONTH)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.MONTH)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
@@ -1646,9 +1644,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
           if (lastKeyPredicates.size() == 1) {
             return Collections.singletonList(new UriParameterImpl()
-                .setName(lastKeyPredicates.get(0))
-                .setText(valueText)
-                .setExpression(expression));
+            .setName(lastKeyPredicates.get(0))
+            .setText(valueText)
+            .setExpression(expression));
           } else {
             throw wrap(new UriParserSemanticException("Wrong number of key properties.",
                 UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES,
@@ -1666,9 +1664,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         // so fill the keylist with this key and return.
         if (lastKeyPredicates.size() == 1) {
           return Collections.singletonList(new UriParameterImpl()
-              .setName(lastKeyPredicates.get(0))
-              .setText(valueText)
-              .setExpression(expression));
+          .setName(lastKeyPredicates.get(0))
+          .setText(valueText)
+          .setExpression(expression));
         }
 
         // There are more keys defined in the EDM, but only one is written in the URI. This is allowed only if
@@ -1825,8 +1823,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         final UriResource last = context.contextUriInfo.getLastResourcePart();
         final int number = last instanceof UriResourcePartTyped ? ((EdmEntityType) ((UriResourcePartTyped) last)
             .getType()).getKeyPredicateNames().size() : 0;
-        throw wrap(new UriParserSemanticException("Wrong number of key properties.",
-            UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES, Integer.toString(number), "0"));
+            throw wrap(new UriParserSemanticException("Wrong number of key properties.",
+                UriParserSemanticException.MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES, Integer.toString(number), "0"));
       }
     }
   }
@@ -1856,7 +1854,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitNowMethodCallExpr(final NowMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.NOW);
+    .setMethod(MethodKind.NOW);
   }
 
   @Override
@@ -1888,7 +1886,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public Object visitOrderByEOF(final OrderByEOFContext ctx) {
     context.contextReadingQueryPart = true;
-    
+
     OrderByOptionImpl orderBy = new OrderByOptionImpl();
 
     for (OrderByItemContext item : ((OrderListContext) ctx.getChild(0)).vlOI) {
@@ -1917,7 +1915,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
     /*
      * if (contextUriInfo.getLastResourcePart() == null ||
      * contextUriInfo.getLastResourcePart() instanceof UriResourceRootImpl) {
-     * 
+     *
      * } else {
      * readNextPathInfoSegment(ctx);
      * }
@@ -1936,7 +1934,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
         @SuppressWarnings("unchecked")
         List<UriParameter> list = (List<UriParameter>) ctx.vlNVO.get(0).accept(this);
         ((UriResourceWithKeysImpl) pathInfoSegment)
-            .setKeyPredicates(list);
+        .setKeyPredicates(list);
       } else {
         throw wrap(new UriParserSemanticException("Key properties not allowed",
             UriParserSemanticException.MessageKeys.KEY_NOT_ALLOWED));
@@ -1986,7 +1984,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   }
 
   @Override
-  public Object visitBinaryLiteral(BinaryLiteralContext ctx) {
+  public Object visitBinaryLiteral(final BinaryLiteralContext ctx) {
     return new LiteralImpl().setText(ctx.getText())
         .setType(EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Binary));
   }
@@ -2002,7 +2000,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
     final EdmType type = EdmPrimitiveTypeFactory.getInstance(
         ctx.getText().contains("e") || ctx.getText().contains("E") ?
             EdmPrimitiveTypeKind.Double :
-            EdmPrimitiveTypeKind.Decimal);
+              EdmPrimitiveTypeKind.Decimal);
 
     return new LiteralImpl().setText(ctx.getText()).setType(type);
   }
@@ -2119,22 +2117,22 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
     }
     return new MemberImpl()
-        .setResourcePath(uriInfoImplpath);
+    .setResourcePath(uriInfoImplpath);
 
   }
 
   @Override
   public ExpressionImpl visitRoundMethodCallExpr(final RoundMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.ROUND)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.ROUND)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitSecondMethodCallExpr(final SecondMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.SECOND)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.SECOND)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
@@ -2157,7 +2155,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
     final QueryOptionImpl result = new SelectOptionImpl().setSelectItems(selectItems).setText(ctx.getText());
     context.contextReadingQueryPart = false;
-    
+
     return result;
   }
 
@@ -2353,7 +2351,7 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
            * if ((et.compatibleTo((EdmStructuralType) prevType))) {
            * UriResourceStartingTypeFilterImpl resourcePart = new UriResourceStartingTypeFilterImpl();
            * resourcePart.setEntryTypeFilter(et);
-           * 
+           *
            * uriInfo.addResourcePart(resourcePart);
            * return this;
            * }
@@ -2409,8 +2407,8 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   public Object visitSkip(final SkipContext ctx) {
     final String text = ctx.children.get(2).getText();
     return new SkipOptionImpl()
-        .setValue(Integer.parseInt(text))
-        .setText(text);
+    .setValue(Integer.parseInt(text))
+    .setText(text);
   }
 
   @Override
@@ -2422,9 +2420,9 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitStartsWithMethodCallExpr(final StartsWithMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.STARTSWITH)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this))
-        .addParameter((ExpressionImpl) ctx.vE2.accept(this));
+    .setMethod(MethodKind.STARTSWITH)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this))
+    .addParameter((ExpressionImpl) ctx.vE2.accept(this));
   }
 
   @Override
@@ -2445,58 +2443,58 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
   @Override
   public ExpressionImpl visitTimeMethodCallExpr(final TimeMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.TIME)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.TIME)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public Object visitTop(final TopContext ctx) {
     final String text = ctx.children.get(2).getText();
     return new TopOptionImpl()
-        .setValue(Integer.parseInt(text))
-        .setText(text);
+    .setValue(Integer.parseInt(text))
+    .setText(text);
   }
 
   @Override
   public ExpressionImpl visitToLowerMethodCallExpr(final ToLowerMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.TOLOWER)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.TOLOWER)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitTotalOffsetMinutesMethodCallExpr(final TotalOffsetMinutesMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.TOTALOFFSETMINUTES)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.TOTALOFFSETMINUTES)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitTotalsecondsMethodCallExpr(final TotalsecondsMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.TOTALSECONDS)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.TOTALSECONDS)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitToUpperMethodCallExpr(final ToUpperMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.TOUPPER)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.TOUPPER)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitTrimMethodCallExpr(final TrimMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.TRIM)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.TRIM)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   @Override
   public ExpressionImpl visitYearMethodCallExpr(final YearMethodCallExprContext ctx) {
     return new MethodImpl()
-        .setMethod(MethodKind.YEAR)
-        .addParameter((ExpressionImpl) ctx.vE1.accept(this));
+    .setMethod(MethodKind.YEAR)
+    .addParameter((ExpressionImpl) ctx.vE1.accept(this));
   }
 
   private ParseCancellationException wrap(final UriParserException uriParserException) {
@@ -2533,13 +2531,13 @@ public class UriParseTreeVisitor extends UriParserBaseVisitor<Object> {
 
     return new LiteralImpl().setText(ctx.getText()).setType(null);
   }
-  
+
   @Override
-  public Object visitExpandItemsEOF(ExpandItemsEOFContext ctx) {
+  public Object visitExpandItemsEOF(final ExpandItemsEOFContext ctx) {
     context.contextReadingQueryPart = true;
     final Object result = super.visitExpandItemsEOF(ctx);
     context.contextReadingQueryPart = false;
-    
+
     return result;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java
index 8623d12..44b3783 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
index 9135dd8..33dd321 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -79,12 +79,12 @@ public class UriParserSemanticException extends UriParserException {
     /** parameter: not implemented part */
     NOT_IMPLEMENTED,
     /** parameter: namespace **/
-    NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT, 
+    NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT,
     /** parameter: complex parameter value */
-    COMPLEX_PARAMETER_IN_RESOURCE_PATH, 
+    COMPLEX_PARAMETER_IN_RESOURCE_PATH,
     /** parameter: function import name */
     FUNCTION_IMPORT_NOT_ALLOWED;
-    
+
     @Override
     public String getKey() {
       return name();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java
index 31f69d3..895e31e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSyntaxException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,7 +35,7 @@ public class UriParserSyntaxException extends UriParserException {
     /** parameter: $format option value */
     WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION_FORMAT,
     SYSTEM_QUERY_OPTION_LEVELS_NOT_ALLOWED_HERE,
-    SYNTAX, 
+    SYNTAX,
     /** parameter: alias name */
     DUPLICATED_ALIAS;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchBinaryImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchBinaryImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchBinaryImpl.java
index 418d9e7..950383c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchBinaryImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchBinaryImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,7 +28,8 @@ public class SearchBinaryImpl extends SearchExpressionImpl implements SearchBina
   private final SearchExpression left;
   private final SearchExpression right;
 
-  public SearchBinaryImpl(SearchExpression left, SearchBinaryOperatorKind operator, SearchExpression right) {
+  public SearchBinaryImpl(final SearchExpression left, final SearchBinaryOperatorKind operator,
+      final SearchExpression right) {
     this.left = left;
     this.operator = operator;
     this.right = right;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchExpressionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchExpressionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchExpressionImpl.java
index ee5a197..b2970bd 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchExpressionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchExpressionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
index ac0bb7d..4fccb81 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParser.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -31,11 +31,11 @@ import org.apache.olingo.server.core.uri.queryoption.SearchOptionImpl;
 /*
  * Rewritten grammar
  * 
- * SearchExpr  ::=     ExprOR
- * ExprOR      ::=     ExprAnd ('OR' ExprAnd)*
- * ExprAnd     ::=     Term ('AND'? Term)*
- * Term        ::=     ('NOT')? (Word | Phrase)
- *                     | '(' Expr ')' 
+ * SearchExpr ::= ExprOR
+ * ExprOR ::= ExprAnd ('OR' ExprAnd)*
+ * ExprAnd ::= Term ('AND'? Term)*
+ * Term ::= ('NOT')? (Word | Phrase)
+ * | '(' Expr ')'
  */
 
 public class SearchParser {
@@ -43,7 +43,7 @@ public class SearchParser {
   private Iterator<SearchQueryToken> tokens;
   private SearchQueryToken token;
 
-  public SearchOption parse(String searchQuery) throws SearchParserException, SearchTokenizerException {
+  public SearchOption parse(final String searchQuery) throws SearchParserException, SearchTokenizerException {
     SearchTokenizer tokenizer = new SearchTokenizer();
     SearchExpression searchExpression;
     try {
@@ -51,21 +51,21 @@ public class SearchParser {
     } catch (SearchTokenizerException e) {
       String message = e.getMessage();
       throw new SearchParserException("Tokenizer exception with message: " + message,
-              SearchParserException.MessageKeys.TOKENIZER_EXCEPTION, message);
+          SearchParserException.MessageKeys.TOKENIZER_EXCEPTION, message);
     }
     final SearchOptionImpl searchOption = new SearchOptionImpl();
     searchOption.setSearchExpression(searchExpression);
     return searchOption;
   }
 
-  protected SearchExpression parse(List<SearchQueryToken> tokens) throws SearchParserException {
+  protected SearchExpression parse(final List<SearchQueryToken> tokens) throws SearchParserException {
     this.tokens = tokens.iterator();
     nextToken();
     if (token == null) {
       throw new SearchParserException("No search String", SearchParserException.MessageKeys.NO_EXPRESSION_FOUND);
     }
     SearchExpression searchExpression = processSearchExpression();
-    if(!isEof()) {
+    if (!isEof()) {
       throw new SearchParserException("Token left after end of search query parsing.",
           SearchParserException.MessageKeys.INVALID_END_OF_QUERY, getTokenAsString());
     }
@@ -73,41 +73,41 @@ public class SearchParser {
   }
 
   private SearchExpression processSearchExpression() throws SearchParserException {
-      return processExprOr();
+    return processExprOr();
   }
 
   private SearchExpression processExprOr() throws SearchParserException {
     SearchExpression left = processExprAnd();
-    
-    while(isToken(Token.OR)) {
-      nextToken();    // Match OR
+
+    while (isToken(Token.OR)) {
+      nextToken(); // Match OR
       final SearchExpression right = processExprAnd();
       left = new SearchBinaryImpl(left, SearchBinaryOperatorKind.OR, right);
     }
-    
+
     return left;
   }
 
   private SearchExpression processExprAnd() throws SearchParserException {
     SearchExpression left = processTerm();
-    
-    while(isToken(Token.AND) || isTerm()) {
-      if(isToken(Token.AND)) {
-        nextToken();    // Match AND
+
+    while (isToken(Token.AND) || isTerm()) {
+      if (isToken(Token.AND)) {
+        nextToken(); // Match AND
       }
       final SearchExpression right = processTerm();
       left = new SearchBinaryImpl(left, SearchBinaryOperatorKind.AND, right);
     }
-    
+
     return left;
   }
 
   private SearchExpression processTerm() throws SearchParserException {
-    if(isToken(SearchQueryToken.Token.OPEN)) {
-      nextToken();    // Match OPEN
+    if (isToken(SearchQueryToken.Token.OPEN)) {
+      nextToken(); // Match OPEN
       final SearchExpression expr = processExprOr();
       processClose();
-      
+
       return expr;
     } else {
       // ('NOT')? (Word | Phrase)
@@ -137,14 +137,14 @@ public class SearchParser {
     throw new SearchParserException("NOT must be followed by a term not a " + tokenAsString,
         SearchParserException.MessageKeys.INVALID_NOT_OPERAND, tokenAsString);
   }
-  
+
   private SearchTerm processWordOrPhrase() throws SearchParserException {
     if (isToken(Token.PHRASE)) {
       return processPhrase();
     } else if (isToken(Token.WORD)) {
       return processWord();
     }
-    
+
     final String tokenName = getTokenAsString();
     throw new SearchParserException("Expected PHRASE||WORD found: " + tokenName,
         SearchParserException.MessageKeys.EXPECTED_DIFFERENT_TOKEN,
@@ -160,21 +160,21 @@ public class SearchParser {
   private SearchTerm processPhrase() {
     String literal = token.getLiteral();
     nextToken();
-    return new SearchTermImpl(literal.substring(1,literal.length()-1));
+    return new SearchTermImpl(literal.substring(1, literal.length() - 1));
   }
-  
+
   private boolean isTerm() {
     return isToken(SearchQueryToken.Token.NOT)
         || isToken(SearchQueryToken.Token.PHRASE)
         || isToken(SearchQueryToken.Token.WORD)
         || isToken(SearchQueryToken.Token.OPEN);
   }
-  
+
   private boolean isEof() {
     return token == null;
   }
 
-  private boolean isToken(SearchQueryToken.Token toCheckToken) {
+  private boolean isToken(final SearchQueryToken.Token toCheckToken) {
     return token != null && token.getToken() == toCheckToken;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParserException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParserException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParserException.java
index d7af4d4..293bc31 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParserException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchParserException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -36,7 +36,7 @@ public class SearchParserException extends UriParserSyntaxException {
     EXPECTED_DIFFERENT_TOKEN,
     /** parameter: actual token */
     INVALID_END_OF_QUERY;
-    
+
     @Override
     public String getKey() {
       return name();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchQueryToken.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchQueryToken.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchQueryToken.java
index 3fb66f1..0fbab47 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchQueryToken.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchQueryToken.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,8 +19,11 @@
 package org.apache.olingo.server.core.uri.parser.search;
 
 public interface SearchQueryToken {
-  enum Token {OPEN, NOT, AND, OR, WORD, PHRASE, CLOSE}
+  enum Token {
+    OPEN, NOT, AND, OR, WORD, PHRASE, CLOSE
+  }
 
   Token getToken();
+
   String getLiteral();
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTermImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTermImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTermImpl.java
index efd7280..54f7075 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTermImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTermImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,7 @@ import org.apache.olingo.server.api.uri.queryoption.search.SearchTerm;
 public class SearchTermImpl extends SearchExpressionImpl implements SearchTerm {
   private final String term;
 
-  public SearchTermImpl(String term) {
+  public SearchTermImpl(final String term) {
     this.term = term;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
index 546135d..4b88869 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -62,39 +62,40 @@ public class SearchTokenizer {
     protected static final char CHAR_CLOSE = ')';
     protected static final char CHAR_OPEN = '(';
 
-    public State() {
-    }
-    public State(Token t) {
+    public State() {}
+
+    public State(final Token t) {
       token = t;
     }
-    public State(Token t, boolean finished) {
+
+    public State(final Token t, final boolean finished) {
       this(t);
       this.finished = finished;
     }
 
     protected abstract State nextChar(char c) throws SearchTokenizerException;
 
-    public State allowed(char c) {
+    public State allowed(final char c) {
       return this;
     }
 
-    public State forbidden(char c) throws SearchTokenizerException {
-      throw new SearchTokenizerException("Forbidden character in state " + this.getToken() + "->" + c,
+    public State forbidden(final char c) throws SearchTokenizerException {
+      throw new SearchTokenizerException("Forbidden character in state " + getToken() + "->" + c,
           SearchTokenizerException.MessageKeys.FORBIDDEN_CHARACTER, "" + c);
     }
 
     public State invalid() throws SearchTokenizerException {
-      throw new SearchTokenizerException("Token " + this.getToken() + " is in invalid state.",
+      throw new SearchTokenizerException("Token " + getToken() + " is in invalid state.",
           SearchTokenizerException.MessageKeys.INVALID_TOKEN_STATE);
     }
 
     public State finish() {
-      this.finished = true;
+      finished = true;
       return this;
     }
 
-    public State finishAs(Token token) {
-      this.finished = true;
+    public State finishAs(final Token token) {
+      finished = true;
       return changeToken(token);
     }
 
@@ -102,12 +103,13 @@ public class SearchTokenizer {
       return finished;
     }
 
+    @Override
     public Token getToken() {
       return token;
     }
 
     public String getTokenName() {
-      if(token == null) {
+      if (token == null) {
         return "NULL";
       }
       return token.name();
@@ -117,7 +119,7 @@ public class SearchTokenizer {
       return this;
     }
 
-    protected State changeToken(Token token) {
+    protected State changeToken(final Token token) {
       this.token = token;
       return this;
     }
@@ -172,13 +174,12 @@ public class SearchTokenizer {
       return isQCharUnescaped(character) || character == '%';
     }
 
-
     /**
      * qchar-unescaped = unreserved / pct-encoded-unescaped / other-delims / ":" / "@" / "/" / "?" / "$" / "'" / "="
      * @param character which is checked
      * @return true if character is allowed
      */
-    private static boolean isQCharUnescaped(char character) {
+    private static boolean isQCharUnescaped(final char character) {
       return isUnreserved(character)
           || isOtherDelims(character)
           || character == ':'
@@ -194,7 +195,7 @@ public class SearchTokenizer {
      * @param character which is checked
      * @return true if character is allowed
      */
-    private static boolean isOtherDelims(char character) {
+    private static boolean isOtherDelims(final char character) {
       return character == '!'
           || character == '('
           || character == ')'
@@ -209,7 +210,7 @@ public class SearchTokenizer {
      * @param character which is checked
      * @return true if character is allowed
      */
-    private static boolean isUnreserved(char character) {
+    private static boolean isUnreserved(final char character) {
       return isAlphaOrDigit(character)
           || character == '-'
           || character == '.'
@@ -223,7 +224,7 @@ public class SearchTokenizer {
      * @param character which is checked
      * @return true if character is allowed
      */
-    private static boolean isAlphaOrDigit(char character) {
+    private static boolean isAlphaOrDigit(final char character) {
       return 'A' <= character && character <= 'Z' // case A..Z
           || 'a' <= character && character <= 'z' // case a..z
           || '0' <= character && character <= '9'; // case 0..9
@@ -248,20 +249,23 @@ public class SearchTokenizer {
 
   private static abstract class LiteralState extends State {
     protected final StringBuilder literal = new StringBuilder();
+
     public LiteralState() {
       super();
     }
-    public LiteralState(Token t, char c) throws SearchTokenizerException {
+
+    public LiteralState(final Token t, final char c) throws SearchTokenizerException {
       super(t);
       init(c);
     }
 
-    public LiteralState(Token t, String initLiteral) {
+    public LiteralState(final Token t, final String initLiteral) {
       super(t);
       literal.append(initLiteral);
     }
 
-    public State allowed(char c) {
+    @Override
+    public State allowed(final char c) {
       literal.append(c);
       return this;
     }
@@ -271,7 +275,7 @@ public class SearchTokenizer {
       return literal.toString();
     }
 
-    public State init(char c) throws SearchTokenizerException {
+    public State init(final char c) throws SearchTokenizerException {
       if (isFinished()) {
         throw new SearchTokenizerException(toString() + " is already finished.",
             SearchTokenizerException.MessageKeys.ALREADY_FINISHED, getTokenName());
@@ -283,7 +287,7 @@ public class SearchTokenizer {
 
   private class SearchExpressionState extends LiteralState {
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (c == CHAR_OPEN) {
         return new OpenState();
       } else if (isWhitespace(c)) {
@@ -296,14 +300,14 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State init(char c) throws SearchTokenizerException {
+    public State init(final char c) throws SearchTokenizerException {
       return nextChar(c);
     }
   }
 
   private class SearchTermState extends LiteralState {
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (c == CHAR_N) {
         return new NotState(c);
       } else if (c == QUOTATION_MARK) {
@@ -315,20 +319,20 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State init(char c) throws SearchTokenizerException {
+    public State init(final char c) throws SearchTokenizerException {
       return nextChar(c);
     }
   }
 
   private class SearchWordState extends LiteralState {
-    public SearchWordState(char c) throws SearchTokenizerException {
+    public SearchWordState(final char c) throws SearchTokenizerException {
       super(Token.WORD, c);
       if (!isAllowedWord(c)) {
         forbidden(c);
       }
     }
 
-    public SearchWordState(State toConsume) throws SearchTokenizerException {
+    public SearchWordState(final State toConsume) throws SearchTokenizerException {
       super(Token.WORD, toConsume.getLiteral());
       for (int i = 0; i < literal.length(); i++) {
         if (!isAllowedWord(literal.charAt(i))) {
@@ -338,7 +342,7 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (isAllowedWord(c)) {
         return allowed(c);
       } else if (c == CHAR_CLOSE) {
@@ -354,13 +358,13 @@ public class SearchTokenizer {
     @Override
     public State finish() {
       String tmpLiteral = literal.toString();
-      if(tmpLiteral.length() == 3) {
-        if(Token.AND.name().equals(tmpLiteral)) {
+      if (tmpLiteral.length() == 3) {
+        if (Token.AND.name().equals(tmpLiteral)) {
           return finishAs(Token.AND);
-        } else if(Token.NOT.name().equals(tmpLiteral)) {
+        } else if (Token.NOT.name().equals(tmpLiteral)) {
           return finishAs(Token.NOT);
         }
-      } else if(tmpLiteral.length() == 2 && Token.OR.name().equals(tmpLiteral)) {
+      } else if (tmpLiteral.length() == 2 && Token.OR.name().equals(tmpLiteral)) {
         return finishAs(Token.OR);
       }
       return super.finish();
@@ -375,7 +379,8 @@ public class SearchTokenizer {
   private class SearchPhraseState extends LiteralState {
     private boolean closed = false;
     private boolean escaped = false;
-    public SearchPhraseState(char c) throws SearchTokenizerException {
+
+    public SearchPhraseState(final char c) throws SearchTokenizerException {
       super(Token.PHRASE, c);
       if (c != QUOTATION_MARK) {
         forbidden(c);
@@ -383,22 +388,22 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
-      if(closed) {
+    public State nextChar(final char c) throws SearchTokenizerException {
+      if (closed) {
         finish();
         if (c == CHAR_CLOSE) {
           return new CloseState();
         } else if (isWhitespace(c)) {
           return new RwsState();
         }
-      } else if(escaped) {
+      } else if (escaped) {
         escaped = false;
-        if(c == QUOTATION_MARK || c == PHRASE_ESCAPE_CHAR) {
+        if (c == QUOTATION_MARK || c == PHRASE_ESCAPE_CHAR) {
           return allowed(c);
         } else {
           return forbidden(c);
         }
-      } else if(c == PHRASE_ESCAPE_CHAR) {
+      } else if (c == PHRASE_ESCAPE_CHAR) {
         escaped = true;
         return this;
       } else if (isAllowedPhrase(c)) {
@@ -406,7 +411,7 @@ public class SearchTokenizer {
       } else if (isWhitespace(c)) {
         return allowed(c);
       } else if (c == QUOTATION_MARK) {
-        if(literal.length() == 1) {
+        if (literal.length() == 1) {
           return invalid();
         }
         closed = true;
@@ -417,7 +422,7 @@ public class SearchTokenizer {
 
     @Override
     public State close() throws SearchTokenizerException {
-      if(closed) {
+      if (closed) {
         return finish();
       }
       return invalid();
@@ -430,7 +435,7 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       finish();
       if (isWhitespace(c)) {
         return forbidden(c);
@@ -445,13 +450,13 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       return new SearchExpressionState().init(c);
     }
   }
 
   private class NotState extends LiteralState {
-    public NotState(char c) throws SearchTokenizerException {
+    public NotState(final char c) throws SearchTokenizerException {
       super(Token.NOT, c);
       if (c != CHAR_N) {
         forbidden(c);
@@ -459,7 +464,7 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (literal.length() == 1 && c == CHAR_O) {
         return allowed(c);
       } else if (literal.length() == 2 && c == CHAR_T) {
@@ -467,16 +472,17 @@ public class SearchTokenizer {
       } else if (literal.length() == 3 && isWhitespace(c)) {
         finish();
         return new BeforePhraseOrWordRwsState();
-      } else if(isWhitespace(c)) {
+      } else if (isWhitespace(c)) {
         changeToken(Token.WORD).finish();
         return new RwsState();
       }
       literal.append(c);
       return new SearchWordState(this);
     }
+
     @Override
     public State close() throws SearchTokenizerException {
-      if(Token.NOT.name().equals(literal.toString())) {
+      if (Token.NOT.name().equals(literal.toString())) {
         return finish();
       }
       return changeToken(Token.WORD).finish();
@@ -484,7 +490,7 @@ public class SearchTokenizer {
   }
 
   private class AndState extends LiteralState {
-    public AndState(char c) throws SearchTokenizerException {
+    public AndState(final char c) throws SearchTokenizerException {
       super(Token.AND, c);
       if (c != CHAR_A) {
         forbidden(c);
@@ -492,7 +498,7 @@ public class SearchTokenizer {
     }
 
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (literal.length() == 1 && c == CHAR_N) {
         return allowed(c);
       } else if (literal.length() == 2 && c == CHAR_D) {
@@ -500,16 +506,17 @@ public class SearchTokenizer {
       } else if (literal.length() == 3 && isWhitespace(c)) {
         finish();
         return new BeforeSearchExpressionRwsState();
-      } else if(isWhitespace(c)) {
+      } else if (isWhitespace(c)) {
         changeToken(Token.WORD).finish();
         return new RwsState();
       }
       literal.append(c);
       return new SearchWordState(this);
     }
+
     @Override
     public State close() throws SearchTokenizerException {
-      if(Token.AND.name().equals(literal.toString())) {
+      if (Token.AND.name().equals(literal.toString())) {
         return finish();
       }
       return changeToken(Token.WORD).finish();
@@ -517,29 +524,31 @@ public class SearchTokenizer {
   }
 
   private class OrState extends LiteralState {
-    public OrState(char c) throws SearchTokenizerException {
+    public OrState(final char c) throws SearchTokenizerException {
       super(Token.OR, c);
       if (c != CHAR_O) {
         forbidden(c);
       }
     }
+
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (literal.length() == 1 && (c == CHAR_R)) {
         return allowed(c);
       } else if (literal.length() == 2 && isWhitespace(c)) {
         finish();
         return new BeforeSearchExpressionRwsState();
-      } else if(isWhitespace(c)) {
+      } else if (isWhitespace(c)) {
         changeToken(Token.WORD).finish();
         return new RwsState();
       }
       literal.append(c);
       return new SearchWordState(this);
     }
+
     @Override
     public State close() throws SearchTokenizerException {
-      if(Token.OR.name().equals(literal.toString())) {
+      if (Token.OR.name().equals(literal.toString())) {
         return finish();
       }
       return changeToken(Token.WORD).finish();
@@ -550,7 +559,7 @@ public class SearchTokenizer {
   // RWS [ 'AND' RWS ] searchExpr
   private class BeforeSearchExpressionRwsState extends State {
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (isWhitespace(c)) {
         return allowed(c);
       } else {
@@ -561,7 +570,7 @@ public class SearchTokenizer {
 
   private class BeforePhraseOrWordRwsState extends State {
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (isWhitespace(c)) {
         return allowed(c);
       } else if (c == QUOTATION_MARK) {
@@ -574,7 +583,7 @@ public class SearchTokenizer {
 
   private class RwsState extends State {
     @Override
-    public State nextChar(char c) throws SearchTokenizerException {
+    public State nextChar(final char c) throws SearchTokenizerException {
       if (isWhitespace(c)) {
         return allowed(c);
       } else if (c == CHAR_O) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerException.java
index 6ebec5a..bf3baf2 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,7 +25,7 @@ public class SearchTokenizerException extends UriParserSyntaxException {
   private static final long serialVersionUID = -8295456415309640166L;
 
   public enum MessageKeys implements MessageKey {
-    /** parameter: character, TOKEN  */
+    /** parameter: character, TOKEN */
     FORBIDDEN_CHARACTER,
     /** parameter: TOKEN */
     NOT_EXPECTED_TOKEN,

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchUnaryImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchUnaryImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchUnaryImpl.java
index 51e3a24..8e9335f 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchUnaryImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchUnaryImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,7 +25,7 @@ import org.apache.olingo.server.api.uri.queryoption.search.SearchUnaryOperatorKi
 public class SearchUnaryImpl extends SearchExpressionImpl implements SearchUnary {
   private final SearchTerm operand;
 
-  public SearchUnaryImpl(SearchTerm operand) {
+  public SearchUnaryImpl(final SearchTerm operand) {
     this.operand = operand;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/AliasQueryOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/AliasQueryOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/AliasQueryOptionImpl.java
index 3a4fdf1..2f94925 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/AliasQueryOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/AliasQueryOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CountOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CountOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CountOptionImpl.java
index fa35d2e..c4bfa7d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CountOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CountOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java
index 371377c..2fe8a01 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/CustomQueryOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java
index fb1a84e..3ccea06 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandItemImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -81,7 +81,7 @@ public class ExpandItemImpl implements ExpandItem {
       topOption = (TopOption) sysItem;
     } else if (sysItem instanceof LevelsExpandOption) {
       if (levelsExpandOption != null) {
-        throw new ODataRuntimeException("$levels"); 
+        throw new ODataRuntimeException("$levels");
       }
       levelsExpandOption = (LevelsExpandOption) sysItem;
     }
@@ -90,7 +90,7 @@ public class ExpandItemImpl implements ExpandItem {
 
   private void validateDoubleSystemQueryOption(final SystemQueryOption oldOption, final SystemQueryOption newOption) {
     if (oldOption != null) {
-      throw new ODataRuntimeException(newOption.getName()); 
+      throw new ODataRuntimeException(newOption.getName());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java
index bb4986d..05ee260 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FilterOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FilterOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FilterOptionImpl.java
index 50e8c46..4ca1f44 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FilterOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FilterOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FormatOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FormatOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FormatOptionImpl.java
index 607afbb..e0a47b8 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FormatOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/FormatOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/IdOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/IdOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/IdOptionImpl.java
index 309b30a..4295630 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/IdOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/IdOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/LevelsOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/LevelsOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/LevelsOptionImpl.java
index dc17fdc..4388a05 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/LevelsOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/LevelsOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByItemImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByItemImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByItemImpl.java
index aac33f0..a1276d3 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByItemImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByItemImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java
index 5ff50dc..c23ddb6 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionImpl.java
index ac3f721..26fb22d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SearchOptionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SearchOptionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SearchOptionImpl.java
index 51323a8..45a0cd4 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SearchOptionImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SearchOptionImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,7 +35,7 @@ public class SearchOptionImpl extends SystemQueryOptionImpl implements SearchOpt
     return searchExpression;
   }
 
-  public void setSearchExpression(SearchExpression searchExpression) {
+  public void setSearchExpression(final SearchExpression searchExpression) {
     this.searchExpression = searchExpression;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectItemImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectItemImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectItemImpl.java
index 13d6436..8ead489 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectItemImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/SelectItemImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY


[36/51] [abbrv] olingo-odata4 git commit: reduced usage of org.slf4j and org.apache.commons.lang3

Posted by mi...@apache.org.
reduced usage of org.slf4j and org.apache.commons.lang3

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 1b6259b9793a13f0984a2cf0ba0de718ec758331
Parents: 6837fd7
Author: Klaus Straubinger <kl...@sap.com>
Authored: Wed Jan 13 16:14:03 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Jan 18 13:30:40 2016 +0100

----------------------------------------------------------------------
 .../ODataClientErrorException.java              |  9 ++++-----
 .../api/domain/ClientEntitySetIterator.java     |  7 ++-----
 .../client/api/domain/ClientLinkType.java       |  6 ++----
 .../olingo/client/api/uri/SegmentType.java      |  6 ++----
 .../retrieve/RetrieveRequestFactoryImpl.java    |  9 ++++-----
 .../core/serialization/AbstractAtomDealer.java  |  3 +--
 .../olingo/commons/api/data/Valuable.java       | 19 -------------------
 .../olingo/commons/api/edm/geo/Geospatial.java  |  6 ++----
 .../olingo/commons/core/edm/EdmTypeInfo.java    | 10 +++++-----
 .../commons/core/edm/EdmImplCachingTest.java    |  3 +--
 lib/server-core-ext/pom.xml                     |  4 ----
 lib/server-core/pom.xml                         |  8 ++------
 .../deserializer/xml/ODataXmlDeserializer.java  |  6 +++---
 .../src/test/resources/simplelogger.properties  | 20 --------------------
 lib/server-test/pom.xml                         |  5 -----
 .../src/test/resources/simplelogger.properties  | 20 --------------------
 16 files changed, 28 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
index eaedc88..fc22ee9 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
@@ -19,9 +19,8 @@
 package org.apache.olingo.client.api.communication;
 
 import org.apache.http.StatusLine;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.commons.api.ex.ODataRuntimeException;
 import org.apache.olingo.commons.api.ex.ODataError;
+import org.apache.olingo.commons.api.ex.ODataRuntimeException;
 
 /**
  * Represents a client error in OData.
@@ -55,9 +54,9 @@ public class ODataClientErrorException extends ODataRuntimeException {
    * @param error OData error to be wrapped.
    */
   public ODataClientErrorException(final StatusLine statusLine, final ODataError error) {
-    super(error == null
-            ? statusLine.toString()
-            : (StringUtils.isBlank(error.getCode()) ? StringUtils.EMPTY : "(" + error.getCode() + ") ")
+    super(error == null ?
+        statusLine.toString() :
+        (error.getCode() == null || error.getCode().isEmpty() ? "" : "(" + error.getCode() + ") ")
             + error.getMessage() + " [" + statusLine.toString() + "]");
 
     this.statusLine = statusLine;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java
index a57d2f5..837ba3a 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientEntitySetIterator.java
@@ -28,7 +28,6 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.data.ResWrap;
 import org.apache.olingo.client.api.serialization.ODataDeserializerException;
@@ -262,12 +261,10 @@ public class ClientEntitySetIterator<T extends ClientEntitySet, E extends Client
         os.write('>');
       }
 
-      res = attrsDeclaration == null
-              ? StringUtils.EMPTY
-              : new String(attrsDeclaration, Constants.UTF8).trim();
+      res = attrsDeclaration == null ? "" : new String(attrsDeclaration, Constants.UTF8).trim();
     } catch (Exception e) {
       LOG.error("Error retrieving entities from EntitySet", e);
-      res = StringUtils.EMPTY;
+      res = "";
     }
 
     return res.endsWith("/") ? res.substring(0, res.length() - 1) : res;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientLinkType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientLinkType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientLinkType.java
index e4b6a22..2b89b95 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientLinkType.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientLinkType.java
@@ -18,7 +18,6 @@
  */
 package org.apache.olingo.client.api.domain;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.commons.api.Constants;
 import org.apache.olingo.commons.api.format.ContentType;
 
@@ -78,9 +77,8 @@ public enum ClientLinkType {
    * @return <code>ODataLinkType</code> object.
    */
   public static ClientLinkType fromString(final String rel, final String type) {
-    if (StringUtils.isNotBlank(rel) && rel.startsWith(Constants.NS_MEDIA_EDIT_LINK_REL)) {
-
-      return MEDIA_EDIT.setType(StringUtils.isBlank(type) ? "*/*" : type);
+    if (rel != null && rel.startsWith(Constants.NS_MEDIA_EDIT_LINK_REL)) {
+      return MEDIA_EDIT.setType(type == null || type.isEmpty() ? "*/*" : type);
     }
 
     if (ClientLinkType.ENTITY_NAVIGATION.type.equals(type)) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
index f3f2a50..fb290cb 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
@@ -18,7 +18,6 @@
  */
 package org.apache.olingo.client.api.uri;
 
-import org.apache.commons.lang3.StringUtils;
 
 /**
  * URI Segment types.
@@ -46,8 +45,7 @@ public enum SegmentType {
   CROSS_JOIN("$crossjoin"),
   ALL("$all"),
   /**
-   * For query options like as $count that needs to stay in their own segment, right after service root.
-   *
+   * For query options like $count that need to stay in their own segment, right after service root.
    * @see QueryOption#COUNT
    */
   ROOT_QUERY_OPTION,
@@ -56,7 +54,7 @@ public enum SegmentType {
   private final String value;
 
   private SegmentType() {
-    this.value = StringUtils.EMPTY;
+    this.value = "";
   }
 
   private SegmentType(final String value) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/RetrieveRequestFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/RetrieveRequestFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/RetrieveRequestFactoryImpl.java
index 1f5d80b..6b0f012 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/RetrieveRequestFactoryImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/RetrieveRequestFactoryImpl.java
@@ -20,7 +20,6 @@ package org.apache.olingo.client.core.communication.request.retrieve;
 
 import java.net.URI;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.communication.request.retrieve.EdmMetadataRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataDeltaRequest;
@@ -34,11 +33,11 @@ import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceD
 import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.RetrieveRequestFactory;
 import org.apache.olingo.client.api.communication.request.retrieve.XMLMetadataRequest;
-import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.client.api.domain.ClientEntity;
 import org.apache.olingo.client.api.domain.ClientEntitySet;
 import org.apache.olingo.client.api.domain.ClientProperty;
 import org.apache.olingo.client.api.domain.ClientSingleton;
+import org.apache.olingo.client.core.uri.URIUtils;
 
 public class RetrieveRequestFactoryImpl implements RetrieveRequestFactory {
 
@@ -82,9 +81,9 @@ public class RetrieveRequestFactoryImpl implements RetrieveRequestFactory {
   @Override
   public ODataServiceDocumentRequest getServiceDocumentRequest(final String serviceRoot) {
     return new ODataServiceDocumentRequestImpl(client,
-        StringUtils.isNotBlank(serviceRoot) && serviceRoot.endsWith("/")
-            ? client.newURIBuilder(serviceRoot).build()
-            : client.newURIBuilder(serviceRoot + "/").build());
+        serviceRoot != null && !serviceRoot.isEmpty() && serviceRoot.endsWith("/") ?
+            client.newURIBuilder(serviceRoot).build() :
+            client.newURIBuilder(serviceRoot + '/').build());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractAtomDealer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractAtomDealer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractAtomDealer.java
index 30fb582..245d9b6 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractAtomDealer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractAtomDealer.java
@@ -23,7 +23,6 @@ import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.commons.api.Constants;
 
 abstract class AbstractAtomDealer {
@@ -89,7 +88,7 @@ abstract class AbstractAtomDealer {
   }
 
   protected void namespaces(final XMLStreamWriter writer) throws XMLStreamException {
-    writer.writeNamespace(StringUtils.EMPTY, Constants.NS_ATOM);
+    writer.writeNamespace("", Constants.NS_ATOM);
     writer.writeNamespace(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI);
     writer.writeNamespace(Constants.PREFIX_METADATA, Constants.NS_METADATA);
     writer.writeNamespace(Constants.PREFIX_DATASERVICES, Constants.NS_DATASERVICES);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
index 2fec369..a2cb509 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Valuable.java
@@ -20,10 +20,6 @@ package org.apache.olingo.commons.api.data;
 
 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.edm.geo.Geospatial;
 
 /**
@@ -175,19 +171,4 @@ public abstract class Valuable extends Annotatable {
   public ValueType getValueType() {
     return valueType;
   }
-
-  @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/1b6259b9/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
index c0e5819..539196c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/Geospatial.java
@@ -102,10 +102,8 @@ public abstract class Geospatial implements Serializable {
   protected Geospatial(final Dimension dimension, final Type type, final SRID srid) {
     this.dimension = dimension;
     this.type = type;
-    this.srid = srid == null
-        ? new SRID()
-    : srid;
-        this.srid.setDimension(dimension);
+    this.srid = srid == null ? new SRID() : srid;
+    this.srid.setDimension(dimension);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java
index ae2e3da..f919ac8 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java
@@ -18,7 +18,6 @@
  */
 package org.apache.olingo.commons.core.edm;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmComplexType;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
@@ -54,9 +53,10 @@ public class EdmTypeInfo {
     }
 
     public EdmTypeInfo build() {
-      return new EdmTypeInfo(edm, typeExpression.indexOf('.') == -1 && StringUtils.isNotBlank(defaultNamespace)
-          ? defaultNamespace + "." + typeExpression
-              : typeExpression);
+      return new EdmTypeInfo(edm,
+          typeExpression.indexOf('.') == -1 && defaultNamespace != null && !defaultNamespace.isEmpty() ?
+              defaultNamespace + "." + typeExpression :
+              typeExpression);
     }
   }
 
@@ -98,7 +98,7 @@ public class EdmTypeInfo {
       typeName = baseType.substring(lastDotIdx + 1);
     }
 
-    if (StringUtils.isBlank(typeName)) {
+    if (typeName == null || typeName.isEmpty()) {
       throw new IllegalArgumentException("Null or empty type name in " + typeExpression);
     }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java
index ed99114..fb73d0f 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java
@@ -31,7 +31,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmAction;
 import org.apache.olingo.commons.api.edm.EdmAnnotations;
@@ -444,7 +443,7 @@ public class EdmImplCachingTest {
         private static final long serialVersionUID = 3109256773218160485L;
 
         {
-          put(StringUtils.EMPTY, schema);
+          put("", schema);
         }
       };
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/server-core-ext/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/pom.xml b/lib/server-core-ext/pom.xml
index af286c0..7a39e0d 100644
--- a/lib/server-core-ext/pom.xml
+++ b/lib/server-core-ext/pom.xml
@@ -70,10 +70,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-    </dependency>
-    <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
       <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/server-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml
index 0c329d9..a6cf00e 100644
--- a/lib/server-core/pom.xml
+++ b/lib/server-core/pom.xml
@@ -65,12 +65,12 @@
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-databind</artifactId>
     </dependency>
-	
+
 	<dependency>
       <groupId>com.fasterxml</groupId>
       <artifactId>aalto-xml</artifactId>
     </dependency>
-	
+
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
@@ -79,10 +79,6 @@
       <groupId>org.mockito</groupId>
       <artifactId>mockito-all</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-    </dependency>
   </dependencies>
 
   <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
index d3876b6..b556d8e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/xml/ODataXmlDeserializer.java
@@ -33,7 +33,6 @@ import javax.xml.stream.events.Attribute;
 import javax.xml.stream.events.StartElement;
 import javax.xml.stream.events.XMLEvent;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.commons.api.Constants;
 import org.apache.olingo.commons.api.data.AbstractODataObject;
 import org.apache.olingo.commons.api.data.ComplexValue;
@@ -172,8 +171,9 @@ public class ODataXmlDeserializer implements ODataDeserializer {
     if (propertyValueQName.equals(start.getName())) {
       // retrieve name from context
       final Attribute context = start.getAttributeByName(contextQName);
-      if (context != null) {
-        property.setName(StringUtils.substringAfterLast(context.getValue(), "/"));
+      if (context != null && context.getValue() != null) {
+        final int pos = context.getValue().lastIndexOf('/');
+        property.setName(pos == -1 ? "" : context.getValue().substring(pos + 1));
       }
     } else {
       property.setName(start.getName().getLocalPart());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/server-core/src/test/resources/simplelogger.properties
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/resources/simplelogger.properties b/lib/server-core/src/test/resources/simplelogger.properties
deleted file mode 100644
index 2a3350c..0000000
--- a/lib/server-core/src/test/resources/simplelogger.properties
+++ /dev/null
@@ -1,20 +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.
-#
-org.slf4j.simpleLogger.defaultLogLevel=debug
-org.slf4j.simpleLogger.logFile=System.out
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/server-test/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-test/pom.xml b/lib/server-test/pom.xml
index 3b48d9e..212673f 100644
--- a/lib/server-test/pom.xml
+++ b/lib/server-test/pom.xml
@@ -55,11 +55,6 @@
       <artifactId>mockito-all</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1b6259b9/lib/server-test/src/test/resources/simplelogger.properties
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/resources/simplelogger.properties b/lib/server-test/src/test/resources/simplelogger.properties
deleted file mode 100644
index 2a3350c..0000000
--- a/lib/server-test/src/test/resources/simplelogger.properties
+++ /dev/null
@@ -1,20 +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.
-#
-org.slf4j.simpleLogger.defaultLogLevel=debug
-org.slf4j.simpleLogger.logFile=System.out
\ No newline at end of file


[50/51] [abbrv] olingo-odata4 git commit: [OLINGO-832] Merge branch 'master' into OLINGO-832_StreamSerializerPoC

Posted by mi...@apache.org.
[OLINGO-832] Merge branch 'master' into OLINGO-832_StreamSerializerPoC


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: c02215e2ef1eaec9cecc8ab9f188a4538d8164e3
Parents: 0cc2199 b9512ed
Author: Michael Bolz <mi...@sap.com>
Authored: Mon Jan 25 14:18:13 2016 +0100
Committer: Michael Bolz <mi...@sap.com>
Committed: Mon Jan 25 14:18:13 2016 +0100

----------------------------------------------------------------------
 dist/android-lib/pom.xml                        |    2 +-
 dist/client-lib/pom.xml                         |    2 +-
 dist/javadoc/pom.xml                            |    2 +-
 dist/pom.xml                                    |    2 +-
 dist/server-lib/pom.xml                         |    2 +-
 dist/server-lib/src/main/resources/LICENSE      |   67 -
 dist/server-lib/src/main/resources/NOTICE       |   31 +-
 ext/client-android/pom.xml                      |    2 +-
 ext/client-proxy/pom.xml                        |    2 +-
 ext/karaf/karaf-features/pom.xml                |    2 +-
 .../src/main/resources/features.xml             |    1 -
 ext/karaf/karaf-fit/pom.xml                     |    2 +-
 .../osgi/itests/server/CarServiceTest.java      |    2 +-
 ext/karaf/pom.xml                               |    2 +-
 ext/pojogen-maven-plugin/pom.xml                |    2 +-
 ext/pom.xml                                     |    2 +-
 fit/pom.xml                                     |   10 +-
 .../org/apache/olingo/fit/AbstractServices.java |   46 -
 .../apache/olingo/fit/metadata/Association.java |   70 -
 .../olingo/fit/metadata/AssociationSet.java     |   74 -
 .../apache/olingo/fit/metadata/Container.java   |   13 -
 .../apache/olingo/fit/metadata/Metadata.java    |  110 +-
 .../olingo/fit/metadata/NavigationProperty.java |   27 -
 .../org/apache/olingo/fit/metadata/Schema.java  |   14 -
 .../org/apache/olingo/fit/methods/MERGE.java    |   33 -
 .../org/apache/olingo/fit/utils/Constants.java  |   60 +-
 .../olingo/fit/base/EntityUpdateTestITCase.java |    2 +-
 .../olingo/fit/tecsvc/client/BasicITCase.java   |    2 +-
 .../tecsvc/client/FilterSystemQueryITCase.java  |   34 +-
 .../tecsvc/client/OrderBySystemQueryITCase.java |    4 +-
 .../tecsvc/client/SystemQueryOptionITCase.java  |    2 +-
 .../olingo/fit/tecsvc/http/BasicHttpITCase.java |    4 +-
 lib/client-api/pom.xml                          |    6 +-
 .../ODataClientErrorException.java              |    9 +-
 .../api/domain/ClientEntitySetIterator.java     |    7 +-
 .../client/api/domain/ClientLinkType.java       |    6 +-
 .../olingo/client/api/uri/SegmentType.java      |    6 +-
 lib/client-core/pom.xml                         |   23 +-
 .../retrieve/RetrieveRequestFactoryImpl.java    |    9 +-
 .../client/core/edm/ClientCsdlXMLMetadata.java  |    3 +-
 .../client/core/edm/xml/ClientCsdlAction.java   |    4 +-
 .../core/edm/xml/ClientCsdlActionImport.java    |    4 +-
 .../core/edm/xml/ClientCsdlAnnotation.java      |    3 +-
 .../core/edm/xml/ClientCsdlAnnotations.java     |    4 +-
 .../core/edm/xml/ClientCsdlComplexType.java     |    4 +-
 .../core/edm/xml/ClientCsdlDataServices.java    |    4 +-
 .../client/core/edm/xml/ClientCsdlEdmx.java     |    4 +-
 .../core/edm/xml/ClientCsdlEntityContainer.java |    4 +-
 .../core/edm/xml/ClientCsdlEntityKey.java       |    4 +-
 .../core/edm/xml/ClientCsdlEntitySet.java       |    4 +-
 .../core/edm/xml/ClientCsdlEntityType.java      |    4 +-
 .../core/edm/xml/ClientCsdlEnumMember.java      |    4 +-
 .../client/core/edm/xml/ClientCsdlEnumType.java |    4 +-
 .../client/core/edm/xml/ClientCsdlFunction.java |    4 +-
 .../core/edm/xml/ClientCsdlFunctionImport.java  |    4 +-
 .../client/core/edm/xml/ClientCsdlInclude.java  |    4 +-
 .../edm/xml/ClientCsdlIncludeAnnotations.java   |    4 +-
 .../edm/xml/ClientCsdlNavigationProperty.java   |    4 +-
 .../ClientCsdlNavigationPropertyBinding.java    |    4 +-
 .../client/core/edm/xml/ClientCsdlOnDelete.java |    4 +-
 .../core/edm/xml/ClientCsdlParameter.java       |    4 +-
 .../client/core/edm/xml/ClientCsdlProperty.java |    4 +-
 .../core/edm/xml/ClientCsdlPropertyRef.java     |    4 +-
 .../core/edm/xml/ClientCsdlReference.java       |    4 +-
 .../xml/ClientCsdlReferentialConstraint.java    |    4 +-
 .../core/edm/xml/ClientCsdlReturnType.java      |    4 +-
 .../client/core/edm/xml/ClientCsdlSchema.java   |    4 +-
 .../core/edm/xml/ClientCsdlSingleton.java       |    4 +-
 .../client/core/edm/xml/ClientCsdlTerm.java     |    4 +-
 .../core/edm/xml/ClientCsdlTypeDefinition.java  |    4 +-
 .../edm/xml/annotation/ClientCsdlApply.java     |    3 +-
 .../core/edm/xml/annotation/ClientCsdlCast.java |    3 +-
 .../xml/annotation/ClientCsdlCollection.java    |    3 +-
 .../annotation/ClientCsdlDynamicExpression.java |    3 +-
 .../core/edm/xml/annotation/ClientCsdlIsOf.java |    3 +-
 .../annotation/ClientCsdlLabeledElement.java    |    3 +-
 .../core/edm/xml/annotation/ClientCsdlNull.java |    3 +-
 .../xml/annotation/ClientCsdlPropertyValue.java |    3 +-
 .../edm/xml/annotation/ClientCsdlRecord.java    |    3 +-
 .../edm/xml/annotation/ClientCsdlUrlRef.java    |    3 +-
 .../core/serialization/AbstractAtomDealer.java  |    3 +-
 .../olingo/client/core/uri/URIBuilderImpl.java  |    4 +-
 .../olingo/client/core/uri/URIBuilderTest.java  |   15 +-
 lib/commons-api/pom.xml                         |    7 +-
 .../commons/api/data/AbstractODataObject.java   |   25 +
 .../olingo/commons/api/data/Annotatable.java    |   30 -
 .../olingo/commons/api/data/Annotation.java     |   18 +
 .../olingo/commons/api/data/ComplexValue.java   |   17 +
 .../apache/olingo/commons/api/data/Delta.java   |   17 +
 .../olingo/commons/api/data/DeltaLink.java      |   25 +
 .../apache/olingo/commons/api/data/Entity.java  |   40 +
 .../commons/api/data/EntityCollection.java      |   27 +-
 .../apache/olingo/commons/api/data/Link.java    |   37 +
 .../apache/olingo/commons/api/data/Linked.java  |   17 +
 .../olingo/commons/api/data/Parameter.java      |   18 +
 .../olingo/commons/api/data/Property.java       |   18 +
 .../olingo/commons/api/data/Valuable.java       |   27 +-
 .../commons/api/edm/EdmBindingTarget.java       |    2 +-
 .../olingo/commons/api/edm/EdmMapping.java      |    7 +
 .../commons/api/edm/FullQualifiedName.java      |   19 +-
 .../edm/annotation/EdmConstantExpression.java   |    8 +-
 .../commons/api/edm/geo/ComposedGeospatial.java |   32 +-
 .../olingo/commons/api/edm/geo/Geospatial.java  |   37 +-
 .../api/edm/geo/GeospatialCollection.java       |   10 +-
 .../olingo/commons/api/edm/geo/LineString.java  |    8 +-
 .../commons/api/edm/geo/MultiLineString.java    |    8 +-
 .../olingo/commons/api/edm/geo/MultiPoint.java  |    8 +-
 .../commons/api/edm/geo/MultiPolygon.java       |    8 +-
 .../olingo/commons/api/edm/geo/Point.java       |   72 +-
 .../olingo/commons/api/edm/geo/Polygon.java     |   38 +-
 .../apache/olingo/commons/api/edm/geo/SRID.java |   49 +-
 .../api/edm/provider/CsdlAbstractEdmItem.java   |   25 +-
 .../commons/api/edm/provider/CsdlAction.java    |    2 -
 .../api/edm/provider/CsdlActionImport.java      |    2 -
 .../api/edm/provider/CsdlAnnotation.java        |    2 -
 .../api/edm/provider/CsdlAnnotations.java       |    2 -
 .../api/edm/provider/CsdlBindingTarget.java     |   27 +-
 .../api/edm/provider/CsdlComplexType.java       |    2 -
 .../api/edm/provider/CsdlEntityContainer.java   |    2 -
 .../commons/api/edm/provider/CsdlEntitySet.java |    8 +-
 .../api/edm/provider/CsdlEntityType.java        |    2 -
 .../api/edm/provider/CsdlEnumMember.java        |    2 -
 .../commons/api/edm/provider/CsdlEnumType.java  |    2 -
 .../commons/api/edm/provider/CsdlFunction.java  |    2 -
 .../api/edm/provider/CsdlFunctionImport.java    |    2 -
 .../commons/api/edm/provider/CsdlMapping.java   |   21 +
 .../edm/provider/CsdlNavigationProperty.java    |    2 -
 .../provider/CsdlNavigationPropertyBinding.java |    2 -
 .../commons/api/edm/provider/CsdlOnDelete.java  |    2 -
 .../commons/api/edm/provider/CsdlOperation.java |    2 -
 .../api/edm/provider/CsdlOperationImport.java   |    2 -
 .../commons/api/edm/provider/CsdlParameter.java |    2 -
 .../commons/api/edm/provider/CsdlProperty.java  |    2 -
 .../api/edm/provider/CsdlPropertyRef.java       |    2 -
 .../edm/provider/CsdlReferentialConstraint.java |    2 -
 .../api/edm/provider/CsdlReturnType.java        |    2 -
 .../commons/api/edm/provider/CsdlSchema.java    |    2 -
 .../commons/api/edm/provider/CsdlSingleton.java |   16 +-
 .../api/edm/provider/CsdlStructuralType.java    |    2 -
 .../commons/api/edm/provider/CsdlTerm.java      |    2 -
 .../api/edm/provider/CsdlTypeDefinition.java    |    2 -
 .../provider/annotation/CsdlAnnotationPath.java |    1 -
 .../api/edm/provider/annotation/CsdlApply.java  |    3 +-
 .../api/edm/provider/annotation/CsdlCast.java   |    1 -
 .../edm/provider/annotation/CsdlCollection.java |    1 -
 .../annotation/CsdlConstantExpression.java      |    3 -
 .../annotation/CsdlDynamicExpression.java       |    2 -
 .../edm/provider/annotation/CsdlExpression.java |    2 -
 .../api/edm/provider/annotation/CsdlIf.java     |    2 -
 .../api/edm/provider/annotation/CsdlIsOf.java   |    2 -
 .../provider/annotation/CsdlLabeledElement.java |    4 +-
 .../annotation/CsdlLabeledElementReference.java |    1 -
 .../CsdlLogicalOrComparisonExpression.java      |    2 -
 .../annotation/CsdlNavigationPropertyPath.java  |    1 -
 .../api/edm/provider/annotation/CsdlNull.java   |    2 -
 .../api/edm/provider/annotation/CsdlPath.java   |    1 -
 .../provider/annotation/CsdlPropertyPath.java   |    1 -
 .../provider/annotation/CsdlPropertyValue.java  |    5 +-
 .../api/edm/provider/annotation/CsdlRecord.java |    1 -
 .../api/edm/provider/annotation/CsdlUrlRef.java |    3 +-
 lib/commons-core/pom.xml                        |   24 +-
 .../core/edm/AbstractEdmBindingTarget.java      |   12 +-
 .../olingo/commons/core/edm/EdmTypeInfo.java    |   10 +-
 .../primitivetype/AbstractGeospatialType.java   |   49 +-
 .../core/edm/primitivetype/EdmBinary.java       |   12 +-
 .../edm/primitivetype/EdmDateTimeOffset.java    |    8 +-
 .../commons/core/edm/EdmImplCachingTest.java    |    3 +-
 .../primitivetype/EdmDateTimeOffsetTest.java    |   16 +-
 .../edm/primitivetype/EdmTimeOfDayTest.java     |   26 +-
 .../edm/provider/EdmActionImportImplTest.java   |    2 +-
 .../core/edm/provider/EdmMappingTest.java       |   42 +-
 .../core/edm/provider/EdmProviderImplTest.java  |    4 +-
 .../core/edm/provider/EdmSchemaImplTest.java    |    1 +
 lib/pom.xml                                     |    2 +-
 lib/server-api/pom.xml                          |    2 +-
 .../apache/olingo/server/api/HttpHeaders.java   |    4 +-
 .../org/apache/olingo/server/api/OData.java     |    6 +-
 .../server/api/ODataApplicationException.java   |    4 +-
 .../olingo/server/api/ODataHttpHandler.java     |    4 +-
 .../server/api/ODataLibraryException.java       |    4 +-
 .../apache/olingo/server/api/ODataRequest.java  |    6 +-
 .../apache/olingo/server/api/ODataResponse.java |    5 +-
 .../olingo/server/api/ODataServerError.java     |    4 +-
 .../olingo/server/api/ServiceMetadata.java      |    4 +-
 .../olingo/server/api/batch/BatchFacade.java    |  106 +-
 .../olingo/server/api/batch/package-info.java   |    4 +-
 .../server/api/debug/DebugInformation.java      |   16 +-
 .../server/api/debug/DebugResponseHelper.java   |    4 +-
 .../olingo/server/api/debug/DebugSupport.java   |    9 +-
 .../server/api/debug/DefaultDebugSupport.java   |    8 +-
 .../server/api/debug/RuntimeMeasurement.java    |   12 +-
 .../olingo/server/api/debug/package-info.java   |    4 +-
 .../api/deserializer/DeserializerException.java |    4 +-
 .../api/deserializer/DeserializerResult.java    |    4 +-
 .../deserializer/FixedFormatDeserializer.java   |   12 +-
 .../api/deserializer/ODataDeserializer.java     |   10 +-
 .../batch/BatchDeserializerException.java       |   14 +-
 .../api/deserializer/batch/BatchOptions.java    |    8 +-
 .../deserializer/batch/BatchRequestPart.java    |    4 +-
 .../deserializer/batch/ODataResponsePart.java   |    8 +-
 .../api/deserializer/batch/package-info.java    |    4 +-
 .../server/api/deserializer/package-info.java   |    4 +-
 .../server/api/etag/CustomETagSupport.java      |    4 +-
 .../olingo/server/api/etag/ETagHelper.java      |   22 +-
 .../server/api/etag/PreconditionException.java  |    4 +-
 .../api/etag/ServiceMetadataETagSupport.java    |    6 +-
 .../olingo/server/api/etag/package-info.java    |    4 +-
 .../apache/olingo/server/api/package-info.java  |    4 +-
 .../olingo/server/api/prefer/Preferences.java   |   13 +-
 .../server/api/prefer/PreferencesApplied.java   |   16 +-
 .../olingo/server/api/prefer/package-info.java  |    4 +-
 .../ActionComplexCollectionProcessor.java       |    4 +-
 .../api/processor/ActionComplexProcessor.java   |    4 +-
 .../ActionEntityCollectionProcessor.java        |    4 +-
 .../api/processor/ActionEntityProcessor.java    |    4 +-
 .../ActionPrimitiveCollectionProcessor.java     |    4 +-
 .../api/processor/ActionPrimitiveProcessor.java |    4 +-
 .../api/processor/ActionVoidProcessor.java      |    4 +-
 .../server/api/processor/BatchProcessor.java    |    4 +-
 .../processor/ComplexCollectionProcessor.java   |    4 +-
 .../server/api/processor/ComplexProcessor.java  |    4 +-
 .../CountComplexCollectionProcessor.java        |    4 +-
 .../CountEntityCollectionProcessor.java         |    4 +-
 .../CountPrimitiveCollectionProcessor.java      |    4 +-
 .../server/api/processor/DefaultProcessor.java  |    4 +-
 .../server/api/processor/DeltaProcessor.java    |   30 +-
 .../processor/EntityCollectionProcessor.java    |    4 +-
 .../server/api/processor/EntityProcessor.java   |    6 +-
 .../server/api/processor/ErrorProcessor.java    |    6 +-
 .../api/processor/MediaEntityProcessor.java     |    4 +-
 .../server/api/processor/MetadataProcessor.java |    4 +-
 .../processor/PrimitiveCollectionProcessor.java |    4 +-
 .../api/processor/PrimitiveProcessor.java       |    6 +-
 .../api/processor/PrimitiveValueProcessor.java  |    6 +-
 .../olingo/server/api/processor/Processor.java  |    4 +-
 .../processor/ReferenceCollectionProcessor.java |    4 +-
 .../api/processor/ReferenceProcessor.java       |    4 +-
 .../api/processor/ServiceDocumentProcessor.java |    4 +-
 .../server/api/processor/package-info.java      |    5 +-
 .../serializer/BatchSerializerException.java    |    7 +-
 .../serializer/ComplexSerializerOptions.java    |   10 +-
 .../serializer/CustomContentTypeSupport.java    |    4 +-
 .../EntityCollectionSerializerOptions.java      |    8 +-
 .../api/serializer/EntitySerializerOptions.java |    8 +-
 .../api/serializer/FixedFormatSerializer.java   |    6 +-
 .../server/api/serializer/ODataSerializer.java  |   52 +-
 .../serializer/PrimitiveSerializerOptions.java  |   10 +-
 .../PrimitiveValueSerializerOptions.java        |    4 +-
 .../ReferenceCollectionSerializerOptions.java   |   12 +-
 .../serializer/ReferenceSerializerOptions.java  |    4 +-
 .../api/serializer/RepresentationType.java      |    4 +-
 .../api/serializer/SerializerException.java     |    4 +-
 .../server/api/serializer/SerializerResult.java |    4 +-
 .../server/api/serializer/package-info.java     |    4 +-
 .../apache/olingo/server/api/uri/UriHelper.java |   10 +-
 .../apache/olingo/server/api/uri/UriInfo.java   |    6 +-
 .../olingo/server/api/uri/UriInfoAll.java       |    6 +-
 .../olingo/server/api/uri/UriInfoBatch.java     |    6 +-
 .../olingo/server/api/uri/UriInfoCrossjoin.java |    8 +-
 .../olingo/server/api/uri/UriInfoEntityId.java  |    4 +-
 .../olingo/server/api/uri/UriInfoKind.java      |    4 +-
 .../olingo/server/api/uri/UriInfoMetadata.java  |    4 +-
 .../olingo/server/api/uri/UriInfoResource.java  |    4 +-
 .../olingo/server/api/uri/UriInfoService.java   |    6 +-
 .../olingo/server/api/uri/UriParameter.java     |    4 +-
 .../olingo/server/api/uri/UriResource.java      |    4 +-
 .../server/api/uri/UriResourceAction.java       |    4 +-
 .../api/uri/UriResourceComplexProperty.java     |    4 +-
 .../olingo/server/api/uri/UriResourceCount.java |    6 +-
 .../server/api/uri/UriResourceEntitySet.java    |    4 +-
 .../server/api/uri/UriResourceFunction.java     |    4 +-
 .../olingo/server/api/uri/UriResourceIt.java    |    4 +-
 .../olingo/server/api/uri/UriResourceKind.java  |    4 +-
 .../server/api/uri/UriResourceLambdaAll.java    |    4 +-
 .../server/api/uri/UriResourceLambdaAny.java    |    4 +-
 .../api/uri/UriResourceLambdaVariable.java      |    4 +-
 .../server/api/uri/UriResourceNavigation.java   |    4 +-
 .../server/api/uri/UriResourcePartTyped.java    |    6 +-
 .../api/uri/UriResourcePrimitiveProperty.java   |    6 +-
 .../server/api/uri/UriResourceProperty.java     |    4 +-
 .../olingo/server/api/uri/UriResourceRef.java   |    6 +-
 .../olingo/server/api/uri/UriResourceRoot.java  |    6 +-
 .../server/api/uri/UriResourceSingleton.java    |    4 +-
 .../olingo/server/api/uri/UriResourceValue.java |    6 +-
 .../olingo/server/api/uri/package-info.java     |    6 +-
 .../api/uri/queryoption/AliasQueryOption.java   |    4 +-
 .../server/api/uri/queryoption/CountOption.java |    4 +-
 .../api/uri/queryoption/CustomQueryOption.java  |    6 +-
 .../server/api/uri/queryoption/ExpandItem.java  |    5 +-
 .../api/uri/queryoption/ExpandOption.java       |    4 +-
 .../api/uri/queryoption/FilterOption.java       |    4 +-
 .../api/uri/queryoption/FormatOption.java       |    4 +-
 .../server/api/uri/queryoption/IdOption.java    |    4 +-
 .../api/uri/queryoption/LevelsExpandOption.java |    4 +-
 .../server/api/uri/queryoption/OrderByItem.java |    4 +-
 .../api/uri/queryoption/OrderByOption.java      |    4 +-
 .../server/api/uri/queryoption/QueryOption.java |    4 +-
 .../api/uri/queryoption/SearchOption.java       |    4 +-
 .../server/api/uri/queryoption/SelectItem.java  |    4 +-
 .../api/uri/queryoption/SelectOption.java       |    4 +-
 .../server/api/uri/queryoption/SkipOption.java  |    4 +-
 .../api/uri/queryoption/SkipTokenOption.java    |    4 +-
 .../api/uri/queryoption/SystemQueryOption.java  |    4 +-
 .../uri/queryoption/SystemQueryOptionKind.java  |    4 +-
 .../server/api/uri/queryoption/TopOption.java   |    4 +-
 .../api/uri/queryoption/expression/Alias.java   |    4 +-
 .../api/uri/queryoption/expression/Binary.java  |    4 +-
 .../expression/BinaryOperatorKind.java          |    4 +-
 .../uri/queryoption/expression/Enumeration.java |    4 +-
 .../uri/queryoption/expression/Expression.java  |    6 +-
 .../expression/ExpressionVisitException.java    |    4 +-
 .../expression/ExpressionVisitor.java           |    4 +-
 .../uri/queryoption/expression/LambdaRef.java   |    4 +-
 .../api/uri/queryoption/expression/Literal.java |   10 +-
 .../api/uri/queryoption/expression/Member.java  |    4 +-
 .../api/uri/queryoption/expression/Method.java  |    4 +-
 .../uri/queryoption/expression/MethodKind.java  |    4 +-
 .../uri/queryoption/expression/TypeLiteral.java |    4 +-
 .../api/uri/queryoption/expression/Unary.java   |    4 +-
 .../expression/UnaryOperatorKind.java           |    4 +-
 .../expression/VisitableExpression.java         |    4 +-
 .../queryoption/expression/package-info.java    |    4 +-
 .../api/uri/queryoption/package-info.java       |    4 +-
 .../uri/queryoption/search/SearchBinary.java    |    4 +-
 .../search/SearchBinaryOperatorKind.java        |   31 +-
 .../queryoption/search/SearchExpression.java    |   18 +-
 .../api/uri/queryoption/search/SearchTerm.java  |    4 +-
 .../api/uri/queryoption/search/SearchUnary.java |    5 +-
 .../search/SearchUnaryOperatorKind.java         |   24 +-
 .../uri/queryoption/search/package-info.java    |    4 +-
 .../olingo/server/api/ODataRequestTest.java     |    4 +-
 .../server/api/TranslatedExceptionsTest.java    |    4 +-
 .../api/prefer/PreferencesAppliedTest.java      |   22 +-
 lib/server-core-ext/pom.xml                     |   10 +-
 .../apache/olingo/server/core/ErrorHandler.java |    8 +-
 .../olingo/server/core/ServiceDispatcher.java   |    4 +-
 .../olingo/server/core/ServiceRequest.java      |    6 +-
 .../server/core/responses/EntityResponse.java   |   39 +-
 .../olingo/server/example/TripPinDataModel.java |    4 +-
 lib/server-core/pom.xml                         |   60 +-
 .../olingo/server/core/uri/antlr/UriLexer.g4    |  424 --
 .../olingo/server/core/uri/antlr/UriParser.g4   |  447 --
 .../olingo/server/core/ContentNegotiator.java   |   18 +-
 .../server/core/ContentNegotiatorException.java |    4 +-
 .../server/core/DefaultRedirectProcessor.java   |    4 +-
 .../olingo/server/core/ODataDispatcher.java     |  132 +-
 .../server/core/ODataExceptionHelper.java       |   14 +-
 .../apache/olingo/server/core/ODataHandler.java |   22 +-
 .../server/core/ODataHandlerException.java      |    6 +-
 .../server/core/ODataHttpHandlerImpl.java       |    8 +-
 .../apache/olingo/server/core/ODataImpl.java    |   10 +-
 .../olingo/server/core/RedirectProcessor.java   |    4 +-
 .../olingo/server/core/ServiceMetadataImpl.java |    8 +-
 .../core/batchhandler/BatchFacadeImpl.java      |    8 +-
 .../server/core/batchhandler/BatchHandler.java  |    4 +-
 .../core/batchhandler/BatchPartHandler.java     |    6 +-
 .../BatchReferenceRewriter.java                 |    4 +-
 .../core/debug/DebugResponseHelperImpl.java     |  118 +-
 .../olingo/server/core/debug/DebugTab.java      |    5 +-
 .../olingo/server/core/debug/DebugTabBody.java  |   12 +-
 .../server/core/debug/DebugTabRequest.java      |   28 +-
 .../server/core/debug/DebugTabResponse.java     |   14 +-
 .../server/core/debug/DebugTabRuntime.java      |   34 +-
 .../server/core/debug/DebugTabServer.java       |   14 +-
 .../server/core/debug/DebugTabStacktrace.java   |   24 +-
 .../olingo/server/core/debug/DebugTabUri.java   |   74 +-
 .../core/debug/ExpressionJsonVisitor.java       |   12 +-
 .../server/core/debug/ServerCoreDebugger.java   |   12 +-
 .../deserializer/DeserializerResultImpl.java    |    4 +-
 .../FixedFormatDeserializerImpl.java            |   10 +-
 .../core/deserializer/batch/BatchBodyPart.java  |    8 +-
 .../deserializer/batch/BatchChangeSetPart.java  |    4 +-
 .../deserializer/batch/BatchLineReader.java     |   44 +-
 .../core/deserializer/batch/BatchParser.java    |   10 +-
 .../deserializer/batch/BatchParserCommon.java   |   14 +-
 .../core/deserializer/batch/BatchPart.java      |    4 +-
 .../deserializer/batch/BatchQueryOperation.java |    4 +-
 .../batch/BatchRequestTransformator.java        |   20 +-
 .../batch/BatchTransformatorCommon.java         |    8 +-
 .../server/core/deserializer/batch/Header.java  |    4 +-
 .../core/deserializer/batch/HeaderField.java    |    4 +-
 .../batch/HttpRequestStatusLine.java            |    6 +-
 .../server/core/deserializer/batch/Line.java    |    4 +-
 .../deserializer/helper/ExpandTreeBuilder.java  |   18 +-
 .../helper/ExpandTreeBuilderImpl.java           |    4 +-
 .../json/ODataJsonDeserializer.java             |  113 +-
 .../deserializer/xml/ODataXmlDeserializer.java  |   40 +-
 .../olingo/server/core/etag/ETagHelperImpl.java |    8 +-
 .../server/core/etag/ETagInformation.java       |    4 +-
 .../olingo/server/core/etag/ETagParser.java     |   22 +-
 .../core/etag/PreconditionsValidator.java       |   14 +-
 .../olingo/server/core/prefer/PreferParser.java |   40 +-
 .../server/core/prefer/PreferencesImpl.java     |   13 +-
 .../serializer/AbstractODataSerializer.java     |    7 +-
 .../serializer/AsyncResponseSerializer.java     |   18 +-
 .../serializer/BatchResponseSerializer.java     |   45 +-
 .../serializer/FixedFormatSerializerImpl.java   |    6 +-
 .../core/serializer/SerializerResultImpl.java   |    4 +-
 .../serializer/json/ODataErrorSerializer.java   |    4 +-
 .../serializer/json/ODataJsonSerializer.java    |   94 +-
 .../json/ServiceDocumentJsonSerializer.java     |   12 +-
 .../serializer/utils/CircleStreamBuffer.java    |    4 +-
 .../serializer/utils/ContentTypeHelper.java     |   16 +-
 .../serializer/utils/ContextURLBuilder.java     |   22 +-
 .../core/serializer/utils/ContextURLHelper.java |   17 +-
 .../serializer/utils/ExpandSelectHelper.java    |    4 +-
 .../xml/MetadataDocumentXmlSerializer.java      |   38 +-
 .../core/serializer/xml/ODataXmlSerializer.java |   27 +-
 .../xml/ServiceDocumentXmlSerializer.java       |   12 +-
 .../olingo/server/core/uri/UriHelperImpl.java   |   17 +-
 .../olingo/server/core/uri/UriInfoImpl.java     |    4 +-
 .../server/core/uri/UriParameterImpl.java       |    4 +-
 .../server/core/uri/UriResourceActionImpl.java  |   52 +-
 .../uri/UriResourceComplexPropertyImpl.java     |   22 +-
 .../server/core/uri/UriResourceCountImpl.java   |   14 +-
 .../core/uri/UriResourceEntitySetImpl.java      |   25 +-
 .../core/uri/UriResourceFunctionImpl.java       |   54 +-
 .../olingo/server/core/uri/UriResourceImpl.java |   10 +-
 .../server/core/uri/UriResourceItImpl.java      |   35 +-
 .../core/uri/UriResourceLambdaAllImpl.java      |   35 +-
 .../core/uri/UriResourceLambdaAnyImpl.java      |   34 +-
 .../core/uri/UriResourceLambdaVarImpl.java      |   38 +-
 .../uri/UriResourceNavigationPropertyImpl.java  |   30 +-
 .../uri/UriResourcePrimitivePropertyImpl.java   |   24 +-
 .../server/core/uri/UriResourceRefImpl.java     |   14 +-
 .../server/core/uri/UriResourceRootImpl.java    |   35 +-
 .../core/uri/UriResourceSingletonImpl.java      |   25 +-
 .../uri/UriResourceStartingTypeFilterImpl.java  |   37 +-
 .../server/core/uri/UriResourceTypedImpl.java   |   16 +-
 .../server/core/uri/UriResourceValueImpl.java   |   13 +-
 .../core/uri/UriResourceWithKeysImpl.java       |    7 +-
 .../uri/parser/CheckFullContextListener.java    |   60 -
 .../server/core/uri/parser/ExpandParser.java    |  282 +
 .../core/uri/parser/ExpressionParser.java       | 1245 ++++
 .../server/core/uri/parser/FilterParser.java    |   56 +
 .../server/core/uri/parser/OrderByParser.java   |   61 +
 .../olingo/server/core/uri/parser/Parser.java   |  680 +-
 .../server/core/uri/parser/ParserHelper.java    |  477 ++
 .../olingo/server/core/uri/parser/RawUri.java   |   46 -
 .../core/uri/parser/ResourcePathParser.java     |  397 ++
 .../server/core/uri/parser/SearchParser.java    |  108 +
 .../server/core/uri/parser/SelectParser.java    |  234 +
 .../server/core/uri/parser/UriContext.java      |  113 -
 .../server/core/uri/parser/UriDecoder.java      |  101 +-
 .../core/uri/parser/UriParseTreeVisitor.java    | 2545 --------
 .../core/uri/parser/UriParserException.java     |    4 +-
 .../uri/parser/UriParserSemanticException.java  |   31 +-
 .../uri/parser/UriParserSyntaxException.java    |    6 +-
 .../server/core/uri/parser/UriTokenizer.java    | 1406 ++++
 .../uri/parser/search/SearchBinaryImpl.java     |    7 +-
 .../uri/parser/search/SearchExpressionImpl.java |    4 +-
 .../core/uri/parser/search/SearchParser.java    |   62 +-
 .../parser/search/SearchParserException.java    |    6 +-
 .../uri/parser/search/SearchQueryToken.java     |    9 +-
 .../core/uri/parser/search/SearchTermImpl.java  |    6 +-
 .../core/uri/parser/search/SearchTokenizer.java |  174 +-
 .../parser/search/SearchTokenizerException.java |    6 +-
 .../core/uri/parser/search/SearchUnaryImpl.java |    6 +-
 .../uri/queryoption/AliasQueryOptionImpl.java   |    4 +-
 .../core/uri/queryoption/CountOptionImpl.java   |    4 +-
 .../uri/queryoption/CustomQueryOptionImpl.java  |    4 +-
 .../core/uri/queryoption/ExpandItemImpl.java    |    8 +-
 .../core/uri/queryoption/ExpandOptionImpl.java  |    4 +-
 .../core/uri/queryoption/FilterOptionImpl.java  |    4 +-
 .../core/uri/queryoption/FormatOptionImpl.java  |    4 +-
 .../core/uri/queryoption/IdOptionImpl.java      |    4 +-
 .../core/uri/queryoption/LevelsOptionImpl.java  |    4 +-
 .../core/uri/queryoption/OrderByItemImpl.java   |   12 +-
 .../core/uri/queryoption/OrderByOptionImpl.java |    4 +-
 .../core/uri/queryoption/QueryOptionImpl.java   |    4 +-
 .../core/uri/queryoption/SearchOptionImpl.java  |    6 +-
 .../core/uri/queryoption/SelectItemImpl.java    |    4 +-
 .../core/uri/queryoption/SelectOptionImpl.java  |    4 +-
 .../core/uri/queryoption/SkipOptionImpl.java    |    4 +-
 .../uri/queryoption/SkipTokenOptionImpl.java    |    4 +-
 .../uri/queryoption/SystemQueryOptionImpl.java  |    4 +-
 .../core/uri/queryoption/TopOptionImpl.java     |    4 +-
 .../uri/queryoption/expression/AliasImpl.java   |   20 +-
 .../uri/queryoption/expression/BinaryImpl.java  |   40 +-
 .../queryoption/expression/EnumerationImpl.java |   36 +-
 .../queryoption/expression/ExpressionImpl.java  |   25 -
 .../queryoption/expression/LambdaRefImpl.java   |   21 +-
 .../uri/queryoption/expression/LiteralImpl.java |   29 +-
 .../uri/queryoption/expression/MemberImpl.java  |   31 +-
 .../uri/queryoption/expression/MethodImpl.java  |  110 +-
 .../queryoption/expression/TypeLiteralImpl.java |   21 +-
 .../uri/queryoption/expression/UnaryImpl.java   |   30 +-
 .../uri/validator/UriValidationException.java   |    9 +-
 .../server/core/uri/validator/UriValidator.java |  272 +-
 .../server-core-exceptions-i18n.properties      |   22 +-
 .../server/core/ContentNegotiatorTest.java      |    8 +-
 .../olingo/server/core/ExceptionHelperTest.java |    6 +-
 .../server/core/ODataHttpHandlerImplTest.java   |    6 +-
 .../olingo/server/core/ODataImplTest.java       |    4 +-
 .../core/TranslatedExceptionSubclassesTest.java |    4 +-
 .../batchhandler/MockedBatchHandlerTest.java    |    4 +-
 .../server/core/debug/AbstractDebugTabTest.java |    8 +-
 .../server/core/debug/DebugTabBodyTest.java     |    4 +-
 .../server/core/debug/DebugTabRequestTest.java  |    4 +-
 .../server/core/debug/DebugTabResponseTest.java |    4 +-
 .../server/core/debug/DebugTabServerTest.java   |    6 +-
 .../core/debug/ServerCoreDebuggerTest.java      |    6 +-
 .../FixedFormatDeserializerTest.java            |    4 +-
 .../deserializer/batch/BatchLineReaderTest.java |    4 +-
 .../batch/BatchParserCommonTest.java            |    4 +-
 .../batch/BatchRequestParserTest.java           |   16 +-
 .../core/deserializer/batch/HeaderTest.java     |    4 +-
 .../batch/HttpRequestStatusLineTest.java        |    4 +-
 .../json/ODataJsonDeserializerBasicTest.java    |    4 +-
 .../olingo/server/core/etag/ETagHelperTest.java |    4 +-
 .../olingo/server/core/etag/ETagParserTest.java |    4 +-
 .../server/core/prefer/PreferencesTest.java     |    8 +-
 .../serializer/AsyncResponseSerializerTest.java |   18 +-
 .../serializer/BatchResponseSerializerTest.java |   20 +-
 .../serializer/FixedFormatSerializerTest.java   |    4 +-
 .../json/ServerErrorSerializerTest.java         |    8 +-
 .../utils/CircleStreamBufferTest.java           |    5 +-
 .../serializer/utils/ContextURLBuilderTest.java |    4 +-
 .../xml/MetadataDocumentXmlSerializerTest.java  |  205 +-
 .../xml/ServerErrorXmlSerializerTest.java       |   18 +-
 .../xml/ServiceDocumentXmlSerializerTest.java   |   24 +-
 .../olingo/server/core/uri/UriInfoImplTest.java |  202 +
 .../core/uri/parser/ExpressionParserTest.java   |  271 +
 .../server/core/uri/parser/LexerTest.java       |  318 +
 .../server/core/uri/parser/UriDecoderTest.java  |   95 +
 .../core/uri/parser/UriTokenizerTest.java       |  657 ++
 .../search/SearchParserAndTokenizerTest.java    |  139 +-
 .../uri/parser/search/SearchParserTest.java     |   29 +-
 .../uri/parser/search/SearchTokenizerTest.java  |  121 +-
 .../src/test/resources/simplelogger.properties  |   20 -
 lib/server-tecsvc/pom.xml                       |    2 +-
 .../server/tecsvc/data/DataProviderTest.java    |    4 +-
 lib/server-test/pom.xml                         |   11 +-
 .../server/core/PreconditionsValidatorTest.java |   25 +-
 .../serializer/utils/ContextURLHelperTest.java  |    4 +-
 .../olingo/server/core/uri/UriHelperTest.java   |    4 +-
 .../olingo/server/core/uri/UriInfoImplTest.java |  212 -
 .../server/core/uri/UriResourceImplTest.java    |  172 +-
 .../core/uri/antlr/TestFullResourcePath.java    | 6009 ------------------
 .../olingo/server/core/uri/antlr/TestLexer.java |  303 -
 .../core/uri/antlr/TestUriParserImpl.java       | 1177 ----
 .../server/core/uri/parser/ParserTest.java      |   60 +-
 .../server/core/uri/parser/RawUriTest.java      |  150 -
 .../core/uri/parser/TestFullResourcePath.java   | 5906 +++++++++++++++++
 .../core/uri/parser/TestUriParserImpl.java      | 1047 +++
 .../core/uri/queryoption/QueryOptionTest.java   |   20 +-
 .../queryoption/expression/ExpressionTest.java  |  143 +-
 .../core/uri/testutil/ExpandValidator.java      |   19 +-
 .../core/uri/testutil/FilterValidator.java      |  112 +-
 .../core/uri/testutil/ParserWithLogging.java    |   56 -
 .../core/uri/testutil/ResourceValidator.java    |   14 +-
 .../core/uri/testutil/TestErrorLogger.java      |  105 -
 .../core/uri/testutil/TestUriValidator.java     |   52 +-
 .../core/uri/testutil/TokenValidator.java       |  193 -
 .../core/uri/testutil/UriLexerWithTrace.java    |   85 -
 .../core/uri/validator/UriValidatorTest.java    |   21 +-
 .../src/test/resources/simplelogger.properties  |   20 -
 pom.xml                                         |   16 +-
 samples/client/pom.xml                          |    2 +-
 samples/osgi/server/README.txt                  |   10 +-
 samples/osgi/server/pom.xml                     |    2 +-
 samples/pom.xml                                 |    2 +-
 samples/server/pom.xml                          |    2 +-
 samples/tutorials/p0_all/pom.xml                |    4 +-
 samples/tutorials/p10_media/pom.xml             |    4 +-
 samples/tutorials/p11_batch/pom.xml             |    4 +-
 samples/tutorials/p12_deep_insert/pom.xml       |    4 +-
 .../p12_deep_insert_preparation/pom.xml         |    4 +-
 samples/tutorials/p1_read/pom.xml               |    4 +-
 samples/tutorials/p2_readep/pom.xml             |    4 +-
 samples/tutorials/p3_write/pom.xml              |    4 +-
 samples/tutorials/p4_navigation/pom.xml         |    4 +-
 samples/tutorials/p5_queryoptions-tcs/pom.xml   |    4 +-
 samples/tutorials/p6_queryoptions-es/pom.xml    |    4 +-
 samples/tutorials/p7_queryoptions-o/pom.xml     |    4 +-
 samples/tutorials/p8_queryoptions-f/pom.xml     |    4 +-
 samples/tutorials/p9_action/pom.xml             |    4 +-
 samples/tutorials/p9_action_preparation/pom.xml |    4 +-
 samples/tutorials/pom.xml                       |    2 +-
 579 files changed, 16609 insertions(+), 16456 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
----------------------------------------------------------------------
diff --cc lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
index e2aee4e,743d437..d3ec8e8
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntityCollection.java
@@@ -26,14 -25,11 +26,11 @@@ import java.util.List
  /**
   * Data representation for a collection of single entities.
   */
 -public class EntityCollection extends AbstractODataObject {
 +public class EntityCollection extends AbstractODataObject implements Iterable<Entity> {
  
-   private Integer count;
- 
    private final List<Entity> entities = new ArrayList<Entity>();
- 
+   private Integer count;
    private URI next;
- 
    private URI deltaLink;
  
    /**
@@@ -100,7 -96,24 +97,29 @@@
    }
  
    @Override
 +  public Iterator<Entity> iterator() {
 +    return this.entities.iterator();
 +  }
++
++  @Override
+   public boolean equals(final Object o) {
+     if (!super.equals(o)) {
+       return false;
+     }
+     final EntityCollection other = (EntityCollection) o;
+     return entities.equals(other.entities)
+         && (count == null ? other.count == null : count.equals(other.count))
+         && (next == null ? other.next == null : next.equals(other.next))
+         && (deltaLink == null ? other.deltaLink == null : deltaLink.equals(other.deltaLink));
+   }
+ 
+   @Override
+   public int hashCode() {
+     int result = super.hashCode();
+     result = 31 * result + entities.hashCode();
+     result = 31 * result + (count == null ? 0 : count.hashCode());
+     result = 31 * result + (next == null ? 0 : next.hashCode());
+     result = 31 * result + (deltaLink == null ? 0 : deltaLink.hashCode());
+     return result;
+   }
  }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataResponse.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerResult.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
index ce0258c,a912862..7f84319
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
@@@ -767,13 -767,13 +767,13 @@@ public class ODataJsonSerializer extend
  
    }
  
-   void writeContextURL(final ContextURL contextURL, JsonGenerator json) throws IOException {
 -  private void writeContextURL(final ContextURL contextURL, final JsonGenerator json) throws IOException {
++  void writeContextURL(final ContextURL contextURL, final JsonGenerator json) throws IOException {
      if (!isODataMetadataNone && contextURL != null) {
        json.writeStringField(Constants.JSON_CONTEXT, ContextURLBuilder.create(contextURL).toASCIIString());
      }
    }
  
-   void writeMetadataETag(final ServiceMetadata metadata, JsonGenerator json) throws IOException {
 -  private void writeMetadataETag(final ServiceMetadata metadata, final JsonGenerator json) throws IOException {
++  void writeMetadataETag(final ServiceMetadata metadata, final JsonGenerator json) throws IOException {
      if (!isODataMetadataNone
          && metadata != null
          && metadata.getServiceMetadataETagSupport() != null
@@@ -783,7 -783,7 +783,7 @@@
      }
    }
  
-   void writeCount(final EntityCollection entityCollection, JsonGenerator json) throws IOException {
 -  private void writeCount(final EntityCollection entityCollection, final JsonGenerator json) throws IOException {
++  void writeCount(final EntityCollection entityCollection, final JsonGenerator json) throws IOException {
      if (entityCollection.getCount() != null) {
        if (isIEEE754Compatible) {
          json.writeStringField(Constants.JSON_COUNT, entityCollection.getCount().toString());
@@@ -793,7 -793,7 +793,7 @@@
      }
    }
  
-   void writeNextLink(final EntityCollection entitySet, JsonGenerator json) throws IOException {
 -  private void writeNextLink(final EntityCollection entitySet, final JsonGenerator json) throws IOException {
++  void writeNextLink(final EntityCollection entitySet, final JsonGenerator json) throws IOException {
      if (entitySet.getNext() != null) {
        json.writeStringField(Constants.JSON_NEXT_LINK, entitySet.getNext().toASCIIString());
      }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c02215e2/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java
----------------------------------------------------------------------


[28/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] Shift dependecies from commons to core

Posted by mi...@apache.org.
[OLINGO-834] Shift dependecies from commons to core

The dependencies were not used in the commons part of the library


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: b0866014df9d876cb44ea1f9632cab5ca95be7f5
Parents: 53d2e8b
Author: Christian Amend <ch...@sap.com>
Authored: Fri Jan 8 13:12:45 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Fri Jan 8 13:12:45 2016 +0100

----------------------------------------------------------------------
 lib/client-core/pom.xml  | 21 +++++++++++++++++++++
 lib/commons-core/pom.xml | 22 ----------------------
 lib/server-core/pom.xml  | 14 ++++++++++++++
 3 files changed, 35 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b0866014/lib/client-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/pom.xml b/lib/client-core/pom.xml
index a9c7f7a..092ffac 100644
--- a/lib/client-core/pom.xml
+++ b/lib/client-core/pom.xml
@@ -46,6 +46,27 @@
       <version>${project.version}</version>
     </dependency>
 
+	<dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+	<dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+    </dependency>
+	<dependency>
+      <groupId>com.fasterxml.jackson.dataformat</groupId>
+      <artifactId>jackson-dataformat-xml</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml</groupId>
+      <artifactId>aalto-xml</artifactId>
+    </dependency>
+	
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b0866014/lib/commons-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-core/pom.xml b/lib/commons-core/pom.xml
index 2c069f9..e9c0179 100644
--- a/lib/commons-core/pom.xml
+++ b/lib/commons-core/pom.xml
@@ -46,27 +46,6 @@
     </dependency>
 
     <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-annotations</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.dataformat</groupId>
-      <artifactId>jackson-dataformat-xml</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml</groupId>
-      <artifactId>aalto-xml</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>
@@ -99,7 +78,6 @@
               org.apache.olingo.commons.core.edm,
               org.apache.olingo.commons.core.edm.provider,
               org.apache.olingo.commons.core.edm.primitivetype,
-              org.apache.olingo.commons.core.serialization
             </Export-Package>
             <Import-Package>
               *

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b0866014/lib/server-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml
index 6e22690..0c329d9 100644
--- a/lib/server-core/pom.xml
+++ b/lib/server-core/pom.xml
@@ -57,6 +57,20 @@
       <scope>test</scope>
     </dependency>
 
+	<dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+	
+	<dependency>
+      <groupId>com.fasterxml</groupId>
+      <artifactId>aalto-xml</artifactId>
+    </dependency>
+	
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>


[09/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp ServerCore

Posted by mi...@apache.org.
[OLINGO-841] CleanUp ServerCore


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 371bf9a55c4c35c80705c828fc5028494004c196
Parents: d4902f7
Author: Christian Amend <ch...@sap.com>
Authored: Fri Dec 18 13:44:20 2015 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Fri Dec 18 13:47:48 2015 +0100

----------------------------------------------------------------------
 .../olingo/server/core/ContentNegotiator.java   |  18 +-
 .../server/core/ContentNegotiatorException.java |   4 +-
 .../server/core/DefaultRedirectProcessor.java   |   4 +-
 .../olingo/server/core/ODataDispatcher.java     | 132 +++++-----
 .../server/core/ODataExceptionHelper.java       |  14 +-
 .../apache/olingo/server/core/ODataHandler.java |  18 +-
 .../server/core/ODataHandlerException.java      |   6 +-
 .../server/core/ODataHttpHandlerImpl.java       |   8 +-
 .../apache/olingo/server/core/ODataImpl.java    |  10 +-
 .../olingo/server/core/RedirectProcessor.java   |   4 +-
 .../olingo/server/core/ServiceMetadataImpl.java |   8 +-
 .../core/batchhandler/BatchFacadeImpl.java      |   8 +-
 .../server/core/batchhandler/BatchHandler.java  |   4 +-
 .../core/batchhandler/BatchPartHandler.java     |   6 +-
 .../BatchReferenceRewriter.java                 |   4 +-
 .../core/debug/DebugResponseHelperImpl.java     | 118 ++++-----
 .../olingo/server/core/debug/DebugTab.java      |   5 +-
 .../olingo/server/core/debug/DebugTabBody.java  |  12 +-
 .../server/core/debug/DebugTabRequest.java      |  28 +--
 .../server/core/debug/DebugTabResponse.java     |  14 +-
 .../server/core/debug/DebugTabRuntime.java      |  34 +--
 .../server/core/debug/DebugTabServer.java       |  14 +-
 .../server/core/debug/DebugTabStacktrace.java   |  24 +-
 .../olingo/server/core/debug/DebugTabUri.java   |  49 ++--
 .../core/debug/ExpressionJsonVisitor.java       |  12 +-
 .../server/core/debug/ServerCoreDebugger.java   |  12 +-
 .../deserializer/DeserializerResultImpl.java    |   4 +-
 .../FixedFormatDeserializerImpl.java            |  10 +-
 .../core/deserializer/batch/BatchBodyPart.java  |   8 +-
 .../deserializer/batch/BatchChangeSetPart.java  |   4 +-
 .../deserializer/batch/BatchLineReader.java     |  44 ++--
 .../core/deserializer/batch/BatchParser.java    |  10 +-
 .../deserializer/batch/BatchParserCommon.java   |  14 +-
 .../core/deserializer/batch/BatchPart.java      |   4 +-
 .../deserializer/batch/BatchQueryOperation.java |   4 +-
 .../batch/BatchRequestTransformator.java        |  20 +-
 .../batch/BatchTransformatorCommon.java         |   8 +-
 .../server/core/deserializer/batch/Header.java  |   4 +-
 .../core/deserializer/batch/HeaderField.java    |   4 +-
 .../batch/HttpRequestStatusLine.java            |   6 +-
 .../server/core/deserializer/batch/Line.java    |   4 +-
 .../deserializer/helper/ExpandTreeBuilder.java  |   4 +-
 .../helper/ExpandTreeBuilderImpl.java           |   4 +-
 .../json/ODataJsonDeserializer.java             | 113 ++++-----
 .../deserializer/xml/ODataXmlDeserializer.java  |  34 +--
 .../olingo/server/core/etag/ETagHelperImpl.java |   8 +-
 .../server/core/etag/ETagInformation.java       |   4 +-
 .../olingo/server/core/etag/ETagParser.java     |  22 +-
 .../core/etag/PreconditionsValidator.java       |  14 +-
 .../olingo/server/core/prefer/PreferParser.java |  40 +--
 .../server/core/prefer/PreferencesImpl.java     |  13 +-
 .../serializer/AbstractODataSerializer.java     |   7 +-
 .../serializer/AsyncResponseSerializer.java     |  18 +-
 .../serializer/BatchResponseSerializer.java     |  45 ++--
 .../serializer/FixedFormatSerializerImpl.java   |   6 +-
 .../core/serializer/SerializerResultImpl.java   |   4 +-
 .../serializer/json/ODataErrorSerializer.java   |   4 +-
 .../serializer/json/ODataJsonSerializer.java    |  94 +++----
 .../json/ServiceDocumentJsonSerializer.java     |  12 +-
 .../serializer/utils/CircleStreamBuffer.java    |   4 +-
 .../serializer/utils/ContentTypeHelper.java     |  16 +-
 .../serializer/utils/ContextURLBuilder.java     |  22 +-
 .../core/serializer/utils/ContextURLHelper.java |  17 +-
 .../serializer/utils/ExpandSelectHelper.java    |   4 +-
 .../xml/MetadataDocumentXmlSerializer.java      |  38 +--
 .../core/serializer/xml/ODataXmlSerializer.java |  27 ++-
 .../xml/ServiceDocumentXmlSerializer.java       |  12 +-
 .../olingo/server/core/uri/UriHelperImpl.java   |   8 +-
 .../olingo/server/core/uri/UriInfoImpl.java     |   4 +-
 .../server/core/uri/UriParameterImpl.java       |   4 +-
 .../server/core/uri/UriResourceActionImpl.java  |  12 +-
 .../uri/UriResourceComplexPropertyImpl.java     |   8 +-
 .../server/core/uri/UriResourceCountImpl.java   |   8 +-
 .../core/uri/UriResourceEntitySetImpl.java      |   9 +-
 .../core/uri/UriResourceFunctionImpl.java       |   6 +-
 .../olingo/server/core/uri/UriResourceImpl.java |   4 +-
 .../server/core/uri/UriResourceItImpl.java      |   8 +-
 .../core/uri/UriResourceLambdaAllImpl.java      |   8 +-
 .../core/uri/UriResourceLambdaAnyImpl.java      |   8 +-
 .../core/uri/UriResourceLambdaVarImpl.java      |   8 +-
 .../uri/UriResourceNavigationPropertyImpl.java  |   8 +-
 .../uri/UriResourcePrimitivePropertyImpl.java   |  10 +-
 .../server/core/uri/UriResourceRefImpl.java     |   7 +-
 .../server/core/uri/UriResourceRootImpl.java    |   8 +-
 .../core/uri/UriResourceSingletonImpl.java      |   8 +-
 .../uri/UriResourceStartingTypeFilterImpl.java  |   8 +-
 .../server/core/uri/UriResourceTypedImpl.java   |   5 +-
 .../server/core/uri/UriResourceValueImpl.java   |   6 +-
 .../core/uri/UriResourceWithKeysImpl.java       |   6 +-
 .../uri/parser/CheckFullContextListener.java    |   4 +-
 .../olingo/server/core/uri/parser/Parser.java   |  18 +-
 .../olingo/server/core/uri/parser/RawUri.java   |   4 +-
 .../server/core/uri/parser/UriContext.java      |  29 +--
 .../server/core/uri/parser/UriDecoder.java      |  10 +-
 .../core/uri/parser/UriParseTreeVisitor.java    | 242 +++++++++----------
 .../core/uri/parser/UriParserException.java     |   4 +-
 .../uri/parser/UriParserSemanticException.java  |  10 +-
 .../uri/parser/UriParserSyntaxException.java    |   6 +-
 .../uri/parser/search/SearchBinaryImpl.java     |   7 +-
 .../uri/parser/search/SearchExpressionImpl.java |   4 +-
 .../core/uri/parser/search/SearchParser.java    |  60 ++---
 .../parser/search/SearchParserException.java    |   6 +-
 .../uri/parser/search/SearchQueryToken.java     |   9 +-
 .../core/uri/parser/search/SearchTermImpl.java  |   6 +-
 .../core/uri/parser/search/SearchTokenizer.java | 129 +++++-----
 .../parser/search/SearchTokenizerException.java |   6 +-
 .../core/uri/parser/search/SearchUnaryImpl.java |   6 +-
 .../uri/queryoption/AliasQueryOptionImpl.java   |   4 +-
 .../core/uri/queryoption/CountOptionImpl.java   |   4 +-
 .../uri/queryoption/CustomQueryOptionImpl.java  |   4 +-
 .../core/uri/queryoption/ExpandItemImpl.java    |   8 +-
 .../core/uri/queryoption/ExpandOptionImpl.java  |   4 +-
 .../core/uri/queryoption/FilterOptionImpl.java  |   4 +-
 .../core/uri/queryoption/FormatOptionImpl.java  |   4 +-
 .../core/uri/queryoption/IdOptionImpl.java      |   4 +-
 .../core/uri/queryoption/LevelsOptionImpl.java  |   4 +-
 .../core/uri/queryoption/OrderByItemImpl.java   |   4 +-
 .../core/uri/queryoption/OrderByOptionImpl.java |   4 +-
 .../core/uri/queryoption/QueryOptionImpl.java   |   4 +-
 .../core/uri/queryoption/SearchOptionImpl.java  |   6 +-
 .../core/uri/queryoption/SelectItemImpl.java    |   4 +-
 .../core/uri/queryoption/SelectOptionImpl.java  |   4 +-
 .../core/uri/queryoption/SkipOptionImpl.java    |   4 +-
 .../uri/queryoption/SkipTokenOptionImpl.java    |   4 +-
 .../uri/queryoption/SystemQueryOptionImpl.java  |   4 +-
 .../core/uri/queryoption/TopOptionImpl.java     |   4 +-
 .../uri/queryoption/expression/AliasImpl.java   |   4 +-
 .../uri/queryoption/expression/BinaryImpl.java  |   4 +-
 .../queryoption/expression/EnumerationImpl.java |   4 +-
 .../queryoption/expression/ExpressionImpl.java  |   4 +-
 .../queryoption/expression/LambdaRefImpl.java   |   4 +-
 .../uri/queryoption/expression/LiteralImpl.java |   4 +-
 .../uri/queryoption/expression/MemberImpl.java  |   4 +-
 .../uri/queryoption/expression/MethodImpl.java  |   4 +-
 .../queryoption/expression/TypeLiteralImpl.java |   4 +-
 .../uri/queryoption/expression/UnaryImpl.java   |   4 +-
 .../uri/validator/UriValidationException.java   |   7 +-
 .../server/core/uri/validator/UriValidator.java | 239 +++++++++---------
 .../server/core/ContentNegotiatorTest.java      |   8 +-
 .../olingo/server/core/ExceptionHelperTest.java |   6 +-
 .../server/core/ODataHttpHandlerImplTest.java   |   6 +-
 .../olingo/server/core/ODataImplTest.java       |   4 +-
 .../core/TranslatedExceptionSubclassesTest.java |   4 +-
 .../batchhandler/MockedBatchHandlerTest.java    |   4 +-
 .../server/core/debug/AbstractDebugTabTest.java |   8 +-
 .../server/core/debug/DebugTabBodyTest.java     |   4 +-
 .../server/core/debug/DebugTabRequestTest.java  |   4 +-
 .../server/core/debug/DebugTabResponseTest.java |   4 +-
 .../server/core/debug/DebugTabServerTest.java   |   6 +-
 .../core/debug/ServerCoreDebuggerTest.java      |   6 +-
 .../FixedFormatDeserializerTest.java            |   4 +-
 .../deserializer/batch/BatchLineReaderTest.java |   4 +-
 .../batch/BatchParserCommonTest.java            |   4 +-
 .../batch/BatchRequestParserTest.java           |  16 +-
 .../core/deserializer/batch/HeaderTest.java     |   4 +-
 .../batch/HttpRequestStatusLineTest.java        |   4 +-
 .../json/ODataJsonDeserializerBasicTest.java    |   4 +-
 .../olingo/server/core/etag/ETagHelperTest.java |   4 +-
 .../olingo/server/core/etag/ETagParserTest.java |   4 +-
 .../server/core/prefer/PreferencesTest.java     |   8 +-
 .../serializer/AsyncResponseSerializerTest.java |  18 +-
 .../serializer/BatchResponseSerializerTest.java |  20 +-
 .../serializer/FixedFormatSerializerTest.java   |   4 +-
 .../json/ServerErrorSerializerTest.java         |   8 +-
 .../utils/CircleStreamBufferTest.java           |   5 +-
 .../serializer/utils/ContextURLBuilderTest.java |   4 +-
 .../xml/MetadataDocumentXmlSerializerTest.java  | 205 ++++++++--------
 .../xml/ServerErrorXmlSerializerTest.java       |  18 +-
 .../xml/ServiceDocumentXmlSerializerTest.java   |  24 +-
 .../search/SearchParserAndTokenizerTest.java    | 119 +++++----
 .../uri/parser/search/SearchParserTest.java     |  17 +-
 .../uri/parser/search/SearchTokenizerTest.java  | 113 ++++-----
 172 files changed, 1550 insertions(+), 1518 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
index e47d864..86697d5 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -65,10 +65,10 @@ public final class ContentNegotiator {
 
   private static List<ContentType> getSupportedContentTypes(
       final CustomContentTypeSupport customContentTypeSupport, final RepresentationType representationType)
-      throws ContentNegotiatorException {
+          throws ContentNegotiatorException {
     final List<ContentType> defaultSupportedContentTypes = getDefaultSupportedContentTypes(representationType);
     final List<ContentType> result = customContentTypeSupport == null ? defaultSupportedContentTypes :
-        customContentTypeSupport.modifySupportedContentTypes(defaultSupportedContentTypes, representationType);
+      customContentTypeSupport.modifySupportedContentTypes(defaultSupportedContentTypes, representationType);
     if (result == null || result.isEmpty()) {
       throw new ContentNegotiatorException("No content type has been specified as supported.",
           ContentNegotiatorException.MessageKeys.NO_CONTENT_TYPE_SUPPORTED);
@@ -79,7 +79,7 @@ public final class ContentNegotiator {
 
   public static ContentType doContentNegotiation(final FormatOption formatOption, final ODataRequest request,
       final CustomContentTypeSupport customContentTypeSupport, final RepresentationType representationType)
-      throws ContentNegotiatorException {
+          throws ContentNegotiatorException {
     final List<ContentType> supportedContentTypes =
         getSupportedContentTypes(customContentTypeSupport, representationType);
     final String acceptHeaderValue = request.getHeader(HttpHeader.ACCEPT);
@@ -93,7 +93,7 @@ public final class ContentNegotiator {
         result = getAcceptedType(
             AcceptType.fromContentType(contentType == null ?
                 ContentType.create(formatOption.getFormat()) : contentType),
-            supportedContentTypes);
+                supportedContentTypes);
       } catch (final IllegalArgumentException e) {
         // Exception results in result = null for next check.
       }
@@ -127,8 +127,8 @@ public final class ContentNegotiator {
 
   private static ContentType mapContentType(final String formatString) {
     return JSON.equalsIgnoreCase(formatString) ? ContentType.JSON :
-    XML.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_XML :
-    ATOM.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_ATOM_XML : null;
+        XML.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_XML :
+            ATOM.equalsIgnoreCase(formatString) ? ContentType.APPLICATION_ATOM_XML : null;
   }
 
   private static ContentType getAcceptedType(final List<AcceptType> acceptedContentTypes,
@@ -164,7 +164,7 @@ public final class ContentNegotiator {
 
   public static void checkSupport(final ContentType contentType,
       final CustomContentTypeSupport customContentTypeSupport, final RepresentationType representationType)
-      throws ContentNegotiatorException {
+          throws ContentNegotiatorException {
     for (ContentType supportedContentType : getSupportedContentTypes(customContentTypeSupport, representationType)) {
       if (AcceptType.fromContentType(supportedContentType).get(0).matches(contentType)) {
         return;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java
index a76c549..12a0582 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiatorException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java
index efe3e71..a6460fa 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/DefaultRedirectProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java
index bbe73e0..4971c8e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataDispatcher.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -77,32 +77,32 @@ public class ODataDispatcher {
   private final UriInfo uriInfo;
   private final ODataHandler handler;
 
-  public ODataDispatcher(UriInfo uriInfo, ODataHandler handler) {
+  public ODataDispatcher(final UriInfo uriInfo, final ODataHandler handler) {
     this.uriInfo = uriInfo;
     this.handler = handler;
   }
 
-  public void dispatch(ODataRequest request, ODataResponse response) throws ODataApplicationException,
-      ODataLibraryException {
+  public void dispatch(final ODataRequest request, final ODataResponse response) throws ODataApplicationException,
+  ODataLibraryException {
     switch (uriInfo.getKind()) {
     case metadata:
       checkMethod(request.getMethod(), HttpMethod.GET);
       final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
           request, handler.getCustomContentTypeSupport(), RepresentationType.METADATA);
       handler.selectProcessor(MetadataProcessor.class)
-          .readMetadata(request, response, uriInfo, requestedContentType);
+      .readMetadata(request, response, uriInfo, requestedContentType);
       break;
 
     case service:
       checkMethod(request.getMethod(), HttpMethod.GET);
       if ("".equals(request.getRawODataPath())) {
         handler.selectProcessor(RedirectProcessor.class)
-            .redirect(request, response);
+        .redirect(request, response);
       } else {
         final ContentType serviceContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
             request, handler.getCustomContentTypeSupport(), RepresentationType.SERVICE);
         handler.selectProcessor(ServiceDocumentProcessor.class)
-            .readServiceDocument(request, response, uriInfo, serviceContentType);
+        .readServiceDocument(request, response, uriInfo, serviceContentType);
       }
       break;
 
@@ -113,7 +113,7 @@ public class ODataDispatcher {
     case batch:
       checkMethod(request.getMethod(), HttpMethod.POST);
       new BatchHandler(handler, handler.selectProcessor(BatchProcessor.class))
-          .process(request, response, true);
+      .process(request, response, true);
       break;
 
     default:
@@ -211,7 +211,7 @@ public class ODataDispatcher {
     final EdmReturnType returnType = action.getReturnType();
     if (returnType == null) {
       handler.selectProcessor(ActionVoidProcessor.class)
-          .processActionVoid(request, response, uriInfo, requestFormat);
+      .processActionVoid(request, response, uriInfo, requestFormat);
     } else {
       final boolean isCollection = returnType.isCollection();
       ContentType responseFormat;
@@ -222,10 +222,10 @@ public class ODataDispatcher {
             isCollection ? RepresentationType.COLLECTION_ENTITY : RepresentationType.ENTITY);
         if (isCollection) {
           handler.selectProcessor(ActionEntityCollectionProcessor.class)
-              .processActionEntityCollection(request, response, uriInfo, requestFormat, responseFormat);
+          .processActionEntityCollection(request, response, uriInfo, requestFormat, responseFormat);
         } else {
           handler.selectProcessor(ActionEntityProcessor.class)
-              .processActionEntity(request, response, uriInfo, requestFormat, responseFormat);
+          .processActionEntity(request, response, uriInfo, requestFormat, responseFormat);
         }
         break;
 
@@ -235,10 +235,10 @@ public class ODataDispatcher {
             isCollection ? RepresentationType.COLLECTION_PRIMITIVE : RepresentationType.PRIMITIVE);
         if (isCollection) {
           handler.selectProcessor(ActionPrimitiveCollectionProcessor.class)
-              .processActionPrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat);
+          .processActionPrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat);
         } else {
           handler.selectProcessor(ActionPrimitiveProcessor.class)
-              .processActionPrimitive(request, response, uriInfo, requestFormat, responseFormat);
+          .processActionPrimitive(request, response, uriInfo, requestFormat, responseFormat);
         }
         break;
 
@@ -248,10 +248,10 @@ public class ODataDispatcher {
             isCollection ? RepresentationType.COLLECTION_COMPLEX : RepresentationType.COMPLEX);
         if (isCollection) {
           handler.selectProcessor(ActionComplexCollectionProcessor.class)
-              .processActionComplexCollection(request, response, uriInfo, requestFormat, responseFormat);
+          .processActionComplexCollection(request, response, uriInfo, requestFormat, responseFormat);
         } else {
           handler.selectProcessor(ActionComplexProcessor.class)
-              .processActionComplex(request, response, uriInfo, requestFormat, responseFormat);
+          .processActionComplex(request, response, uriInfo, requestFormat, responseFormat);
         }
         break;
 
@@ -273,13 +273,13 @@ public class ODataDispatcher {
       final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
           request, handler.getCustomContentTypeSupport(), RepresentationType.COLLECTION_REFERENCE);
       handler.selectProcessor(ReferenceCollectionProcessor.class)
-          .readReferenceCollection(request, response, uriInfo, responseFormat);
+      .readReferenceCollection(request, response, uriInfo, responseFormat);
 
     } else if (isCollection && httpMethod == HttpMethod.POST) {
       final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE),
           RepresentationType.REFERENCE, true);
       handler.selectProcessor(ReferenceProcessor.class)
-          .createReference(request, response, uriInfo, requestFormat);
+      .createReference(request, response, uriInfo, requestFormat);
 
     } else if (!isCollection && httpMethod == HttpMethod.GET) {
       final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
@@ -290,11 +290,11 @@ public class ODataDispatcher {
       final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE),
           RepresentationType.REFERENCE, true);
       handler.selectProcessor(ReferenceProcessor.class)
-          .updateReference(request, response, uriInfo, requestFormat);
+      .updateReference(request, response, uriInfo, requestFormat);
 
     } else if (httpMethod == HttpMethod.DELETE) {
       handler.selectProcessor(ReferenceProcessor.class)
-          .deleteReference(request, response, uriInfo);
+      .deleteReference(request, response, uriInfo);
 
     } else {
       throwMethodNotAllowed(httpMethod);
@@ -310,47 +310,47 @@ public class ODataDispatcher {
         && ((UriResourceFunction) resource).getType().getKind() == EdmTypeKind.PRIMITIVE) {
       final EdmType type = resource instanceof UriResourceProperty ?
           ((UriResourceProperty) resource).getType() : ((UriResourceFunction) resource).getType();
-      final RepresentationType valueRepresentationType =
-          type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Binary) ?
-              RepresentationType.BINARY : RepresentationType.VALUE;
-      if (method == HttpMethod.GET) {
-        final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
-            request, handler.getCustomContentTypeSupport(), valueRepresentationType);
-
-        handler.selectProcessor(PrimitiveValueProcessor.class)
+          final RepresentationType valueRepresentationType =
+              type == EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Binary) ?
+                  RepresentationType.BINARY : RepresentationType.VALUE;
+          if (method == HttpMethod.GET) {
+            final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
+                request, handler.getCustomContentTypeSupport(), valueRepresentationType);
+
+            handler.selectProcessor(PrimitiveValueProcessor.class)
             .readPrimitiveValue(request, response, uriInfo, requestedContentType);
-      } else if (method == HttpMethod.PUT && resource instanceof UriResourceProperty) {
-        validatePreconditions(request, false);
-        final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE),
-            valueRepresentationType, true);
-        final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
-            request, handler.getCustomContentTypeSupport(), valueRepresentationType);
-        handler.selectProcessor(PrimitiveValueProcessor.class)
+          } else if (method == HttpMethod.PUT && resource instanceof UriResourceProperty) {
+            validatePreconditions(request, false);
+            final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE),
+                valueRepresentationType, true);
+            final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
+                request, handler.getCustomContentTypeSupport(), valueRepresentationType);
+            handler.selectProcessor(PrimitiveValueProcessor.class)
             .updatePrimitiveValue(request, response, uriInfo, requestFormat, responseFormat);
-      } else if (method == HttpMethod.DELETE && resource instanceof UriResourceProperty) {
-        validatePreconditions(request, false);
-        handler.selectProcessor(PrimitiveValueProcessor.class)
+          } else if (method == HttpMethod.DELETE && resource instanceof UriResourceProperty) {
+            validatePreconditions(request, false);
+            handler.selectProcessor(PrimitiveValueProcessor.class)
             .deletePrimitiveValue(request, response, uriInfo);
-      } else {
-        throwMethodNotAllowed(method);
-      }
+          } else {
+            throwMethodNotAllowed(method);
+          }
     } else {
       if (method == HttpMethod.GET) {
         final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
             request, handler.getCustomContentTypeSupport(), RepresentationType.MEDIA);
         handler.selectProcessor(MediaEntityProcessor.class)
-            .readMediaEntity(request, response, uriInfo, requestedContentType);
+        .readMediaEntity(request, response, uriInfo, requestedContentType);
       } else if (method == HttpMethod.PUT && resource instanceof UriResourceEntitySet) {
         validatePreconditions(request, true);
         final ContentType requestFormat = ContentType.parse(request.getHeader(HttpHeader.CONTENT_TYPE));
         final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
             request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY);
         handler.selectProcessor(MediaEntityProcessor.class)
-            .updateMediaEntity(request, response, uriInfo, requestFormat, responseFormat);
+        .updateMediaEntity(request, response, uriInfo, requestFormat, responseFormat);
       } else if (method == HttpMethod.DELETE && resource instanceof UriResourceEntitySet) {
         validatePreconditions(request, true);
         handler.selectProcessor(MediaEntityProcessor.class)
-            .deleteMediaEntity(request, response, uriInfo);
+        .deleteMediaEntity(request, response, uriInfo);
       } else {
         throwMethodNotAllowed(method);
       }
@@ -367,10 +367,10 @@ public class ODataDispatcher {
           request, handler.getCustomContentTypeSupport(), complexRepresentationType);
       if (isCollection) {
         handler.selectProcessor(ComplexCollectionProcessor.class)
-            .readComplexCollection(request, response, uriInfo, requestedContentType);
+        .readComplexCollection(request, response, uriInfo, requestedContentType);
       } else {
         handler.selectProcessor(ComplexProcessor.class)
-            .readComplex(request, response, uriInfo, requestedContentType);
+        .readComplex(request, response, uriInfo, requestedContentType);
       }
     } else if (method == HttpMethod.PUT || method == HttpMethod.PATCH) {
       validatePreconditions(request, false);
@@ -380,19 +380,19 @@ public class ODataDispatcher {
           request, handler.getCustomContentTypeSupport(), complexRepresentationType);
       if (isCollection) {
         handler.selectProcessor(ComplexCollectionProcessor.class)
-            .updateComplexCollection(request, response, uriInfo, requestFormat, responseFormat);
+        .updateComplexCollection(request, response, uriInfo, requestFormat, responseFormat);
       } else {
         handler.selectProcessor(ComplexProcessor.class)
-            .updateComplex(request, response, uriInfo, requestFormat, responseFormat);
+        .updateComplex(request, response, uriInfo, requestFormat, responseFormat);
       }
     } else if (method == HttpMethod.DELETE) {
       validatePreconditions(request, false);
       if (isCollection) {
         handler.selectProcessor(ComplexCollectionProcessor.class)
-            .deleteComplexCollection(request, response, uriInfo);
+        .deleteComplexCollection(request, response, uriInfo);
       } else {
         handler.selectProcessor(ComplexProcessor.class)
-            .deleteComplex(request, response, uriInfo);
+        .deleteComplex(request, response, uriInfo);
       }
     } else {
       throwMethodNotAllowed(method);
@@ -409,10 +409,10 @@ public class ODataDispatcher {
           request, handler.getCustomContentTypeSupport(), representationType);
       if (isCollection) {
         handler.selectProcessor(PrimitiveCollectionProcessor.class)
-            .readPrimitiveCollection(request, response, uriInfo, requestedContentType);
+        .readPrimitiveCollection(request, response, uriInfo, requestedContentType);
       } else {
         handler.selectProcessor(PrimitiveProcessor.class)
-            .readPrimitive(request, response, uriInfo, requestedContentType);
+        .readPrimitive(request, response, uriInfo, requestedContentType);
       }
     } else if (method == HttpMethod.PUT || method == HttpMethod.PATCH) {
       validatePreconditions(request, false);
@@ -422,19 +422,19 @@ public class ODataDispatcher {
           request, handler.getCustomContentTypeSupport(), representationType);
       if (isCollection) {
         handler.selectProcessor(PrimitiveCollectionProcessor.class)
-            .updatePrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat);
+        .updatePrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat);
       } else {
         handler.selectProcessor(PrimitiveProcessor.class)
-            .updatePrimitive(request, response, uriInfo, requestFormat, responseFormat);
+        .updatePrimitive(request, response, uriInfo, requestFormat, responseFormat);
       }
     } else if (method == HttpMethod.DELETE) {
       validatePreconditions(request, false);
       if (isCollection) {
         handler.selectProcessor(PrimitiveCollectionProcessor.class)
-            .deletePrimitiveCollection(request, response, uriInfo);
+        .deletePrimitiveCollection(request, response, uriInfo);
       } else {
         handler.selectProcessor(PrimitiveProcessor.class)
-            .deletePrimitive(request, response, uriInfo);
+        .deletePrimitive(request, response, uriInfo);
       }
     } else {
       throwMethodNotAllowed(method);
@@ -449,15 +449,15 @@ public class ODataDispatcher {
         || resource instanceof UriResourceFunction
         && ((UriResourceFunction) resource).getType().getKind() == EdmTypeKind.ENTITY) {
       handler.selectProcessor(CountEntityCollectionProcessor.class)
-          .countEntityCollection(request, response, uriInfo);
+      .countEntityCollection(request, response, uriInfo);
     } else if (resource instanceof UriResourcePrimitiveProperty
         || resource instanceof UriResourceFunction
         && ((UriResourceFunction) resource).getType().getKind() == EdmTypeKind.PRIMITIVE) {
       handler.selectProcessor(CountPrimitiveCollectionProcessor.class)
-          .countPrimitiveCollection(request, response, uriInfo);
+      .countPrimitiveCollection(request, response, uriInfo);
     } else {
       handler.selectProcessor(CountComplexCollectionProcessor.class)
-          .countComplexCollection(request, response, uriInfo);
+      .countComplexCollection(request, response, uriInfo);
     }
   }
 
@@ -469,19 +469,19 @@ public class ODataDispatcher {
         final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
             request, handler.getCustomContentTypeSupport(), RepresentationType.COLLECTION_ENTITY);
         handler.selectProcessor(EntityCollectionProcessor.class)
-            .readEntityCollection(request, response, uriInfo, requestedContentType);
+        .readEntityCollection(request, response, uriInfo, requestedContentType);
       } else if (method == HttpMethod.POST) {
         final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
             request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY);
         if (isMedia) {
           final ContentType requestFormat = ContentType.parse(request.getHeader(HttpHeader.CONTENT_TYPE));
           handler.selectProcessor(MediaEntityProcessor.class)
-              .createMediaEntity(request, response, uriInfo, requestFormat, responseFormat);
+          .createMediaEntity(request, response, uriInfo, requestFormat, responseFormat);
         } else {
           final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE),
               RepresentationType.ENTITY, true);
           handler.selectProcessor(EntityProcessor.class)
-              .createEntity(request, response, uriInfo, requestFormat, responseFormat);
+          .createEntity(request, response, uriInfo, requestFormat, responseFormat);
         }
       } else {
         throwMethodNotAllowed(method);
@@ -491,7 +491,7 @@ public class ODataDispatcher {
         final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
             request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY);
         handler.selectProcessor(EntityProcessor.class)
-            .readEntity(request, response, uriInfo, requestedContentType);
+        .readEntity(request, response, uriInfo, requestedContentType);
       } else if (method == HttpMethod.PUT || method == HttpMethod.PATCH) {
         validatePreconditions(request, false);
         final ContentType requestFormat = getSupportedContentType(request.getHeader(HttpHeader.CONTENT_TYPE),
@@ -499,11 +499,11 @@ public class ODataDispatcher {
         final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
             request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY);
         handler.selectProcessor(EntityProcessor.class)
-            .updateEntity(request, response, uriInfo, requestFormat, responseFormat);
+        .updateEntity(request, response, uriInfo, requestFormat, responseFormat);
       } else if (method == HttpMethod.DELETE) {
         validatePreconditions(request, false);
         handler.selectProcessor(isMedia ? MediaEntityProcessor.class : EntityProcessor.class)
-            .deleteEntity(request, response, uriInfo);
+        .deleteEntity(request, response, uriInfo);
       } else {
         throwMethodNotAllowed(method);
       }
@@ -537,7 +537,7 @@ public class ODataDispatcher {
 
   private ContentType getSupportedContentType(final String contentTypeHeader,
       final RepresentationType representationType, final boolean mustNotBeNull)
-      throws ODataHandlerException, ContentNegotiatorException {
+          throws ODataHandlerException, ContentNegotiatorException {
     if (contentTypeHeader == null) {
       if (mustNotBeNull) {
         throw new ODataHandlerException(contentTypeHeader, ODataHandlerException.MessageKeys.MISSING_CONTENT_TYPE);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
index 2de59d5..47896c9 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,10 +21,10 @@ package org.apache.olingo.server.core;
 import java.util.Locale;
 
 import org.apache.olingo.commons.api.http.HttpStatusCode;
-import org.apache.olingo.server.api.ODataServerError;
 import org.apache.olingo.server.api.ODataApplicationException;
 import org.apache.olingo.server.api.ODataLibraryException;
 import org.apache.olingo.server.api.ODataLibraryException.ODataErrorMessage;
+import org.apache.olingo.server.api.ODataServerError;
 import org.apache.olingo.server.api.deserializer.DeserializerException;
 import org.apache.olingo.server.api.etag.PreconditionException;
 import org.apache.olingo.server.api.serializer.SerializerException;
@@ -34,9 +34,9 @@ import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
 import org.apache.olingo.server.core.uri.validator.UriValidationException;
 
 public class ODataExceptionHelper {
-  
+
   private ODataExceptionHelper() {
-    //Private Constructor
+    // Private Constructor
   }
 
   public static ODataServerError createServerErrorObject(final UriValidationException e,
@@ -52,7 +52,7 @@ public class ODataExceptionHelper {
     if (UriParserSemanticException.MessageKeys.RESOURCE_NOT_FOUND.equals(e.getMessageKey())
         || UriParserSemanticException.MessageKeys.PROPERTY_NOT_IN_TYPE.equals(e.getMessageKey())) {
       serverError.setStatusCode(HttpStatusCode.NOT_FOUND.getStatusCode());
-    } else if(UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED.equals(e.getMessageKey())) {
+    } else if (UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED.equals(e.getMessageKey())) {
       serverError.setStatusCode(HttpStatusCode.NOT_IMPLEMENTED.getStatusCode());
     } else {
       serverError.setStatusCode(HttpStatusCode.BAD_REQUEST.getStatusCode());
@@ -66,7 +66,7 @@ public class ODataExceptionHelper {
     serverError.setStatusCode(
         UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION_FORMAT.equals(e.getMessageKey()) ?
             HttpStatusCode.NOT_ACCEPTABLE.getStatusCode() :
-            HttpStatusCode.BAD_REQUEST.getStatusCode());
+              HttpStatusCode.BAD_REQUEST.getStatusCode());
     return serverError;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
index 12f2dfd..52c98d1 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -63,7 +63,7 @@ public class ODataHandler {
   private UriInfo uriInfo;
   private Exception lastThrownException;
 
-  public ODataHandler(final OData server, final ServiceMetadata serviceMetadata, ServerCoreDebugger debugger) {
+  public ODataHandler(final OData server, final ServiceMetadata serviceMetadata, final ServerCoreDebugger debugger) {
     odata = server;
     this.serviceMetadata = serviceMetadata;
     this.debugger = debugger;
@@ -159,8 +159,8 @@ public class ODataHandler {
   }
 
   public void handleException(final ODataRequest request, final ODataResponse response,
-      final ODataServerError serverError, Exception exception) {
-    this.lastThrownException = exception;
+      final ODataServerError serverError, final Exception exception) {
+    lastThrownException = exception;
     ErrorProcessor exceptionProcessor;
     try {
       exceptionProcessor = selectProcessor(ErrorProcessor.class);
@@ -172,7 +172,7 @@ public class ODataHandler {
     try {
       requestedContentType = ContentNegotiator.doContentNegotiation(
           uriInfo == null ? null : uriInfo.getFormatOption(), request, getCustomContentTypeSupport(),
-          RepresentationType.ERROR);
+              RepresentationType.ERROR);
     } catch (final ContentNegotiatorException e) {
       requestedContentType = ContentType.JSON;
     }
@@ -184,8 +184,8 @@ public class ODataHandler {
   private void validateODataVersion(final ODataRequest request) throws ODataHandlerException {
     final String maxVersion = request.getHeader(HttpHeader.ODATA_MAX_VERSION);
     if (maxVersion != null && ODataServiceVersion.isBiggerThan(ODataServiceVersion.V40.toString(), maxVersion)) {
-        throw new ODataHandlerException("ODataVersion not supported: " + maxVersion,
-            ODataHandlerException.MessageKeys.ODATA_VERSION_NOT_SUPPORTED, maxVersion);
+      throw new ODataHandlerException("ODataVersion not supported: " + maxVersion,
+          ODataHandlerException.MessageKeys.ODATA_VERSION_NOT_SUPPORTED, maxVersion);
     }
   }
 
@@ -212,7 +212,7 @@ public class ODataHandler {
     return customContentTypeSupport;
   }
 
-  public void register(CustomETagSupport customETagSupport) {
+  public void register(final CustomETagSupport customETagSupport) {
     this.customETagSupport = customETagSupport;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java
index 82afe97..acf7c38 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -59,7 +59,7 @@ public class ODataHandlerException extends ODataLibraryException {
       final String... parameters) {
     super(developmentMessage, cause, messageKey, parameters);
   }
-  
+
   @Override
   protected String getBundleName() {
     return DEFAULT_SERVER_BUNDLE_NAME;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
index 1624943..55c1194 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -98,7 +98,7 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler {
     convertToHttp(response, odResponse);
   }
 
-  private Map<String, String> createEnvironmentVariablesMap(HttpServletRequest request) {
+  private Map<String, String> createEnvironmentVariablesMap(final HttpServletRequest request) {
     Map<String, String> environment = new LinkedHashMap<String, String>();
     environment.put("authType", request.getAuthType());
     environment.put("localAddr", request.getLocalAddr());
@@ -184,7 +184,7 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler {
     }
   }
 
-  private ODataRequest fillODataRequest(ODataRequest odRequest, final HttpServletRequest httpRequest,
+  private ODataRequest fillODataRequest(final ODataRequest odRequest, final HttpServletRequest httpRequest,
       final int split) throws ODataLibraryException {
     final int requestHandle = debugger.startRuntimeMeasurement("ODataHttpHandlerImpl", "fillODataRequest");
     try {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
index ad7d410..4c2642c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -139,9 +139,9 @@ public class ODataImpl extends OData {
   }
 
   @Override
-  public DebugResponseHelper createDebugResponseHelper(String debugFormat) {
-    //TODO: What should we do with invalid formats?
-    //TODO: Support more debug formats
+  public DebugResponseHelper createDebugResponseHelper(final String debugFormat) {
+    // TODO: What should we do with invalid formats?
+    // TODO: Support more debug formats
     return new DebugResponseHelperImpl(debugFormat);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java
index 4e99d31..f5aec43 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/RedirectProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java
index 9fb080b..4f07af0 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -38,8 +38,8 @@ public class ServiceMetadataImpl implements ServiceMetadata {
   private final List<EdmxReference> references;
   private final ServiceMetadataETagSupport serviceMetadataETagSupport;
 
-  public ServiceMetadataImpl(CsdlEdmProvider edmProvider, List<EdmxReference> references,
-      ServiceMetadataETagSupport serviceMetadataETagSupport) {
+  public ServiceMetadataImpl(final CsdlEdmProvider edmProvider, final List<EdmxReference> references,
+      final ServiceMetadataETagSupport serviceMetadataETagSupport) {
     edm = new EdmProviderImpl(edmProvider);
     this.references = new ArrayList<EdmxReference>();
     this.references.addAll(references);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java
index 9bb042d..9fe52c8 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchFacadeImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -40,13 +40,13 @@ public class BatchFacadeImpl implements BatchFacade {
 
   @Override
   public ODataResponse handleODataRequest(final ODataRequest request) throws ODataApplicationException,
-      ODataLibraryException {
+  ODataLibraryException {
     return partHandler.handleODataRequest(request);
   }
 
   @Override
   public ODataResponsePart handleBatchRequest(final BatchRequestPart request) throws ODataApplicationException,
-      ODataLibraryException {
+  ODataLibraryException {
     return partHandler.handleBatchRequest(request);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
index 18cc69b..ca253dc 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java
index 653fd5f..712ff3e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchPartHandler.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -84,7 +84,7 @@ public class BatchPartHandler {
   }
 
   private ODataResponsePart handleChangeSet(final BatchRequestPart request) throws ODataApplicationException,
-      ODataLibraryException {
+  ODataLibraryException {
     return batchProcessor.processChangeSet(batchFacade, request.getRequests());
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java
index a05b1e9..c4f8d59 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java
index 3fc797b..5ee63b8 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -52,7 +52,7 @@ public class DebugResponseHelperImpl implements DebugResponseHelper {
 
   private final DebugFormat requestedFormat;
 
-  public DebugResponseHelperImpl(String debugFormat) {
+  public DebugResponseHelperImpl(final String debugFormat) {
     if (DebugSupport.ODATA_DEBUG_HTML.equals(debugFormat)) {
       requestedFormat = DebugFormat.HTML;
     } else if (DebugSupport.ODATA_DEBUG_DOWNLOAD.equals(debugFormat)) {
@@ -181,7 +181,7 @@ public class DebugResponseHelperImpl implements DebugResponseHelper {
   }
 
   /**
-   * Gets version field information for response.  Result is never null.
+   * Gets version field information for response. Result is never null.
    * @return version field information
    */
   protected static String getVersion() {
@@ -196,61 +196,61 @@ public class DebugResponseHelperImpl implements DebugResponseHelper {
     StringWriter writer = new StringWriter();
 
     writer.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n")
-        .append("  \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n")
-        .append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n")
-        .append("<head>\n")
-        .append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n")
-        .append("<title>")
-        .append(escapeHtml(title))
-        .append("</title>\n")
-        .append("<style type=\"text/css\">\n")
-        .append("body { font-family: Arial, sans-serif; font-size: 13px;\n")
-        .append("       line-height: 16px; margin: 0;\n")
-        .append("       background-color: #eeeeee; color: #333333; }\n")
-        .append(".header { float: left; }\n")
-        .append(".header a { line-height: 22px; padding: 10px 18px;\n")
-        .append("            text-decoration: none; color: #333333; }\n")
-        .append(":target, .header:nth-last-child(2) { background-color: #cccccc; }\n")
-        .append(":target ~ .header:nth-last-child(2) { background-color: inherit; }\n")
-        .append(".header:focus, .header:hover,\n")
-        .append("  .header:nth-last-child(2):focus, .header:nth-last-child(2):hover\n")
-        .append("    { background-color: #999999; }\n")
-        .append(".section { position: absolute; top: 42px; min-width: 100%;\n")
-        .append("           padding-top: 18px; border-top: 1px solid #dddddd; }\n")
-        .append(".section > * { margin-left: 18px; }\n")
-        .append(":target + .section, .section:last-child { display: block; }\n")
-        .append(".section, :target + .section ~ .section { display: none; }\n")
-        .append("h1 { font-size: 18px; font-weight: normal; margin: 10px 0; }\n")
-        .append("h2 { font-size: 15px; }\n")
-        .append("h2:not(:first-child) { margin-top: 2em; }\n")
-        .append("table { border-collapse: collapse; border-spacing: 0;\n")
-        .append("        margin-top: 1.5em; }\n")
-        .append("table, thead { border-width: 1px 0; border-style: solid;\n")
-        .append("               border-color: #dddddd; text-align: left; }\n")
-        .append("th.name, td.name { padding: 1ex 2em 1ex 0; }\n")
-        .append("tbody > tr:hover { background-color: #cccccc; }\n")
-        .append(".code { font-family: \"Courier New\", monospace; }\n")
-        .append(".code, .tree li { line-height: 15px; }\n")
-        .append("ul, .tree { padding-left: 0; list-style-type: none; }\n")
-        .append(".null, .numeric { padding-left: 1.5em; }\n")
-        .append(".json { white-space: pre-wrap; }\n")
-        .append("</style>\n")
-        .append("</head>\n")
-        .append("<body>\n");
+    .append("  \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n")
+    .append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n")
+    .append("<head>\n")
+    .append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n")
+    .append("<title>")
+    .append(escapeHtml(title))
+    .append("</title>\n")
+    .append("<style type=\"text/css\">\n")
+    .append("body { font-family: Arial, sans-serif; font-size: 13px;\n")
+    .append("       line-height: 16px; margin: 0;\n")
+    .append("       background-color: #eeeeee; color: #333333; }\n")
+    .append(".header { float: left; }\n")
+    .append(".header a { line-height: 22px; padding: 10px 18px;\n")
+    .append("            text-decoration: none; color: #333333; }\n")
+    .append(":target, .header:nth-last-child(2) { background-color: #cccccc; }\n")
+    .append(":target ~ .header:nth-last-child(2) { background-color: inherit; }\n")
+    .append(".header:focus, .header:hover,\n")
+    .append("  .header:nth-last-child(2):focus, .header:nth-last-child(2):hover\n")
+    .append("    { background-color: #999999; }\n")
+    .append(".section { position: absolute; top: 42px; min-width: 100%;\n")
+    .append("           padding-top: 18px; border-top: 1px solid #dddddd; }\n")
+    .append(".section > * { margin-left: 18px; }\n")
+    .append(":target + .section, .section:last-child { display: block; }\n")
+    .append(".section, :target + .section ~ .section { display: none; }\n")
+    .append("h1 { font-size: 18px; font-weight: normal; margin: 10px 0; }\n")
+    .append("h2 { font-size: 15px; }\n")
+    .append("h2:not(:first-child) { margin-top: 2em; }\n")
+    .append("table { border-collapse: collapse; border-spacing: 0;\n")
+    .append("        margin-top: 1.5em; }\n")
+    .append("table, thead { border-width: 1px 0; border-style: solid;\n")
+    .append("               border-color: #dddddd; text-align: left; }\n")
+    .append("th.name, td.name { padding: 1ex 2em 1ex 0; }\n")
+    .append("tbody > tr:hover { background-color: #cccccc; }\n")
+    .append(".code { font-family: \"Courier New\", monospace; }\n")
+    .append(".code, .tree li { line-height: 15px; }\n")
+    .append("ul, .tree { padding-left: 0; list-style-type: none; }\n")
+    .append(".null, .numeric { padding-left: 1.5em; }\n")
+    .append(".json { white-space: pre-wrap; }\n")
+    .append("</style>\n")
+    .append("</head>\n")
+    .append("<body>\n");
     char count = '0';
     for (final DebugTab part : parts) {
       writer.append("<div class=\"header\" id=\"sec").append(++count).append("\">\n")
-          .append("<h1><a href=\"#sec").append(count).append("\">")
-          .append(part.getName())
-          .append("</a></h1>\n")
-          .append("</div>\n")
-          .append("<div class=\"section\">\n");
+      .append("<h1><a href=\"#sec").append(count).append("\">")
+      .append(part.getName())
+      .append("</a></h1>\n")
+      .append("</div>\n")
+      .append("<div class=\"section\">\n");
       part.appendHtml(writer);
       writer.append("</div>\n");
     }
     writer.append("</body>\n")
-        .append("</html>\n")
-        .close();
+    .append("</html>\n")
+    .close();
     byte[] bytes = writer.toString().getBytes("UTF-8");
     return new ByteArrayInputStream(bytes);
   }
@@ -259,7 +259,7 @@ public class DebugResponseHelperImpl implements DebugResponseHelper {
     return value == null ? null : value.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;");
   }
 
-  protected static void appendJsonTable(JsonGenerator gen, final Map<String, String> entries)
+  protected static void appendJsonTable(final JsonGenerator gen, final Map<String, String> entries)
       throws IOException {
     if (entries == null || entries.isEmpty()) {
       gen.writeNull();
@@ -277,16 +277,16 @@ public class DebugResponseHelperImpl implements DebugResponseHelper {
     }
   }
 
-  protected static void appendHtmlTable(Writer writer, final Map<String, String> entries) throws IOException {
+  protected static void appendHtmlTable(final Writer writer, final Map<String, String> entries) throws IOException {
     writer.append("<table>\n<thead>\n")
-        .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n")
-        .append("</thead>\n<tbody>\n");
+    .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n")
+    .append("</thead>\n<tbody>\n");
     if (entries != null && !entries.isEmpty()) {
       for (final String name : entries.keySet()) {
         writer.append("<tr><td class=\"name\">").append(name).append("</td>")
-            .append("<td class=\"value\">")
-            .append(escapeHtml(entries.get(name)))
-            .append("</td></tr>\n");
+        .append("<td class=\"value\">")
+        .append(escapeHtml(entries.get(name)))
+        .append("</td></tr>\n");
       }
     }
     writer.append("</tbody>\n</table>\n");

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java
index 76384b0..ede8f98 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTab.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,7 +23,6 @@ import java.io.Writer;
 
 import com.fasterxml.jackson.core.JsonGenerator;
 
-
 /**
  * Debug information.
  */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java
index c75b6f6..b0c5314 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabBody.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -70,7 +70,7 @@ public class DebugTabBody implements DebugTab {
     return "Body";
   }
 
-//
+  //
   @Override
   public void appendJson(final JsonGenerator gen) throws IOException {
     if (response == null || response.getContent() == null) {
@@ -118,8 +118,8 @@ public class DebugTabBody implements DebugTab {
       break;
     case IMAGE:
       writer.append("<img src=\"data:").append(response.getHeader(HttpHeader.CONTENT_TYPE)).append(";base64,")
-          .append(body)
-          .append("\" />\n");
+      .append(body)
+      .append("\" />\n");
       break;
     case TEXT:
     default:
@@ -130,7 +130,7 @@ public class DebugTabBody implements DebugTab {
     }
   }
 
-  private byte[] streamToBytes(InputStream input) {
+  private byte[] streamToBytes(final InputStream input) {
     if (input != null) {
       try {
         return new FixedFormatDeserializerImpl().binary(input);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java
index 4f9bc5c..e208417 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRequest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -39,7 +39,7 @@ public class DebugTabRequest implements DebugTab {
   private final String protocol;
   private final Map<String, List<String>> headers;
 
-  public DebugTabRequest(ODataRequest request) {
+  public DebugTabRequest(final ODataRequest request) {
     if (request != null) {
       method = request.getMethod() == null ? UNKOWN_MSG : request.getMethod().toString();
       uri = request.getRawRequestUri() == null ? UNKOWN_MSG : request.getRawRequestUri();
@@ -56,24 +56,24 @@ public class DebugTabRequest implements DebugTab {
   @Override
   public void appendHtml(final Writer writer) throws IOException {
     writer.append("<h2>Request Method</h2>\n")
-        .append("<p>").append(method).append("</p>\n")
-        .append("<h2>Request URI</h2>\n")
-        .append("<p>").append(DebugResponseHelperImpl.escapeHtml(uri)).append("</p>\n")
-        .append("<h2>Request Protocol</h2>\n")
-        .append("<p>").append(DebugResponseHelperImpl.escapeHtml(protocol)).append("</p>\n");
+    .append("<p>").append(method).append("</p>\n")
+    .append("<h2>Request URI</h2>\n")
+    .append("<p>").append(DebugResponseHelperImpl.escapeHtml(uri)).append("</p>\n")
+    .append("<h2>Request Protocol</h2>\n")
+    .append("<p>").append(DebugResponseHelperImpl.escapeHtml(protocol)).append("</p>\n");
     writer.append("<h2>Request Headers</h2>\n");
 
     writer.append("<table>\n<thead>\n")
-        .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n")
-        .append("</thead>\n<tbody>\n");
+    .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n")
+    .append("</thead>\n<tbody>\n");
     for (final Map.Entry<String, List<String>> entry : headers.entrySet()) {
       List<String> headersList = entry.getValue();
       if (headersList != null && !headersList.isEmpty()) {
         for (String headerValue : headersList) {
           writer.append("<tr><td class=\"name\">").append(entry.getKey()).append("</td>")
-              .append("<td class=\"value\">")
-              .append(DebugResponseHelperImpl.escapeHtml(headerValue))
-              .append("</td></tr>\n");
+          .append("<td class=\"value\">")
+          .append(DebugResponseHelperImpl.escapeHtml(headerValue))
+          .append("</td></tr>\n");
         }
       }
     }
@@ -86,7 +86,7 @@ public class DebugTabRequest implements DebugTab {
   }
 
   @Override
-  public void appendJson(JsonGenerator gen) throws IOException {
+  public void appendJson(final JsonGenerator gen) throws IOException {
     gen.writeStartObject();
     gen.writeStringField("method", method);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java
index 12ffc00..03ae262 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -40,7 +40,7 @@ public class DebugTabResponse implements DebugTab {
   private final Map<String, List<String>> headers;
 
   public DebugTabResponse(final ODataResponse applicationResponse) {
-    this.response = applicationResponse;
+    response = applicationResponse;
     if (response != null) {
       status = HttpStatusCode.fromStatusCode(response.getStatusCode());
       headers = response.getAllHeaders();
@@ -82,7 +82,7 @@ public class DebugTabResponse implements DebugTab {
     gen.writeEndObject();
   }
 
-  private Map<String, String> map(Map<String, List<String>> headers) {
+  private Map<String, String> map(final Map<String, List<String>> headers) {
     Map<String, String> result = new HashMap<String, String>();
     for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
       if (entry.getValue().size() == 1) {
@@ -97,9 +97,9 @@ public class DebugTabResponse implements DebugTab {
   @Override
   public void appendHtml(final Writer writer) throws IOException {
     writer.append("<h2>Status Code</h2>\n")
-        .append("<p>").append(Integer.toString(status.getStatusCode())).append(' ')
-        .append(status.getInfo()).append("</p>\n")
-        .append("<h2>Response Headers</h2>\n");
+    .append("<p>").append(Integer.toString(status.getStatusCode())).append(' ')
+    .append(status.getInfo()).append("</p>\n")
+    .append("<h2>Response Headers</h2>\n");
     DebugResponseHelperImpl.appendHtmlTable(writer, map(headers));
     writer.append("<h2>Response Body</h2>\n");
     if (response != null && response.getContent() != null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java
index 757a8b3..5737646 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,7 +35,7 @@ public class DebugTabRuntime implements DebugTab {
 
   private final RuntimeNode rootNode;
 
-  public DebugTabRuntime(List<RuntimeMeasurement> runtimeInformation) {
+  public DebugTabRuntime(final List<RuntimeMeasurement> runtimeInformation) {
     rootNode = new RuntimeNode();
     for (final RuntimeMeasurement runtimeMeasurement : runtimeInformation) {
       rootNode.add(runtimeMeasurement);
@@ -49,11 +49,11 @@ public class DebugTabRuntime implements DebugTab {
   }
 
   @Override
-  public void appendJson(JsonGenerator gen) throws IOException {
+  public void appendJson(final JsonGenerator gen) throws IOException {
     appendJsonChildren(gen, rootNode);
   }
 
-  private void appendJsonChildren(JsonGenerator gen, RuntimeNode node) throws IOException {
+  private void appendJsonChildren(final JsonGenerator gen, final RuntimeNode node) throws IOException {
     gen.writeStartArray();
     for (RuntimeNode child : node.children) {
       appendJsonNode(gen, child);
@@ -61,7 +61,7 @@ public class DebugTabRuntime implements DebugTab {
     gen.writeEndArray();
   }
 
-  private void appendJsonNode(JsonGenerator gen, RuntimeNode node) throws IOException {
+  private void appendJsonNode(final JsonGenerator gen, final RuntimeNode node) throws IOException {
     gen.writeStartObject();
     gen.writeStringField("class", node.className);
     gen.writeStringField("method ", node.methodName);
@@ -90,25 +90,25 @@ public class DebugTabRuntime implements DebugTab {
       throws IOException {
     if (node.className != null) {
       writer.append("<li>\n")
-          .append("<span class=\"code\">")
-          .append("<span class=\"draw\">").append(draw)
-          .append(isLast ? "&#x2514;" : "&#x251C;").append("&#x2500;&nbsp;</span>")
-          .append("<span class=\"class\">").append(node.className).append("</span>.")
-          .append("<span class=\"method\">").append(node.methodName).append("(&hellip;)")
-          .append("</span></span>");
+      .append("<span class=\"code\">")
+      .append("<span class=\"draw\">").append(draw)
+      .append(isLast ? "&#x2514;" : "&#x251C;").append("&#x2500;&nbsp;</span>")
+      .append("<span class=\"class\">").append(node.className).append("</span>.")
+      .append("<span class=\"method\">").append(node.methodName).append("(&hellip;)")
+      .append("</span></span>");
       long time = node.timeStopped == 0 ? 0 : (node.timeStopped - node.timeStarted) / 1000;
       writer.append("<span class=\"").append(time == 0 ? "null" : "numeric")
-          .append("\" title=\"").append(time == 0 ? "Stop time missing" : "Gross duration")
-          .append("\">").append(time == 0 ? "unfinished" : Long.toString(time) + "&nbsp;&micro;s")
-          .append("</span>\n");
+      .append("\" title=\"").append(time == 0 ? "Stop time missing" : "Gross duration")
+      .append("\">").append(time == 0 ? "unfinished" : Long.toString(time) + "&nbsp;&micro;s")
+      .append("</span>\n");
     }
     if (!node.children.isEmpty()) {
       writer.append("<ol class=\"tree\">\n");
       for (final RuntimeNode childNode : node.children) {
         appendRuntimeNode(childNode,
             node.className == null ? draw : draw + (isLast ? "&nbsp;" : "&#x2502;") + "&nbsp;&nbsp;",
-            node.children.indexOf(childNode) == node.children.size() - 1,
-            writer);
+                node.children.indexOf(childNode) == node.children.size() - 1,
+                writer);
       }
       writer.append("</ol>\n");
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java
index 1601075..9c76246 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabServer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -31,7 +31,7 @@ public class DebugTabServer implements DebugTab {
 
   private final Map<String, String> serverEnvironmentVariables;
 
-  public DebugTabServer(Map<String, String> serverEnvironmentVariables) {
+  public DebugTabServer(final Map<String, String> serverEnvironmentVariables) {
     this.serverEnvironmentVariables = serverEnvironmentVariables;
   }
 
@@ -41,15 +41,15 @@ public class DebugTabServer implements DebugTab {
   }
 
   @Override
-  public void appendJson(JsonGenerator gen) throws IOException {
+  public void appendJson(final JsonGenerator gen) throws IOException {
     DebugResponseHelperImpl.appendJsonTable(gen, serverEnvironmentVariables);
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     writer.append("<h2>Library Version</h2>\n")
-        .append("<p>").append(DebugResponseHelperImpl.getVersion()).append("</p>\n")
-        .append("<h2>Server Environment</h2>\n");
+    .append("<p>").append(DebugResponseHelperImpl.getVersion()).append("</p>\n")
+    .append("<h2>Server Environment</h2>\n");
     DebugResponseHelperImpl.appendHtmlTable(writer, serverEnvironmentVariables);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java
index 0d79e85..3cc94b6 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabStacktrace.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -110,9 +110,9 @@ public class DebugTabStacktrace implements DebugTab {
     }
     final StackTraceElement details = throwable.getStackTrace()[0];
     writer.append("<h2>").append(throwable.getClass().getCanonicalName()).append("</h2>\n")
-        .append("<p>")
-        .append(DebugResponseHelperImpl.escapeHtml(getMessageText(throwable)))
-        .append("</p>\n");
+    .append("<p>")
+    .append(DebugResponseHelperImpl.escapeHtml(getMessageText(throwable)))
+    .append("</p>\n");
     appendStackTraceElement(details, true, true, writer);
   }
 
@@ -120,15 +120,15 @@ public class DebugTabStacktrace implements DebugTab {
       final boolean isFirst, final boolean isLast, final Writer writer) throws IOException {
     if (isFirst) {
       writer.append("<table>\n<thead>\n")
-          .append("<tr>\n<th class=\"name\">Class</th>\n")
-          .append("<th class=\"name\">Method</th>\n")
-          .append("<th class=\"value\">Line number in class</th>\n</tr>\n")
-          .append("</thead>\n<tbody>\n");
+      .append("<tr>\n<th class=\"name\">Class</th>\n")
+      .append("<th class=\"name\">Method</th>\n")
+      .append("<th class=\"value\">Line number in class</th>\n</tr>\n")
+      .append("</thead>\n<tbody>\n");
     }
     writer.append("<tr>\n<td class=\"name\">").append(stackTraceElement.getClassName()).append("</td>\n")
-        .append("<td class=\"name\">").append(stackTraceElement.getMethodName()).append("</td>\n")
-        .append("<td class=\"value\">").append(Integer.toString(stackTraceElement.getLineNumber()))
-        .append("</td>\n</tr>\n");
+    .append("<td class=\"name\">").append(stackTraceElement.getMethodName()).append("</td>\n")
+    .append("<td class=\"value\">").append(Integer.toString(stackTraceElement.getLineNumber()))
+    .append("</td>\n</tr>\n");
     if (isLast) {
       writer.append("</tbody>\n</table>\n");
     }


[29/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] URI parser shall not ignore empty path segments

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
new file mode 100644
index 0000000..fa7a0df
--- /dev/null
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestUriParserImpl.java
@@ -0,0 +1,1046 @@
+/*
+ * 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.core.uri.parser;
+
+import java.util.Arrays;
+import java.util.Collections;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.edmx.EdmxReference;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriResourceKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
+import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
+import org.apache.olingo.server.core.uri.testutil.FilterValidator;
+import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
+import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
+import org.apache.olingo.server.tecsvc.provider.ActionProvider;
+import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.ContainerProvider;
+import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class TestUriParserImpl {
+  private final Edm edm = OData.newInstance().createServiceMetadata(
+      new EdmTechProvider(), Collections.<EdmxReference> emptyList()).getEdm();
+  private final TestUriValidator testUri = new TestUriValidator().setEdm(edm);
+  private final ResourceValidator testRes = new ResourceValidator().setEdm(edm);
+  private final FilterValidator testFilter = new FilterValidator().setEdm(edm);
+
+  private final String PropertyBoolean = "PropertyBoolean=true";
+  private final String PropertyByte = "PropertyByte=1";
+  private final String PropertyDate = "PropertyDate=2013-09-25";
+  private final String PropertyDateTimeOffset = "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00";
+  private final String PropertyDecimal = "PropertyDecimal=12";
+  private final String PropertyDuration = "PropertyDuration=duration'P50903316DT2H25M4S'";
+  private final String PropertyGuid = "PropertyGuid=12345678-1234-1234-1234-123456789012";
+  private final String PropertyInt16 = "PropertyInt16=1";
+  private final String PropertyInt32 = "PropertyInt32=12";
+  private final String PropertyInt64 = "PropertyInt64=64";
+  private final String PropertySByte = "PropertySByte=1";
+  private final String PropertyString = "PropertyString='ABC'";
+  private final String PropertyTimeOfDay = "PropertyTimeOfDay=12:34:55";
+
+  private final String allKeys = PropertyString + "," + PropertyInt16 + "," + PropertyBoolean + "," + PropertyByte
+      + "," + PropertySByte + "," + PropertyInt32 + "," + PropertyInt64 + "," + PropertyDecimal + "," + PropertyDate
+      + "," + PropertyDateTimeOffset + "," + PropertyDuration + "," + PropertyGuid + "," + PropertyTimeOfDay;
+
+  @Test
+  public void boundFunctionImport_VarParameters() {
+    // no input
+    testRes.run("ESKeyNav(1)/olingo.odata.test1.BFCETKeyNavRTETKeyNav()")
+    .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
+    .at(1).isUriPathInfoKind(UriResourceKind.function);
+
+    // one input
+    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')")
+    .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
+    .at(1).isUriPathInfoKind(UriResourceKind.function)
+    .isParameter(0, "ParameterString", "'ABC'");
+
+    // two input
+    testRes.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
+    .at(0)
+    .isUriPathInfoKind(UriResourceKind.function)
+    .isParameter(0, "ParameterInt16", "1")
+    .isParameter(1, "ParameterString", "'2'");
+  }
+
+  @Test
+  public void functionBound_varReturnType() {
+    final String esTwoKeyNav = "ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')";
+
+    // returning primitive
+    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()")
+    .at(0)
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+    .at(1)
+    .isUriPathInfoKind(UriResourceKind.function)
+    .isType(PropertyProvider.nameString, false);
+
+    // returning collection of primitive
+    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()")
+    .at(0)
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+    .at(1)
+    .isUriPathInfoKind(UriResourceKind.function)
+    .isType(PropertyProvider.nameString, true);
+
+    // returning single complex
+    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()")
+    .at(0)
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+    .at(1)
+    .isUriPathInfoKind(UriResourceKind.function)
+    .isType(ComplexTypeProvider.nameCTTwoPrim, false);
+
+    // returning collection of complex
+    testRes.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
+    .at(0)
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+    .at(1)
+    .isUriPathInfoKind(UriResourceKind.function)
+    .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+    // returning single entity
+    testRes.run(
+        esTwoKeyNav + "/olingo.odata.test1.ETBaseTwoKeyNav/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.function)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false);
+
+    // returning collection of entity (aka entitySet)
+    testRes.run(esTwoKeyNav + "/olingo.odata.test1.BFCSINavRTESTwoKeyNav()")
+    .at(0)
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+    .at(1)
+    .isUriPathInfoKind(UriResourceKind.function)
+    .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+  }
+
+  @Test
+  public void actionImport_VarReturnType() {
+    testRes.run(ContainerProvider.AIRT_STRING).isKind(UriInfoKind.resource)
+    .first()
+    .isActionImport(ContainerProvider.AIRT_STRING)
+    .isAction(ActionProvider.nameUARTString.getName())
+    .isType(PropertyProvider.nameString, false);
+
+    testRes.run(ContainerProvider.AIRT_COLL_STRING_TWO_PARAM).isKind(UriInfoKind.resource)
+        .first()
+        .isActionImport(ContainerProvider.AIRT_COLL_STRING_TWO_PARAM)
+        .isAction(ActionProvider.nameUARTCollStringTwoParam.getName())
+        .isType(PropertyProvider.nameString, true);
+
+    testRes.run(ContainerProvider.AIRTCT_TWO_PRIM_PARAM).isKind(UriInfoKind.resource)
+    .first()
+    .isActionImport(ContainerProvider.AIRTCT_TWO_PRIM_PARAM)
+    .isAction(ActionProvider.nameUARTCTTwoPrimParam.getName())
+    .isType(ComplexTypeProvider.nameCTTwoPrim, false);
+
+    testRes.run(ContainerProvider.AIRT_COLL_CT_TWO_PRIM_PARAM).isKind(UriInfoKind.resource)
+    .first()
+    .isActionImport(ContainerProvider.AIRT_COLL_CT_TWO_PRIM_PARAM)
+    .isAction(ActionProvider.nameUARTCollCTTwoPrimParam.getName())
+    .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+    testRes.run(ContainerProvider.AIRTET_TWO_KEY_TWO_PRIM_PARAM).isKind(UriInfoKind.resource)
+    .first()
+    .isActionImport(ContainerProvider.AIRTET_TWO_KEY_TWO_PRIM_PARAM)
+    .isAction(ActionProvider.nameUARTETTwoKeyTwoPrimParam.getName())
+    .isType(EntityTypeProvider.nameETTwoKeyTwoPrim, false);
+
+    testUri.runEx(ContainerProvider.AIRT_STRING + "/invalidElement")
+        .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
+  }
+
+  @Test
+  public void count() {
+    // count entity set
+    testRes.run("ESAllPrim/$count")
+    .at(0)
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETAllPrim, true)
+    .at(1)
+    .isUriPathInfoKind(UriResourceKind.count);
+
+    // count on collection of complex
+    testRes.run("ESKeyNav(1)/CollPropertyComp/$count")
+    .at(0)
+    .isType(EntityTypeProvider.nameETKeyNav)
+    .at(1)
+    .isType(ComplexTypeProvider.nameCTPrimComp, true)
+    .at(2)
+    .isUriPathInfoKind(UriResourceKind.count);
+
+    // count on collection of primitive
+    testRes.run("ESCollAllPrim(1)/CollPropertyString/$count")
+    .at(1)
+    .isType(PropertyProvider.nameString, true)
+    .at(2)
+    .isUriPathInfoKind(UriResourceKind.count);
+  }
+
+  @Test
+  public void crossJoin() throws Exception {
+    testUri.run("$crossjoin(ESAllKey)")
+    .isKind(UriInfoKind.crossjoin)
+    .isCrossJoinEntityList(Arrays.asList("ESAllKey"));
+
+    testUri.run("$crossjoin(ESAllKey,ESTwoPrim)")
+    .isKind(UriInfoKind.crossjoin)
+    .isCrossJoinEntityList(Arrays.asList("ESAllKey", "ESTwoPrim"));
+  }
+
+  @Test
+  public void entityFailOnValidation() throws Exception {
+    // simple entity set; with qualifiedentityTypeName; with filter
+    testUri.runEx("$entity/olingo.odata.test1.ETTwoPrim", "$filter=PropertyInt16 eq 123&$id=ESAllKey")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+  }
+
+  @Test
+  public void entity() throws Exception {
+    // simple entity set
+    testUri.run("$entity", "$id=ESAllPrim").isKind(UriInfoKind.entityId)
+    .isKind(UriInfoKind.entityId)
+    .isIdText("ESAllPrim");
+
+    // simple entity set; $format before $id
+    testUri.run("$entity", "$format=xml&$id=ETAllPrim").isKind(UriInfoKind.entityId)
+    .isFormatText("xml")
+    .isIdText("ETAllPrim");
+
+    testUri.run("$entity", "$format=xml&abc=123&$id=ESAllKey").isKind(UriInfoKind.entityId)
+    .isFormatText("xml")
+    .isCustomParameter(0, "abc", "123")
+    .isIdText("ESAllKey");
+
+    // simple entity set; $format after $id
+    testUri.run("$entity", "$id=ETAllPrim&$format=xml").isKind(UriInfoKind.entityId)
+    .isIdText("ETAllPrim")
+    .isFormatText("xml");
+
+    // simple entity set; $format and custom parameter after $id
+    testUri.run("$entity", "$id=ETAllPrim&$format=xml&abc=123").isKind(UriInfoKind.entityId)
+    .isIdText("ETAllPrim")
+    .isFormatText("xml")
+    .isCustomParameter(0, "abc", "123");
+
+    // simple entity set; $format before $id and custom parameter after $id
+    testUri.run("$entity", "$format=xml&$id=ETAllPrim&abc=123").isKind(UriInfoKind.entityId)
+    .isFormatText("xml")
+    .isIdText("ETAllPrim")
+    .isCustomParameter(0, "abc", "123");
+
+    // simple entity set; with qualifiedentityTypeName
+    testUri.run("$entity/olingo.odata.test1.ETTwoPrim", "$id=ESBase")
+    .isEntityType(EntityTypeProvider.nameETTwoPrim)
+    .isIdText("ESBase");
+
+    // simple entity set; with qualifiedentityTypeName;
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim")
+    .isEntityType(EntityTypeProvider.nameETBase)
+    .isKind(UriInfoKind.entityId)
+    .isIdText("ESTwoPrim");
+
+    // simple entity set; with qualifiedentityTypeName; with format
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$format=atom")
+    .isKind(UriInfoKind.entityId)
+    .isEntityType(EntityTypeProvider.nameETBase)
+    .isIdText("ESTwoPrim")
+    .isFormatText("atom");
+
+    // simple entity set; with qualifiedentityTypeName; with select
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$select=*")
+    .isKind(UriInfoKind.entityId)
+    .isEntityType(EntityTypeProvider.nameETBase)
+    .isIdText("ESTwoPrim")
+    .isSelectItemStar(0);
+
+    // simple entity set; with qualifiedentityTypeName; with expand
+    testUri.run("$entity/olingo.odata.test1.ETBase", "$id=ESTwoPrim&$expand=*")
+    .isKind(UriInfoKind.entityId)
+    .isEntityType(EntityTypeProvider.nameETBase)
+    .isIdText("ESTwoPrim")
+    .goExpand().first().isSegmentStar();
+  }
+
+  @Test
+  public void entitySet() throws Exception {
+    // plain entity set
+    testRes.run("ESAllPrim")
+    .isEntitySet("ESAllPrim")
+    .isType(EntityTypeProvider.nameETAllPrim);
+
+    // with one key; simple key notation
+    testRes.run("ESAllPrim(1)")
+    .isEntitySet("ESAllPrim")
+    .isType(EntityTypeProvider.nameETAllPrim)
+    .isKeyPredicate(0, "PropertyInt16", "1");
+
+    // with one key; name value key notation
+    testRes.run("ESAllPrim(PropertyInt16=1)")
+    .isEntitySet("ESAllPrim")
+    .isKeyPredicate(0, "PropertyInt16", "1");
+
+    // with two keys
+    testRes.run("ESTwoKeyTwoPrim(PropertyInt16=1,PropertyString='ABC')")
+    .isEntitySet("ESTwoKeyTwoPrim")
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .isKeyPredicate(1, "PropertyString", "'ABC'");
+
+    // with all keys
+    testRes.run("ESAllKey(" + allKeys + ")")
+    .isEntitySet("ESAllKey")
+    .isKeyPredicate(0, "PropertyString", "'ABC'")
+    .isKeyPredicate(1, "PropertyInt16", "1")
+    .isKeyPredicate(2, "PropertyBoolean", "true")
+    .isKeyPredicate(3, "PropertyByte", "1")
+    .isKeyPredicate(4, "PropertySByte", "1")
+    .isKeyPredicate(5, "PropertyInt32", "12")
+    .isKeyPredicate(6, "PropertyInt64", "64")
+    .isKeyPredicate(7, "PropertyDecimal", "12")
+    .isKeyPredicate(8, "PropertyDate", "2013-09-25")
+    .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
+    .isKeyPredicate(10, "PropertyDuration", "duration'P50903316DT2H25M4S'")
+    .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
+    .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55");
+  }
+
+  @Test
+  public void entitySet_NavigationProperty() {
+    // with navigation property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
+    .at(0)
+    .isEntitySet("ESKeyNav")
+    .isType(EntityTypeProvider.nameETKeyNav)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+    .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    // with navigation property -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
+    .at(0)
+    .isEntitySet("ESKeyNav")
+    .isType(EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+    .at(2)
+    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    // with navigation property -> navigation property -> navigation property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
+    .at(0)
+    .isEntitySet("ESKeyNav")
+    .isType(EntityTypeProvider.nameETKeyNav)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+    .isType(EntityTypeProvider.nameETTwoKeyNav)
+    .at(2)
+    .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+    .isType(EntityTypeProvider.nameETKeyNav);
+
+    // with navigation property(key)
+    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)")
+    .at(0)
+    .isEntitySet("ESKeyNav")
+    .at(1)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1");
+
+    // with navigation property(key) -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/PropertyString").at(0)
+    .at(0)
+    .isEntitySet("ESKeyNav")
+    .at(1)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(2)
+    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    // with navigation property(key) -> navigation property
+    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne")
+    .isEntitySet("ESKeyNav")
+    .at(1)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(2)
+    .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+    // with navigation property(key) -> navigation property(key)
+    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)")
+    .isEntitySet("ESKeyNav")
+    .isType(EntityTypeProvider.nameETKeyNav)
+    .at(1)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(2)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1");
+
+    // with navigation property(key) -> navigation property -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne/PropertyString")
+    .at(0)
+    .isEntitySet("ESKeyNav")
+    .isType(EntityTypeProvider.nameETKeyNav)
+    .at(1)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(2)
+    .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+    .isType(EntityTypeProvider.nameETKeyNav)
+    .at(3)
+    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    // with navigation property(key) -> navigation property(key) -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)/PropertyString")
+    .at(0)
+    .isEntitySet("ESKeyNav")
+    .isType(EntityTypeProvider.nameETKeyNav)
+    .at(1)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(2)
+    .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(3)
+    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+  }
+
+  @Test
+  public void entitySet_Property() {
+    // with property
+    testRes.run("ESAllPrim(1)/PropertyString")
+    .at(0)
+    .isEntitySet("ESAllPrim")
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    // with complex property
+    testRes.run("ESCompAllPrim(1)/PropertyComp")
+    .at(0)
+    .isEntitySet("ESCompAllPrim")
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false);
+
+    // with two properties
+    testRes.run("ESCompAllPrim(1)/PropertyComp/PropertyString")
+    .at(0)
+    .isEntitySet("ESCompAllPrim")
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTAllPrim, false)
+    .at(2)
+    .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+  }
+
+  @Test
+  public void entitySet_TypeFilter() {
+    // filter
+    testRes.run("ESTwoPrim/olingo.odata.test1.ETBase")
+    .at(0)
+    .isEntitySet("ESTwoPrim")
+    .isType(EntityTypeProvider.nameETTwoPrim, true)
+    .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+    .isTypeFilterOnEntry(null);
+
+    // filter before key predicate
+    testRes.run("ESTwoPrim/olingo.odata.test1.ETBase(PropertyInt16=1)")
+    .at(0)
+    .isEntitySet("ESTwoPrim")
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoPrim)
+    .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+    .isTypeFilterOnEntry(null)
+    .at(0)
+    .isType(EntityTypeProvider.nameETTwoPrim, false)
+    .isKeyPredicate(0, "PropertyInt16", "1");
+
+    // filter before key predicate; property of sub type
+    testRes.run("ESTwoPrim/olingo.odata.test1.ETBase(PropertyInt16=1)/AdditionalPropertyString_5")
+    .at(0)
+    .isEntitySet("ESTwoPrim")
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoPrim)
+    .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+    .isTypeFilterOnEntry(null)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isType(PropertyProvider.nameString)
+    .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false);
+
+    // filter after key predicate
+    testRes.run("ESTwoPrim(PropertyInt16=1)/olingo.odata.test1.ETBase")
+    .at(0)
+    .isEntitySet("ESTwoPrim")
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoPrim, false)
+    .isTypeFilterOnCollection(null)
+    .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
+    .isKeyPredicate(0, "PropertyInt16", "1");
+
+    // filter after key predicate; property of sub type
+    testRes.run("ESTwoPrim(PropertyInt16=1)/olingo.odata.test1.ETBase/AdditionalPropertyString_5")
+    .at(0)
+    .isEntitySet("ESTwoPrim")
+    .isUriPathInfoKind(UriResourceKind.entitySet)
+    .isType(EntityTypeProvider.nameETTwoPrim)
+    .isTypeFilterOnCollection(null)
+    .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .at(1)
+    .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false)
+    .isType(PropertyProvider.nameString);
+  }
+
+  @Test
+  public void unary() throws Exception {
+    testFilter.runOnETAllPrim("not PropertyBoolean").is("<not <PropertyBoolean>>");
+    testFilter.runOnETAllPrim("-PropertyInt16 eq PropertyInt16").is("<<- <PropertyInt16>> eq <PropertyInt16>>");
+  }
+
+  @Test
+  public void filterComplexMixedPriority() throws Exception {
+    testFilter.runOnETAllPrim("PropertyBoolean or true and false")
+        .is("<<PropertyBoolean> or <<true> and <false>>>");
+    testFilter.runOnETAllPrim("PropertyBoolean or true and PropertyInt64 eq PropertyByte")
+        .is("<<PropertyBoolean> or <<true> and <<PropertyInt64> eq <PropertyByte>>>>");
+    testFilter.runOnETAllPrim("PropertyBoolean or PropertyInt32 eq PropertyInt64 and true")
+        .is("<<PropertyBoolean> or <<<PropertyInt32> eq <PropertyInt64>> and <true>>>");
+    testFilter.runOnETAllPrim("PropertyBoolean or PropertyInt32 eq PropertyInt64 and PropertyByte eq PropertySByte")
+        .is("<<PropertyBoolean> or <<<PropertyInt32> eq <PropertyInt64>> "
+            + "and <<PropertyByte> eq <PropertySByte>>>>");
+    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyBoolean and true")
+        .is("<<<PropertyInt16> eq <PropertyInt32>> or <<PropertyBoolean> and <true>>>");
+    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyBoolean and PropertyByte eq PropertySByte")
+        .is("<<<PropertyInt16> eq <PropertyInt32>> "
+            + "or <<PropertyBoolean> and <<PropertyByte> eq <PropertySByte>>>>");
+    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 eq PropertyByte and PropertyBoolean")
+        .is("<<<PropertyInt16> eq <PropertyInt32>> "
+            + "or <<<PropertyInt64> eq <PropertyByte>> and <PropertyBoolean>>>");
+    testFilter.runOnETAllPrim("PropertyInt16 eq PropertyInt32 or PropertyInt64 eq PropertyByte "
+        + "and PropertySByte eq PropertyDecimal")
+        .is("<<<PropertyInt16> eq <PropertyInt32>> or <<<PropertyInt64> eq <PropertyByte>> "
+            + "and <<PropertySByte> eq <PropertyDecimal>>>>");
+  }
+
+  @Test
+  public void filterSimpleSameBinaryBinaryBinaryPriority() throws Exception {
+    testFilter.runOnETAllPrim("1 add 2 add 3 add 4 ge 0").isCompr("<<<< <1> add   <2>> add  <3>>  add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 add 2 add 3 div 4 ge 0").isCompr("<<<  <1> add   <2>> add <<3>   div <4>>> ge <0>>");
+    testFilter.runOnETAllPrim("1 add 2 div 3 add 4 ge 0").isCompr("<<<  <1> add  <<2>  div  <3>>> add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 add 2 div 3 div 4 ge 0").isCompr("<<   <1> add <<<2>  div  <3>>  div <4>>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 add 3 add 4 ge 0").isCompr("<<<< <1> div   <2>> add  <3>>  add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 add 3 div 4 ge 0").isCompr("<<<  <1> div   <2>> add <<3>   div <4>>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 div 3 add 4 ge 0").isCompr("<<<< <1> div   <2>> div  <3>>  add <4>> ge <0>>");
+    testFilter.runOnETAllPrim("1 div 2 div 3 div 4 ge 0").isCompr("<<<< <1> div   <2>> div  <3>>  div <4>> ge <0>>");
+  }
+
+  @Test
+  public void functionImport_VarParameters() {
+    // no input
+    testRes.run("FINRTInt16()")
+    .isFunctionImport("FINRTInt16")
+    .isFunction("UFNRTInt16")
+    .isType(PropertyProvider.nameInt16);
+
+    // one input
+    testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
+    .isFunctionImport("FICRTETTwoKeyNavParam")
+    .isFunction("UFCRTETTwoKeyNavParam")
+    .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    // two input
+    testRes.run("FICRTStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
+    .isFunctionImport("FICRTStringTwoParam")
+    .isFunction("UFCRTStringTwoParam")
+    .isType(PropertyProvider.nameString);
+  }
+
+  @Test
+  public void functionImport_VarReturning() {
+    // returning primitive
+    testRes.run("FINRTInt16()")
+    .isFunctionImport("FINRTInt16")
+    .isFunction("UFNRTInt16")
+    .isType(PropertyProvider.nameInt16, false);
+
+    // returning collection of primitive
+    testRes.run("FICRTCollStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
+    .isFunctionImport("FICRTCollStringTwoParam")
+    .isFunction("UFCRTCollStringTwoParam")
+    .isType(PropertyProvider.nameString, true);
+
+    // returning single complex
+    testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)")
+    .isFunctionImport("FICRTCTAllPrimTwoParam")
+    .isFunction("UFCRTCTAllPrimTwoParam")
+    .isType(ComplexTypeProvider.nameCTAllPrim, false);
+
+    // returning collection of complex
+    testRes.run("FICRTCollCTTwoPrim()")
+    .isFunctionImport("FICRTCollCTTwoPrim")
+    .isFunction("UFCRTCollCTTwoPrim")
+    .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+    // returning single entity
+    testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
+    .isFunctionImport("FICRTETTwoKeyNavParam")
+    .isFunction("UFCRTETTwoKeyNavParam")
+    .isType(EntityTypeProvider.nameETTwoKeyNav, false);
+
+    // returning collection of entity (aka entitySet)
+    testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)")
+    .isFunctionImport("FICRTCollESTwoKeyNavParam")
+    .isFunction("UFCRTCollETTwoKeyNavParam")
+    .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+  }
+
+  @Test
+  public void functionImportChain() {
+    // test chain; returning single complex
+    testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)/PropertyInt16")
+    .at(0)
+    .isFunctionImport("FICRTCTAllPrimTwoParam")
+    .isFunction("UFCRTCTAllPrimTwoParam")
+    .isType(ComplexTypeProvider.nameCTAllPrim, false)
+    .isParameter(0, "ParameterString", "'ABC'")
+    .isParameter(1, "ParameterInt16", "1")
+    .at(1)
+    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+    // test chains; returning single entity
+    testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/PropertyInt16")
+    .at(0)
+    .isFunctionImport("FICRTETTwoKeyNavParam")
+    .isFunction("UFCRTETTwoKeyNavParam")
+    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+    .isParameter(0, "ParameterInt16", "1")
+    .at(1)
+    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+    // test chains; returning collection of entity (aka entitySet)
+    testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')")
+    .at(0)
+    .isFunctionImport("FICRTCollESTwoKeyNavParam")
+    .isFunction("UFCRTCollETTwoKeyNavParam")
+    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+    .isParameter(0, "ParameterInt16", "1")
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .isKeyPredicate(1, "PropertyString", "'ABC'");
+
+    // test chains; returning collection of entity (aka entitySet)
+    testRes.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')/PropertyInt16")
+    .at(0)
+    .isFunctionImport("FICRTCollESTwoKeyNavParam")
+    .isFunction("UFCRTCollETTwoKeyNavParam")
+    .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+    .isParameter(0, "ParameterInt16", "1")
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .isKeyPredicate(1, "PropertyString", "'ABC'")
+    .at(1)
+    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+  }
+
+  @Test
+  public void metaData() throws Exception {
+    // Parsing the fragment may be used if a uri has to be parsed on the consumer side.
+    // On the producer side this feature is currently not supported, so the context fragment
+    // part is only available as text.
+
+    testUri.run("$metadata")
+    .isKind(UriInfoKind.metadata);
+
+    testUri.run("$metadata", "$format=atom")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom");
+
+    // with context (client usage)
+
+    testUri.run("$metadata", null, "$ref")
+    .isKind(UriInfoKind.metadata)
+    .isFragmentText("$ref");
+
+    testUri.run("$metadata", "$format=atom", "$ref")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("$ref");
+
+    testUri.run("$metadata", "$format=atom", "Collection($ref)")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("Collection($ref)");
+
+    testUri.run("$metadata", "$format=atom", "Collection(Edm.EntityType)")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("Collection(Edm.EntityType)");
+
+    testUri.run("$metadata", "$format=atom", "Collection(Edm.ComplexType)")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("Collection(Edm.ComplexType)");
+
+    testUri.run("$metadata", "$format=atom", "SINav")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("SINav");
+
+    testUri.run("$metadata", "$format=atom", "SINav/PropertyInt16")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("SINav/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavOne")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("SINav/NavPropertyETKeyNavOne");
+
+    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavMany(1)")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("SINav/NavPropertyETKeyNavMany(1)");
+
+    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavOne/PropertyInt16")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("SINav/NavPropertyETKeyNavOne/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom", "SINav/NavPropertyETKeyNavMany(1)/PropertyInt16")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("SINav/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom", "SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom",
+        "SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
+        .isKind(UriInfoKind.metadata)
+        .isFormatText("atom")
+        .isFragmentText("SINav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom", "olingo.odata.test1.ETAllKey")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("olingo.odata.test1.ETAllKey");
+
+    testUri.run("$metadata", "$format=atom", "ESTwoPrim/$deletedEntity")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESTwoPrim/$deletedEntity");
+
+    testUri.run("$metadata", "$format=atom", "ESTwoPrim/$link")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESTwoPrim/$link");
+
+    testUri.run("$metadata", "$format=atom", "ESTwoPrim/$deletedLink")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESTwoPrim/$deletedLink");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/PropertyInt16")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavOne")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavMany(1)")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom",
+        "ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
+        .isKind(UriInfoKind.metadata)
+        .isFormatText("atom")
+        .isFragmentText("ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
+
+    testUri.run(
+        "$metadata", "$format=atom", "ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
+        .isKind(UriInfoKind.metadata)
+        .isFormatText("atom")
+        .isFragmentText("ESKeyNav/olingo.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav(PropertyInt16,PropertyString)")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav(PropertyInt16,PropertyString)");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/$entity")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/$entity");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/$delta")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/$delta");
+
+    testUri.run("$metadata", "$format=atom", "ESKeyNav/(PropertyInt16,PropertyString)/$delta")
+    .isKind(UriInfoKind.metadata)
+    .isFormatText("atom")
+    .isFragmentText("ESKeyNav/(PropertyInt16,PropertyString)/$delta");
+
+  }
+
+  @Test
+  public void ref() throws Exception {
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/$ref");
+  }
+
+  @Test
+  public void singleton() {
+    // plain singleton
+    testRes.run("SINav")
+    .isSingleton("SINav")
+    .isType(EntityTypeProvider.nameETTwoKeyNav);
+  }
+
+  @Test
+  public void navigationProperty() {
+    // with navigation property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
+    .at(0).isEntitySet("ESKeyNav")
+    .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
+
+    // with navigation property -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
+    .at(0).isEntitySet("ESKeyNav")
+    .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+    .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    // with navigation property -> navigation property -> navigation property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
+    .at(0).isEntitySet("ESKeyNav")
+    .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+    .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+    // with navigation property(key)
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')")
+    .at(0).isEntitySet("ESKeyNav")
+    .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .isKeyPredicate(1, "PropertyString", "'1'");
+
+    // with navigation property(key) -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/PropertyString")
+    .at(0).isEntitySet("ESKeyNav")
+    .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .isKeyPredicate(1, "PropertyString", "'1'")
+    .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    // with navigation property(key) -> navigation property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/NavPropertyETKeyNavOne")
+    .at(0).isEntitySet("ESKeyNav")
+    .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+    .isKeyPredicate(0, "PropertyInt16", "1")
+    .isKeyPredicate(1, "PropertyString", "'1'")
+    .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+    // with navigation property(key) -> navigation property(key)
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
+        + "/NavPropertyETKeyNavMany(1)")
+        .at(0).isEntitySet("ESKeyNav")
+        .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'1'")
+        .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1");
+
+    // with navigation property(key) -> navigation property -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
+        + "/NavPropertyETKeyNavOne/PropertyString")
+        .at(0).isEntitySet("ESKeyNav")
+        .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'1'")
+        .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+        .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    // with navigation property(key) -> navigation property(key) -> property
+    testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
+        + "/NavPropertyETKeyNavMany(1)/PropertyString")
+        .at(0).isEntitySet("ESKeyNav")
+        .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'1'")
+        .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+  }
+
+  @Test
+  public void singleton_Property() {
+    // with property
+    testRes.run("SINav/PropertyInt16")
+    .at(0)
+    .isSingleton("SINav")
+    .isType(EntityTypeProvider.nameETTwoKeyNav)
+    .at(1)
+    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+    // with complex property
+    testRes.run("SINav/PropertyComp")
+    .at(0)
+    .isSingleton("SINav")
+    .isType(EntityTypeProvider.nameETTwoKeyNav)
+    .at(1)
+    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false);
+
+    // with two properties
+    testRes.run("SINav/PropertyComp/PropertyInt16")
+    .at(0)
+    .isSingleton("SINav")
+    .isType(EntityTypeProvider.nameETTwoKeyNav)
+    .at(1)
+    .isComplexProperty("PropertyComp", ComplexTypeProvider.nameCTPrimComp, false)
+    .at(2)
+    .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+  }
+
+  @Test
+  public void value() throws Exception {
+    testUri.run("ESAllPrim(1)/PropertyString/$value");
+  }
+
+  @Test
+  public void memberStartingWithCastFailOnValidation1() throws Exception {
+    // on EntityType entry
+    testUri.runEx("ESTwoKeyNav(Property16=1,PropertyString='ABC')",
+        "$filter=olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate")
+        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+  }
+
+  @Test
+  public void memberStartingWithCastFailOnValidation2() throws Exception {
+    testUri.runEx("FICRTCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')",
+        "$filter=olingo.odata.test1.CTBase/AdditionalPropString")
+        .isExSemantic(UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE);
+  }
+
+  @Test
+  public void memberStartingWithCast() throws Exception {
+    // on EntityType collection
+    testFilter.runOnETTwoKeyNav("olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate eq null")
+    .left()
+    .isMember()
+    .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
+    .at(0).isType(PropertyProvider.nameDate);
+
+    // on Complex collection
+    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')",
+        "$filter=olingo.odata.test1.CTBase/AdditionalPropString eq null")
+        .goFilter().left().isMember()
+        .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
+        .at(0).isType(PropertyProvider.nameString);
+  }
+
+  @Test
+  public void complexTypeCastFollowingAsCollection() throws Exception {
+    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString='2')/olingo.odata.test1.CTBase");
+  }
+
+  @Test
+  public void alias() throws Exception {
+    testFilter.runOnETAllPrim("PropertyInt16 eq @p1&@p1=1")
+        .is("<<PropertyInt16> eq <@p1>>");
+  }
+
+  @Test
+  public void lambda() throws Exception {
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/all(l:true)")
+        .is("<CollPropertyComp/<ALL;<true>>>");
+
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/all(x:x/PropertyInt16 eq 2)")
+        .is("<CollPropertyComp/<ALL;<<x/PropertyInt16> eq <2>>>>");
+
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/any(l:true)")
+        .is("<CollPropertyComp/<ANY;<true>>>");
+    testFilter.runOnETTwoKeyNav("CollPropertyComp/any()")
+        .is("<CollPropertyComp/<ANY;>>");
+  }
+
+  @Test
+  public void customQueryOption() throws Exception {
+    testUri.run("ESTwoKeyNav", "custom")
+        .isCustomParameter(0, "custom", "");
+    testUri.run("ESTwoKeyNav", "custom=ABC")
+        .isCustomParameter(0, "custom", "ABC");
+  }
+
+  @Test
+  @Ignore("Geo types are not supported yet.")
+  public void geo() throws Exception {
+    testFilter.runOnETAllPrim("geo.distance(PropertySByte,PropertySByte)")
+        .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")
+        .isMethod(MethodKind.GEODISTANCE, 2);
+    testFilter.runOnETAllPrim("geo.length(PropertySByte)")
+        .is("<geo.length(<PropertySByte>)>")
+        .isMethod(MethodKind.GEOLENGTH, 1);
+    testFilter.runOnETAllPrim("geo.intersects(PropertySByte,PropertySByte)")
+        .is("<geo.intersects(<PropertySByte>,<PropertySByte>)>")
+        .isMethod(MethodKind.GEOINTERSECTS, 2);
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
index db9f5be..c3d90c9 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
@@ -33,11 +33,11 @@ import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
 import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
 import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.parser.search.SearchTermImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.AliasImpl;
 import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
 import org.junit.Test;
 
-//TOOD add getKind check to all
 public class QueryOptionTest {
 
   @Test
@@ -196,6 +196,7 @@ public class QueryOptionTest {
   @Test
   public void testOrderByOptionImpl() {
     OrderByOptionImpl option = new OrderByOptionImpl();
+    assertEquals(SystemQueryOptionKind.ORDERBY, option.getKind());
 
     OrderByItemImpl order0 = new OrderByItemImpl();
     OrderByItemImpl order1 = new OrderByItemImpl();
@@ -217,14 +218,17 @@ public class QueryOptionTest {
   }
 
   @Test
-  public void testSearchOptionImpl() {
+  public void searchOptionImpl() {
     SearchOptionImpl option = new SearchOptionImpl();
     assertEquals(SystemQueryOptionKind.SEARCH, option.getKind());
-    // $search is not supported yet
+
+    final SearchTermImpl searchExpression = new SearchTermImpl("A");
+    option.setSearchExpression(searchExpression);
+    assertEquals(searchExpression, option.getSearchExpression());
   }
 
   @Test
-  public void testSelectItemImpl() {
+  public void selectItemImpl() {
     SelectItemImpl option = new SelectItemImpl();
 
     // no typed collection else case ( e.g. if not path is added)
@@ -244,7 +248,7 @@ public class QueryOptionTest {
   }
 
   @Test
-  public void testSelectOptionImpl() {
+  public void selectOptionImpl() {
     SelectOptionImpl option = new SelectOptionImpl();
     assertEquals(SystemQueryOptionKind.SELECT, option.getKind());
 


[30/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] URI parser shall not ignore empty path segments

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3295bcc0/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java
new file mode 100644
index 0000000..828be80
--- /dev/null
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/TestFullResourcePath.java
@@ -0,0 +1,5905 @@
+/*
+ * 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.core.uri.parser;
+
+import java.util.Arrays;
+import java.util.Collections;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.format.ContentType;
+import org.apache.olingo.server.api.OData;
+import org.apache.olingo.server.api.edmx.EdmxReference;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriResourceKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
+import org.apache.olingo.server.core.uri.parser.UriParserSemanticException.MessageKeys;
+import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
+import org.apache.olingo.server.core.uri.parser.search.SearchParserException;
+import org.apache.olingo.server.core.uri.testutil.FilterValidator;
+import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
+import org.apache.olingo.server.core.uri.validator.UriValidationException;
+import org.apache.olingo.server.tecsvc.provider.ActionProvider;
+import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.ContainerProvider;
+import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.EnumTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.FunctionProvider;
+import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
+import org.apache.olingo.server.tecsvc.provider.TypeDefinitionProvider;
+import org.junit.Test;
+
+public class TestFullResourcePath {
+
+  private static final OData oData = OData.newInstance();
+  private static final Edm edm = oData.createServiceMetadata(
+      new EdmTechProvider(), Collections.<EdmxReference> emptyList()).getEdm();
+  private final TestUriValidator testUri;
+  private final FilterValidator testFilter;
+
+  public TestFullResourcePath() {
+    testUri = new TestUriValidator().setEdm(edm);
+    testFilter = new FilterValidator().setEdm(edm);
+  }
+
+  @Test
+  public void enumAndTypeDefAsKey() throws Exception {
+    testUri
+        .run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',PropertyDefString='abc')")
+        .goPath()
+        .at(0)
+        .isEntitySet("ESMixEnumDefCollComp")
+        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
+        .isKeyPredicate(1, "PropertyDefString", "'abc'");
+
+    testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has Namespace1_Alias.ENString'String1'")
+        .is("<<PropertyEnumString> has <olingo.odata.test1.ENString<String1>>>");
+
+    testUri
+        .run("ESMixEnumDefCollComp(PropertyEnumString=Namespace1_Alias.ENString'String1',PropertyDefString='abc')")
+        .goPath()
+        .at(0)
+        .isEntitySet("ESMixEnumDefCollComp")
+        .isKeyPredicate(0, "PropertyEnumString", "Namespace1_Alias.ENString'String1'")
+        .isKeyPredicate(1, "PropertyDefString", "'abc'");
+  }
+
+  @Test
+  public void functionBound_varOverloading() throws Exception {
+    // on ESTwoKeyNav
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.function)
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    // with string parameter
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')").goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.function)
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    // with string parameter
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.function)
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+  }
+
+  @Test
+  public void runBfuncBnCpropCastRtEs() throws Exception {
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isComplex("PropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, false)
+        .n()
+        .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav");
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isComplex("PropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, false)
+        .n()
+        .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav")
+        .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isUriPathInfoKind(UriResourceKind.count);
+
+  }
+
+  @Test
+  public void runBfuncBnCpropCollRtEs() throws Exception {
+    testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isUriPathInfoKind(UriResourceKind.complexProperty)
+        .isComplex("CollPropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, true)
+        .n()
+        .isFunction("BFCCollCTPrimCompRTESAllPrim");
+
+    testUri
+        .run("ESKeyNav(PropertyInt16=1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isUriPathInfoKind(UriResourceKind.complexProperty)
+        .isComplex("CollPropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, true)
+        .n()
+        .isFunction("BFCCollCTPrimCompRTESAllPrim")
+        .isType(EntityTypeProvider.nameETAllPrim, true)
+        .n()
+        .isUriPathInfoKind(UriResourceKind.count);
+  }
+
+  @Test
+  public void runBfuncBnCpropRtEs() throws Exception {
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isUriPathInfoKind(UriResourceKind.complexProperty)
+        .isComplex("PropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, false)
+        .n()
+        .isFunction("BFCCTPrimCompRTESTwoKeyNav");
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isUriPathInfoKind(UriResourceKind.complexProperty)
+        .isComplex("PropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, false)
+        .n()
+        .isFunction("BFCCTPrimCompRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .n()
+        .isUriPathInfoKind(UriResourceKind.count);
+
+  }
+
+  @Test
+  public void runBfuncBnEntityRtEs() throws Exception {
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isFunction("BFCETTwoKeyNavRTESTwoKeyNav");
+  }
+
+  @Test
+  public void runBfuncBnEntityCastRtEs() throws Exception {
+    testUri
+        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+            + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
+
+    testUri
+        .run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='(''2'')')"
+            + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'(''2'')'")
+        .n()
+        .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
+  }
+
+  @Test
+  public void runBfuncBnEsCastRtEs() throws Exception {
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey");
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()"
+        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey")
+        .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+    testUri.run("ESTwoKeyNav"
+        + "/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()"
+        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+  }
+
+  @Test
+  public void runBfuncBnEsRtCprop() throws Exception {
+    testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllPrim")
+        .n()
+        .isFunction("BFNESAllPrimRTCTAllPrim")
+        .isType(ComplexTypeProvider.nameCTAllPrim);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()/olingo.odata.test1.CTBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTCTTwoPrim")
+        .isType(ComplexTypeProvider.nameCTTwoPrim, false)
+        .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase);
+  }
+
+  @Test
+  public void runBfuncBnEsRtCpropColl() throws Exception {
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
+        .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
+        .isType(ComplexTypeProvider.nameCTTwoPrim, true)
+        .n()
+        .isUriPathInfoKind(UriResourceKind.count);
+  }
+
+  @Test
+  public void runBfuncBnEsRtEntityPpNp() throws Exception {
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+        .n()
+        .isUriPathInfoKind(UriResourceKind.ref);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/NavPropertyETMediaOne/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNav")
+        .n()
+        .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
+        .n()
+        .isValue();
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+        + "/NavPropertyETTwoKeyNavOne")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNavParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+        + "/NavPropertyETTwoKeyNavOne/PropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNavParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .n()
+        .isComplex("PropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+        + "/NavPropertyETTwoKeyNavOne/PropertyComp/PropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNavParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .n()
+        .isComplex("PropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp)
+        .n()
+        .isComplex("PropertyComp")
+        .isType(ComplexTypeProvider.nameCTAllPrim);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+        + "/NavPropertyETTwoKeyNavOne/PropertyString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNavParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .n()
+        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+        + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/PropertyString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNavParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+    testUri.runEx("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(WrongParameter='1')")
+        .isExSemantic(MessageKeys.UNKNOWN_PART);
+    testUri.runEx("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString=wrong)")
+        .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+  }
+
+  @Test
+  public void runBfuncBnEsRtEntyPpNpCast() throws Exception {
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()"
+        + "/NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+    testUri
+        .run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')"
+            + "/NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETTwoBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+  }
+
+  @Test
+  public void runBfuncBnEsRtEntityPpCp() throws Exception {
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNav")
+        .n()
+        .isComplex("PropertyCompNav")
+        .isType(ComplexTypeProvider.nameCTNavFiveProp);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNav")
+        .n()
+        .isComplex("PropertyCompNav")
+        .isType(ComplexTypeProvider.nameCTNavFiveProp)
+        .n()
+        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNav")
+        .n()
+        .isComplex("PropertyCompNav")
+        .isType(ComplexTypeProvider.nameCTNavFiveProp)
+        .n()
+        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+        .n()
+        .isValue();
+
+  }
+
+  @Test
+  public void runBfuncBnEsRtEntyPpCpCast() throws Exception {
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+        + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNavParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .n()
+        .isComplex("PropertyCompTwoPrim")
+        .isType(ComplexTypeProvider.nameCTTwoPrim)
+        .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+        + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+        + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNavParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isComplex("PropertyCompTwoPrim")
+        .isType(ComplexTypeProvider.nameCTTwoPrim)
+        .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
+  }
+
+  @Test
+  public void runBfuncBnEsRtEntityPpSp() throws Exception {
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNav")
+        .n()
+        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESKeyNavRTETKeyNav")
+        .n()
+        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+        .n()
+        .isValue();
+
+  }
+
+  @Test
+  public void runBfuncBnEsRtEs() throws Exception {
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='2')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isParameter(0, "ParameterString", "'2'")
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    testUri.run("ESKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='3')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isParameter(0, "ParameterString", "'3'")
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .n()
+        .isCount();
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'");
+
+  }
+
+  @Test
+  public void runBfuncBnEsRtEsBa() throws Exception {
+
+    testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComp"
+        + "/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()/olingo.odata.test1.BAESAllPrimRTETAllPrim")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isComplex("CollPropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp)
+        .n()
+        .isFunction("BFCCollCTPrimCompRTESAllPrim")
+        .n()
+        .isAction("BAESAllPrimRTETAllPrim");
+
+  }
+
+  @Test
+  public void runBfuncBnEsRtPrim() throws Exception {
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTString");
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTString")
+        .isType(PropertyProvider.nameString)
+        .n()
+        .isValue();
+  }
+
+  @Test
+  public void runbfuncBnEsRtPrimColl() throws Exception {
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTCollString")
+        .isType(PropertyProvider.nameString, true);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isFunction("BFCESTwoKeyNavRTCollString")
+        .isType(PropertyProvider.nameString, true)
+        .n()
+        .isCount();
+  }
+
+  @Test
+  public void runBfuncBnPpropCollRtEs() throws Exception {
+    testUri.run("ESKeyNav(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+        .n()
+        .isFunction("BFCCollStringRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+
+    testUri.run("ESKeyNav(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+        .n()
+        .isFunction("BFCCollStringRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .n()
+        .isCount();
+  }
+
+  @Test
+  public void runBfuncBnPpropRtEs() throws Exception {
+
+    testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+        .n()
+        .isFunction("BFCStringRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+
+    testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+        .n()
+        .isFunction("BFCStringRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .n()
+        .isCount();
+
+    testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+        .n()
+        .isFunction("BFCStringRTESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .n()
+        .isRef();
+  }
+
+  @Test
+  public void runBfuncBnSingleRtEs() throws Exception {
+
+    testUri.run("SINav/olingo.odata.test1.BFCSINavRTESTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isSingleton("SINav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .n()
+        .isFunction("BFCSINavRTESTwoKeyNav");
+  }
+
+  @Test
+  public void runBfuncBnSingleCastRtEs() throws Exception {
+    testUri.run("SINav/olingo.odata.test1.ETBaseTwoKeyNav/olingo.odata.test1.BFCETBaseTwoKeyNavRTESBaseTwoKey()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isSingleton("SINav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isFunction("BFCETBaseTwoKeyNavRTESBaseTwoKey");
+  }
+
+  @Test
+  public void runActionBound_on_EntityEntry() throws Exception {
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isAction("BAETTwoKeyNavRTETTwoKeyNav");
+
+    testUri.run("ESKeyNav(PropertyInt16=1)/olingo.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isAction("BAETTwoKeyNavRTETTwoKeyNav");
+  }
+
+  @Test
+  public void runActionBound_on_EntityCollection() throws Exception {
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .n()
+        .isAction("BAESTwoKeyNavRTESTwoKeyNav");
+  }
+
+  @Test
+  public void runFunctionBound_on_var_Types() throws Exception {
+
+    // on primitive
+    testUri.run("ESAllPrim(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()")
+        .goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETAllPrim, false)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.primitiveProperty)
+        .isType(PropertyProvider.nameString);
+
+    // on collection of primitive
+    testUri.run("ESCollAllPrim(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()")
+        .goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETCollAllPrim, false)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.primitiveProperty)
+        .isType(PropertyProvider.nameString);
+
+    // on complex
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
+        + "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
+        .goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.complexProperty)
+        .at(2)
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    // on collection of complex
+    testUri.run("ESKeyNav(1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
+        .goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .at(1)
+        .isType(ComplexTypeProvider.nameCTPrimComp, true)
+        .at(2)
+        .isUriPathInfoKind(UriResourceKind.function)
+        .isType(EntityTypeProvider.nameETAllPrim);
+
+    // on entity
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
+        + "/olingo.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
+        .goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .at(1)
+        .isUriPathInfoKind(UriResourceKind.function)
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+    // on collection of entity
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
+        .goPath()
+        .at(0)
+        .isUriPathInfoKind(UriResourceKind.entitySet)
+        .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+        .at(1).isUriPathInfoKind(UriResourceKind.function)
+        .isType(EntityTypeProvider.nameETTwoKeyNav);
+  }
+
+  @Test
+  public void runActionBound_on_EntityCast() throws Exception {
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/olingo.odata.test1.BAETBaseTwoKeyNavRTETBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isAction("BAETBaseTwoKeyNavRTETBaseTwoKeyNav");
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav/olingo.odata.test1.BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
+        .n()
+        .isAction("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav");
+  }
+
+  @Test
+  public void crossjoin() throws Exception {
+    testUri.run("$crossjoin(ESKeyNav)")
+        .isKind(UriInfoKind.crossjoin)
+        .isCrossJoinEntityList(Arrays.asList("ESKeyNav"));
+
+    testUri.run("$crossjoin(ESKeyNav,ESTwoKeyNav)")
+        .isKind(UriInfoKind.crossjoin)
+        .isCrossJoinEntityList(Arrays.asList("ESKeyNav", "ESTwoKeyNav"));
+  }
+
+  @Test
+  public void crossjoinFilter() throws Exception {
+    testUri.run("$crossjoin(ESTwoPrim,ESMixPrimCollComp)",
+        "$filter=ESTwoPrim/PropertyString eq ESMixPrimCollComp/PropertyComp/PropertyString")
+        .goFilter()
+        .isBinary(BinaryOperatorKind.EQ)
+        .is("<<ESTwoPrim/PropertyString> eq <ESMixPrimCollComp/PropertyComp/PropertyString>>");
+  }
+
+  @Test
+  public void crossjoinError() throws Exception {
+    testUri.runEx("$crossjoin").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testUri.runEx("$crossjoin/error").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+    testUri.runEx("$crossjoin()").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testUri.runEx("$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+    testUri.runEx("$crossjoin(ESKeyNav)/$ref")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+  }
+
+  @Test
+  public void runEntityId() throws Exception {
+    testUri.run("$entity", "$id=ESKeyNav(1)")
+        .isKind(UriInfoKind.entityId)
+        .isIdText("ESKeyNav(1)");
+    testUri.run("$entity/olingo.odata.test1.ETKeyNav", "$id=ESKeyNav(1)")
+        .isKind(UriInfoKind.entityId)
+        .isEntityType(EntityTypeProvider.nameETKeyNav)
+        .isIdText("ESKeyNav(1)");
+  }
+
+  @Test
+  public void runEsName() throws Exception {
+    testUri.run("ESAllPrim")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllPrim")
+        .isType(EntityTypeProvider.nameETAllPrim, true);
+
+    testUri.run("ESAllPrim/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllPrim")
+        .isType(EntityTypeProvider.nameETAllPrim, true)
+        .n()
+        .isCount();
+  }
+
+  @Test
+  public void esNameError() {
+
+    testUri.runEx("ESAllPrim/$count/$ref").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+    testUri.runEx("ESAllPrim/$ref/$count").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+    testUri.runEx("ESAllPrim/$ref/invalid").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+    testUri.runEx("ESAllPrim/$count/invalid").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+    testUri.runEx("ESAllPrim/PropertyString").isExSemantic(MessageKeys.PROPERTY_AFTER_COLLECTION);
+    testUri.runEx("ESAllPrim(1)/whatever").isExSemantic(MessageKeys.PROPERTY_NOT_IN_TYPE);
+    testUri.runEx("ESAllPrim('1')").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+    testUri.runEx("ESAllPrim(PropertyInt16)").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testUri.runEx("ESAllPrim(PropertyInt16=)").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testUri.runEx("ESAllPrim(PropertyInt16=1,Invalid='1')").isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
+
+    testUri.runEx("ESBase/olingo.odata.test1.ETBase/PropertyInt16")
+        .isExSemantic(MessageKeys.PROPERTY_AFTER_COLLECTION);
+
+    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETBaseTwoKeyTwoPrim"
+        + "/olingo.odata.test1.ETTwoBaseTwoKeyTwoPrim")
+        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+
+    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETBaseTwoKeyTwoPrim(1)/olingo.odata.test1.ETAllKey")
+        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+
+    testUri.runEx("ETBaseTwoKeyTwoPrim(1)/olingo.odata.test1.ETBaseTwoKeyTwoPrim('1')/olingo.odata.test1.ETAllKey")
+        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+
+    testUri.runEx("ETBaseTwoKeyTwoPrim(1)/olingo.odata.test1.ETBaseTwoKeyTwoPrim"
+        + "/olingo.odata.test1.ETTwoBaseTwoKeyTwoPrim")
+        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+
+    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETBaseTwoKeyTwoPrim"
+        + "/olingo.odata.test1.ETTwoBaseTwoKeyTwoPrim(1)")
+        .isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+
+    testUri.runEx("ETBaseTwoKeyTwoPrim/olingo.odata.test1.ETAllKey").isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+    testUri.runEx("ETBaseTwoKeyTwoPrim()").isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+    testUri.runEx("ESAllNullable(1)/CollPropertyString/$value").isExSemantic(MessageKeys.ONLY_FOR_TYPED_PARTS);
+
+    testUri.runEx("ETMixPrimCollComp(1)/ComplexProperty/$value").isExSemantic(MessageKeys.RESOURCE_NOT_FOUND);
+  }
+
+  @Test
+  public void resourcePathWithApostrophe() throws Exception {
+    testUri.runEx("ESAllPrim'").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testUri.runEx("ESAllPrim'InvalidStuff").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testFilter.runOnETKeyNavEx("PropertyInt16' eq 0").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
+    testFilter.runOnETKeyNavEx("PropertyInt16 eq' 0").isExSemantic(MessageKeys.TYPES_NOT_COMPATIBLE);
+    testFilter.runOnETKeyNavEx("PropertyInt16 eq 0'")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.WRONG_VALUE_FOR_SYSTEM_QUERY_OPTION);
+    testFilter.runOnETKeyNavEx("PropertyInt16 eq 'dsd''")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+  }
+
+  @Test
+  public void runFunctionsWithKeyPredicates() throws Exception {
+    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .isParameter(1, "ParameterInt16", "1");
+
+    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16=0)")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .isParameter(1, "ParameterInt16", "1")
+        .isKeyPredicate(0, "PropertyInt16", "0");
+
+    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(0)")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .isParameter(1, "ParameterInt16", "1")
+        .isKeyPredicate(0, "PropertyInt16", "0");
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16 eq 0)")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+
+    // PropertyInt32 does not exist
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=0)")
+        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)"
+        + "(PropertyInt16=0,PropertyInt16=1)")
+        .isExValidation(UriValidationException.MessageKeys.DOUBLE_KEY_PROPERTY);
+
+    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
+        .isFunction("UFCRTCollCTTwoPrimTwoParam")
+        .isParameter(0, "ParameterString", "'1'")
+        .isParameter(1, "ParameterInt16", "1");
+
+    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16=1)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(1)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=1)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=1,PropertyInt16=2)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollESTwoKeyNavParam")
+        .isFunction("UFCRTCollETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1");
+
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='1')")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollESTwoKeyNavParam")
+        .isFunction("UFCRTCollETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'1'");
+
+    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16 eq 1)")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+
+    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1)")
+        .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
+
+    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyInt32=1,PropertyString='1')")
+        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+
+    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)()")
+        .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
+
+    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyInt32=1)")
+        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+
+    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,Unkown=1)")
+        .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+
+    testUri.run("FICRTCollString()")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollString")
+        .isFunction("UFCRTCollString");
+
+    testUri.run("FICRTString()")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTString")
+        .isFunction("UFCRTString");
+
+    testUri.runEx("FICRTCollString()(0)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
+    testUri.runEx("FICRTString()(0)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+  }
+
+  @Test
+  public void runNonComposableFunctions() throws Exception {
+    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isParameter(1, "ParameterString", "'1'");
+
+    testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')(0)")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+        .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isParameter(1, "ParameterString", "'1'");
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')(0)/PropertyInt16")
+        .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skip=1")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$top=1")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')",
+        "$filter=PropertyInt16 eq 1")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skip=1")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$count=true")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skiptoken=5")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+    testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$search=test")
+        .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+    testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()")
+        .isKind(UriInfoKind.resource)
+        .goPath().first()
+        .isEntitySet("ESAllPrim")
+        .at(1)
+        .isFunction("BFNESAllPrimRTCTAllPrim");
+
+    testUri.runEx("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()"
+        + "/PropertyString")
+        .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
+  }
+
+  @Test
+  public void runEsNameCast() throws Exception {
+    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim, true)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+
+    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(-32768)/olingo.odata.test1.ETTwoBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim, false)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+        .isKeyPredicate(0, "PropertyInt16", "-32768")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
+
+    testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase(-32768)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim, false)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
+        .isKeyPredicate(0, "PropertyInt16", "-32768");
+
+    testUri.run("ESTwoPrim/Namespace1_Alias.ETTwoBase(-32768)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim, false)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
+        .isKeyPredicate(0, "PropertyInt16", "-32768");
+
+  }
+
+  @Test
+  public void runEsNamePpSpCast() throws Exception {
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/PropertyComp/PropertyInt16")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isComplex("PropertyComp")
+        .n()
+        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+  }
+
+  @Test
+  public void runEsNameKey() throws Exception {
+    testUri.run("ESCollAllPrim(1)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESCollAllPrim");
+
+    testUri.run("ESCollAllPrim(PropertyInt16=1)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESCollAllPrim");
+
+    testUri.run("ESFourKeyAlias(PropertyInt16=1,KeyAlias1=2,KeyAlias2='3',KeyAlias3='4')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESFourKeyAlias")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "KeyAlias1", "2")
+        .isKeyPredicate(2, "KeyAlias2", "'3'")
+        .isKeyPredicate(3, "KeyAlias3", "'4'");
+
+    testUri.runEx("ESTwoPrim('wrong')").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+    testUri.runEx("ESTwoPrim(PropertyInt16='wrong')").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+  }
+
+  @Test
+  public void runEsNameParaKeys() throws Exception {
+    testUri.run("ESAllKey(PropertyString='O''Neil',PropertyBoolean=true,PropertyByte=255,"
+        + "PropertySByte=-128,PropertyInt16=-32768,PropertyInt32=-2147483648,"
+        + "PropertyInt64=-9223372036854775808,PropertyDecimal=1,PropertyDate=2013-09-25,"
+        + "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00,"
+        + "PropertyDuration=duration'P50903316DT2H25M4S',"
+        + "PropertyGuid=12345678-1234-1234-1234-123456789012,"
+        + "PropertyTimeOfDay=12:34:55)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllKey")
+        .isKeyPredicate(0, "PropertyString", "'O''Neil'")
+        .isKeyPredicate(1, "PropertyBoolean", "true")
+        .isKeyPredicate(2, "PropertyByte", "255")
+        .isKeyPredicate(3, "PropertySByte", "-128")
+        .isKeyPredicate(4, "PropertyInt16", "-32768")
+        .isKeyPredicate(5, "PropertyInt32", "-2147483648")
+        .isKeyPredicate(6, "PropertyInt64", "-9223372036854775808")
+        .isKeyPredicate(7, "PropertyDecimal", "1")
+        .isKeyPredicate(8, "PropertyDate", "2013-09-25")
+        .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
+        .isKeyPredicate(10, "PropertyDuration", "duration'P50903316DT2H25M4S'")
+        .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
+        .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55");
+  }
+
+  @Test
+  public void runEsNameKeyCast() throws Exception {
+    testUri.run("ESTwoPrim(1)/olingo.odata.test1.ETBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBase);
+
+    testUri.run("ESTwoPrim(1)/olingo.odata.test1.ETTwoBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
+
+    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(1)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+
+    testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase(1)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
+
+    testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+
+    testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoPrim")
+        .isType(EntityTypeProvider.nameETTwoPrim)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
+
+    // Keys cannot be specified twice.
+    testUri.runEx("ESTwoPrim(1)/olingo.odata.test1.ETBase(1)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+    testUri.runEx("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase(1)")
+        .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
+    testUri.runEx("ESBase/olingo.odata.test1.ETTwoPrim(1)").isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
+  }
+
+  @Test
+  public void runEsNameParaKeysCast() throws Exception {
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+    testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'");
+  }
+
+  @Test
+  public void run_EsNamePpCp() throws Exception {
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isComplex("PropertyComp");
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComp/PropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isComplex("PropertyComp")
+        .n()
+        .isComplex("PropertyComp");
+
+    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
+        + "PropertyDefString='key1')/PropertyEnumString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESMixEnumDefCollComp")
+        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
+        .isKeyPredicate(1, "PropertyDefString", "'key1'")
+        .n()
+        .isPrimitiveProperty("PropertyEnumString", EnumTypeProvider.nameENString, false);
+
+    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
+        + "PropertyDefString='key1')/PropertyDefString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESMixEnumDefCollComp")
+        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
+        .isKeyPredicate(1, "PropertyDefString", "'key1'")
+        .n()
+        .isPrimitiveProperty("PropertyDefString", TypeDefinitionProvider.nameTDString, false);
+  }
+
+  @Test
+  public void runEsNamePpCpColl() throws Exception {
+    testUri.run("ESMixPrimCollComp(5)/CollPropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESMixPrimCollComp")
+        .isKeyPredicate(0, "PropertyInt16", "5")
+        .n()
+        .isComplex("CollPropertyComp")
+        .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .n()
+        .isComplex("CollPropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, true);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComp/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+        .n()
+        .isComplex("CollPropertyComp")
+        .isType(ComplexTypeProvider.nameCTPrimComp, true)
+        .n()
+        .isCount();
+
+    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
+        + "PropertyDefString='key1')/CollPropertyEnumString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESMixEnumDefCollComp")
+        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
+        .isKeyPredicate(1, "PropertyDefString", "'key1'")
+        .n()
+        .isPrimitiveProperty("CollPropertyEnumString", EnumTypeProvider.nameENString, true);
+
+    testUri.run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',"
+        + "PropertyDefString='key1')/CollPropertyDefString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESMixEnumDefCollComp")
+        .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
+        .isKeyPredicate(1, "PropertyDefString", "'key1'")
+        .n()
+        .isPrimitiveProperty("CollPropertyDefString", TypeDefinitionProvider.nameTDString, true);
+  }
+
+  @Test
+  public void runEsNamePpCpCast() throws Exception {
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav/PropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isComplex("PropertyComp");
+
+    testUri
+        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+            + "/PropertyComp/PropertyComp")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isComplex("PropertyComp")
+        .n()
+        .isComplex("PropertyComp");
+
+    testUri
+        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+            + "/PropertyCompTwoPrim/olingo.odata.test1.CTBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isComplex("PropertyCompTwoPrim")
+        .isType(ComplexTypeProvider.nameCTTwoPrim)
+        .isTypeFilter(ComplexTypeProvider.nameCTBase);
+
+    testUri
+        .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+            + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isComplex("PropertyCompTwoPrim")
+        .isType(ComplexTypeProvider.nameCTTwoPrim)
+        .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
+  }
+
+  @Test
+  public void runNsNamePpNp() throws Exception {
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2");
+
+    testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETKeyNavMany(PropertyInt16=2)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2");
+
+    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyInt16")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .n()
+        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyCompNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .n()
+        .isComplex("PropertyCompNav");
+
+    testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/NavPropertyETKeyNavOne")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+        + "/NavPropertyETKeyNavMany(4)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "4");
+
+    testUri.run("ESKeyNav(1)/PropertyCompNav/NavPropertyETTwoKeyNavOne")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isComplex("PropertyCompNav")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='(3)')"
+        + "/PropertyComp/PropertyComp/PropertyInt16")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'(3)'")
+        .n()
+        .isComplex("PropertyComp")
+        .n()
+        .isComplex("PropertyComp")
+        .n()
+        .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETMediaMany(2)/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETMediaMany", EntityTypeProvider.nameETMedia, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .n()
+        .isValue();
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+        + "/NavPropertyETKeyNavOne/NavPropertyETMediaOne/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+        .n()
+        .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
+        .n()
+        .isValue();
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+        + "/NavPropertyETKeyNavOne/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+        .n()
+        .isRef();
+  }
+
+  @Test
+  public void runEsNamePpNpCast() throws Exception {
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/NavPropertyETKeyNavMany")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/NavPropertyETKeyNavMany(3)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "3");
+
+    testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETTwoBaseTwoKeyNav(PropertyInt16=3,PropertyString='4')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESTwoKeyNav")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "3")
+        .isKeyPredicate(1, "PropertyString", "'4'")
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+        + "/NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')"
+        + "/olingo.odata.test1.ETTwoBaseTwoKeyNav/NavPropertyETBaseTwoKeyNavMany")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "4")
+        .isKeyPredicate(1, "PropertyString", "'5'")
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
+        .n()
+        .isNavProperty("NavPropertyETBaseTwoKeyNavMany", EntityTypeProvider.nameETBaseTwoKeyNav, true);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/"
+        + "NavPropertyETTwoKeyNavMany/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')/"
+        + "NavPropertyETKeyNavMany")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "4")
+        .isKeyPredicate(1, "PropertyString", "'5'")
+        .n()
+        .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
+  }
+
+  @Test
+  public void runEsNamePpNpRc() throws Exception {
+    // checks for using referential constraints to fill missing keys
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany('2')").goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
+        .isKeyPredicate(1, "PropertyString", "'2'");
+
+    testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETTwoKeyNavMany(PropertyString='2')").goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
+        .isKeyPredicate(1, "PropertyString", "'2'");
+
+  }
+
+  @Test
+  public void runEsNamePpSp() throws Exception {
+    testUri.run("ESAllPrim(1)/PropertyByte")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllPrim")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false);
+
+    testUri.run("ESAllPrim(1)/PropertyByte/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllPrim")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false)
+        .n()
+        .isValue();
+
+    testUri.run("ESMixPrimCollComp(1)/PropertyComp/PropertyString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESMixPrimCollComp")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isComplex("PropertyComp")
+        .n()
+        .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+  }
+
+  @Test
+  public void runEsNamePpSpColl() throws Exception {
+    testUri.run("ESCollAllPrim(1)/CollPropertyString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESCollAllPrim")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .n()
+        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+        .n()
+        .isCount();
+
+  }
+
+  @Test
+  public void runEsNameRef() throws Exception {
+    testUri.run("ESAllPrim/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllPrim")
+        .n()
+        .isRef();
+
+    testUri.run("ESAllPrim(-32768)/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESAllPrim")
+        .isKeyPredicate(0, "PropertyInt16", "-32768")
+        .n()
+        .isRef();
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
+        .n()
+        .isRef();
+    testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isEntitySet("ESKeyNav")
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .n()
+        .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+        .isKeyPredicate(0, "PropertyInt16", "1")
+        .isKeyPredicate(1, "PropertyString", "'2'")
+        .n()
+        .isRef();
+  }
+
+  @Test
+  public void runFunctionImpBf() throws Exception {
+
+    testUri.run("FICRTString()/olingo.odata.test1.BFCStringRTESTwoKeyNav()");
+  }
+
+  @Test
+  public void runFunctionImpCastBf() throws Exception {
+
+    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav"
+        + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTETTwoKeyNavParam")
+        .isFunction("UFCRTETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .n()
+        .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
+
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
+        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
+        + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTCollESTwoKeyNavParam")
+        .isFunction("UFCRTCollETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'")
+        .n()
+        .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
+
+    testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString=null)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
+        .isFunction("UFCRTCollCTTwoPrimTwoParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isParameter(1, "ParameterString", null);
+  }
+
+  @Test
+  public void runFunctionImpEntity() throws Exception {
+
+    testUri.run("FICRTETKeyNav()")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTETKeyNav")
+        .isFunction("UFCRTETKeyNav")
+        .isType(EntityTypeProvider.nameETKeyNav);
+
+    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1");
+
+    testUri.run("FICRTESMedia(ParameterInt16=1)/$value")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTESMedia")
+        .isFunction("UFCRTETMedia")
+        .n()
+        .isValue();
+
+    testUri.run("FICRTETKeyNav()/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTETKeyNav")
+        .isFunction("UFCRTETKeyNav")
+        .n()
+        .isRef();
+    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/$ref")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTETTwoKeyNavParam")
+        .isFunction("UFCRTETTwoKeyNavParam")
+        .n()
+        .isRef();
+
+    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTETTwoKeyNavParam")
+        .isFunction("UFCRTETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+    testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTETTwoKeyNavParam")
+        .isFunction("UFCRTETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)"
+        + "/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTCollESTwoKeyNavParam")
+        .isFunction("UFCRTCollETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+        .isKeyPredicate(0, "PropertyInt16", "2")
+        .isKeyPredicate(1, "PropertyString", "'3'");
+  }
+
+  @Test
+  public void runFunctionImpEs() throws Exception {
+    testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+        .isFunction("UFCRTESMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isParameter(1, "ParameterString", "'2'")
+        .isType(EntityTypeProvider.nameETMixPrimCollComp);
+
+    testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+        .isFunction("UFCRTESMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isParameter(1, "ParameterString", "'2'")
+        .isType(EntityTypeProvider.nameETMixPrimCollComp);
+
+    testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+        .isFunction("UFCRTESMixPrimCollCompTwoParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isParameter(1, "ParameterString", "'2'")
+        .isType(EntityTypeProvider.nameETMixPrimCollComp)
+        .n()
+        .isCount();
+  }
+
+  @Test
+  public void runFunctionImpError() {
+    testUri.runEx("FICRTCollCTTwoPrimTwoParam")
+        .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+    testUri.runEx("FICRTCollCTTwoPrimTwoParam()").isExSemantic(MessageKeys.FUNCTION_NOT_FOUND);
+    testUri.runEx("FICRTCollCTTwoPrimTwoParam(invalidParam=2)").isExSemantic(MessageKeys.FUNCTION_NOT_FOUND);
+  }
+
+  @Test
+  public void runFunctionImpEsAlias() throws Exception {
+
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=@parameterAlias)", "@parameterAlias=1");
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=@parameterAlias)/$count", "@parameterAlias=1");
+    testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=@invalidAlias)", "@validAlias=1")
+        .isExValidation(UriValidationException.MessageKeys.MISSING_PARAMETER);
+  }
+
+  @Test
+  public void runFunctionImpEsCast() throws Exception {
+
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
+        .isKind(UriInfoKind.resource).goPath()
+        .first()
+        .isFunctionImport("FICRTCollESTwoKeyNavParam")
+        .isFunction("UFCRTCollETTwoKeyNavParam")
+        .isParameter(0, "ParameterInt16", "1")
+        .isType(EntityTypeProvider.nameETTwoKeyNav)
+        .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+    testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav/$count")

<TRUNCATED>

[48/51] [abbrv] olingo-odata4 git commit: OLINGO-854: reverting the changes from previous commit

Posted by mi...@apache.org.
OLINGO-854: reverting the changes from previous commit


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 322085df6b9bf706ffd4f37eed9ec4e304a91999
Parents: b5eae4f
Author: Ramesh Reddy <ra...@jboss.org>
Authored: Fri Jan 22 11:33:06 2016 -0600
Committer: Ramesh Reddy <ra...@jboss.org>
Committed: Fri Jan 22 11:36:29 2016 -0600

----------------------------------------------------------------------
 .../olingo/commons/core/edm/primitivetype/EdmString.java       | 6 ++----
 .../olingo/commons/core/edm/primitivetype/EdmStringTest.java   | 2 --
 2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/322085df/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
index a63010b..8e9a42a 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
@@ -21,8 +21,6 @@ package org.apache.olingo.commons.core.edm.primitivetype;
 import java.util.regex.Pattern;
 
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.core.Decoder;
-import org.apache.olingo.commons.core.Encoder;
 
 /**
  * Implementation of the EDM primitive type String.
@@ -97,11 +95,11 @@ public final class EdmString extends SingletonPrimitiveType {
       uriLiteral.append(c);
     }
     uriLiteral.append(uriSuffix);
-    return Encoder.encode(uriLiteral.toString());
+    return uriLiteral.toString();
   }
 
   @Override
   public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
-    return literal == null ? null : Decoder.decode(super.fromUriLiteral(literal).replace("''", "'"));
+    return literal == null ? null : super.fromUriLiteral(literal).replace("''", "'");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/322085df/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
index 1035e6b..b5f2a89 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
@@ -33,13 +33,11 @@ public class EdmStringTest extends PrimitiveTypeBaseTest {
     assertEquals("'StringValue'", instance.toUriLiteral("StringValue"));
     assertEquals("'String''Value'", instance.toUriLiteral("String'Value"));
     assertEquals("'String''''''Value'", instance.toUriLiteral("String'''Value"));
-    assertEquals("'ab%20cd%20'", instance.toUriLiteral("ab cd "));
   }
 
   @Test
   public void fromUriLiteral() throws Exception {
     assertEquals("String''Value", instance.fromUriLiteral("'String''''Value'"));
-    assertEquals("ab cd ", instance.fromUriLiteral("'ab%20cd%20'"));
 
     expectErrorInFromUriLiteral(instance, "");
     expectErrorInFromUriLiteral(instance, "'");


[03/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp Server API

Posted by mi...@apache.org.
[OLINGO-841] CleanUp Server API


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: d4902f725b2430aa43aeb516896e38c8c722111a
Parents: d1055fd
Author: Christian Amend <ch...@sap.com>
Authored: Fri Dec 18 13:42:53 2015 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Fri Dec 18 13:42:53 2015 +0100

----------------------------------------------------------------------
 .../apache/olingo/server/api/HttpHeaders.java   |   4 +-
 .../org/apache/olingo/server/api/OData.java     |   6 +-
 .../server/api/ODataApplicationException.java   |   4 +-
 .../olingo/server/api/ODataHttpHandler.java     |   4 +-
 .../server/api/ODataLibraryException.java       |   4 +-
 .../apache/olingo/server/api/ODataRequest.java  |   6 +-
 .../apache/olingo/server/api/ODataResponse.java |   5 +-
 .../olingo/server/api/ODataServerError.java     |   4 +-
 .../olingo/server/api/ServiceMetadata.java      |   4 +-
 .../olingo/server/api/batch/BatchFacade.java    | 106 +++++++++----------
 .../olingo/server/api/batch/package-info.java   |   4 +-
 .../server/api/debug/DebugInformation.java      |  16 +--
 .../server/api/debug/DebugResponseHelper.java   |   4 +-
 .../olingo/server/api/debug/DebugSupport.java   |   9 +-
 .../server/api/debug/DefaultDebugSupport.java   |   8 +-
 .../server/api/debug/RuntimeMeasurement.java    |  12 +--
 .../olingo/server/api/debug/package-info.java   |   4 +-
 .../api/deserializer/DeserializerException.java |   4 +-
 .../api/deserializer/DeserializerResult.java    |   4 +-
 .../deserializer/FixedFormatDeserializer.java   |  12 +--
 .../api/deserializer/ODataDeserializer.java     |  10 +-
 .../batch/BatchDeserializerException.java       |  14 +--
 .../api/deserializer/batch/BatchOptions.java    |   8 +-
 .../deserializer/batch/BatchRequestPart.java    |   4 +-
 .../deserializer/batch/ODataResponsePart.java   |   8 +-
 .../api/deserializer/batch/package-info.java    |   4 +-
 .../server/api/deserializer/package-info.java   |   4 +-
 .../server/api/etag/CustomETagSupport.java      |   4 +-
 .../olingo/server/api/etag/ETagHelper.java      |  22 ++--
 .../server/api/etag/PreconditionException.java  |   4 +-
 .../api/etag/ServiceMetadataETagSupport.java    |   6 +-
 .../olingo/server/api/etag/package-info.java    |   4 +-
 .../apache/olingo/server/api/package-info.java  |   4 +-
 .../olingo/server/api/prefer/Preferences.java   |  13 ++-
 .../server/api/prefer/PreferencesApplied.java   |  16 +--
 .../olingo/server/api/prefer/package-info.java  |   4 +-
 .../ActionComplexCollectionProcessor.java       |   4 +-
 .../api/processor/ActionComplexProcessor.java   |   4 +-
 .../ActionEntityCollectionProcessor.java        |   4 +-
 .../api/processor/ActionEntityProcessor.java    |   4 +-
 .../ActionPrimitiveCollectionProcessor.java     |   4 +-
 .../api/processor/ActionPrimitiveProcessor.java |   4 +-
 .../api/processor/ActionVoidProcessor.java      |   4 +-
 .../server/api/processor/BatchProcessor.java    |   4 +-
 .../processor/ComplexCollectionProcessor.java   |   4 +-
 .../server/api/processor/ComplexProcessor.java  |   4 +-
 .../CountComplexCollectionProcessor.java        |   4 +-
 .../CountEntityCollectionProcessor.java         |   4 +-
 .../CountPrimitiveCollectionProcessor.java      |   4 +-
 .../server/api/processor/DefaultProcessor.java  |   4 +-
 .../server/api/processor/DeltaProcessor.java    |  30 +++---
 .../processor/EntityCollectionProcessor.java    |   4 +-
 .../server/api/processor/EntityProcessor.java   |   6 +-
 .../server/api/processor/ErrorProcessor.java    |   6 +-
 .../api/processor/MediaEntityProcessor.java     |   4 +-
 .../server/api/processor/MetadataProcessor.java |   4 +-
 .../processor/PrimitiveCollectionProcessor.java |   4 +-
 .../api/processor/PrimitiveProcessor.java       |   6 +-
 .../api/processor/PrimitiveValueProcessor.java  |   6 +-
 .../olingo/server/api/processor/Processor.java  |   4 +-
 .../processor/ReferenceCollectionProcessor.java |   4 +-
 .../api/processor/ReferenceProcessor.java       |   4 +-
 .../api/processor/ServiceDocumentProcessor.java |   4 +-
 .../server/api/processor/package-info.java      |   5 +-
 .../serializer/BatchSerializerException.java    |   7 +-
 .../serializer/ComplexSerializerOptions.java    |  10 +-
 .../serializer/CustomContentTypeSupport.java    |   4 +-
 .../EntityCollectionSerializerOptions.java      |   8 +-
 .../api/serializer/EntitySerializerOptions.java |   8 +-
 .../api/serializer/FixedFormatSerializer.java   |   6 +-
 .../server/api/serializer/ODataSerializer.java  |  52 ++++-----
 .../serializer/PrimitiveSerializerOptions.java  |  10 +-
 .../PrimitiveValueSerializerOptions.java        |   4 +-
 .../ReferenceCollectionSerializerOptions.java   |  12 +--
 .../serializer/ReferenceSerializerOptions.java  |   4 +-
 .../api/serializer/RepresentationType.java      |   4 +-
 .../api/serializer/SerializerException.java     |   4 +-
 .../server/api/serializer/SerializerResult.java |   4 +-
 .../server/api/serializer/package-info.java     |   4 +-
 .../apache/olingo/server/api/uri/UriHelper.java |  10 +-
 .../apache/olingo/server/api/uri/UriInfo.java   |   6 +-
 .../olingo/server/api/uri/UriInfoAll.java       |   6 +-
 .../olingo/server/api/uri/UriInfoBatch.java     |   6 +-
 .../olingo/server/api/uri/UriInfoCrossjoin.java |   8 +-
 .../olingo/server/api/uri/UriInfoEntityId.java  |   4 +-
 .../olingo/server/api/uri/UriInfoKind.java      |   4 +-
 .../olingo/server/api/uri/UriInfoMetadata.java  |   4 +-
 .../olingo/server/api/uri/UriInfoResource.java  |   4 +-
 .../olingo/server/api/uri/UriInfoService.java   |   6 +-
 .../olingo/server/api/uri/UriParameter.java     |   4 +-
 .../olingo/server/api/uri/UriResource.java      |   4 +-
 .../server/api/uri/UriResourceAction.java       |   4 +-
 .../api/uri/UriResourceComplexProperty.java     |   4 +-
 .../olingo/server/api/uri/UriResourceCount.java |   6 +-
 .../server/api/uri/UriResourceEntitySet.java    |   4 +-
 .../server/api/uri/UriResourceFunction.java     |   4 +-
 .../olingo/server/api/uri/UriResourceIt.java    |   4 +-
 .../olingo/server/api/uri/UriResourceKind.java  |   4 +-
 .../server/api/uri/UriResourceLambdaAll.java    |   4 +-
 .../server/api/uri/UriResourceLambdaAny.java    |   4 +-
 .../api/uri/UriResourceLambdaVariable.java      |   4 +-
 .../server/api/uri/UriResourceNavigation.java   |   4 +-
 .../server/api/uri/UriResourcePartTyped.java    |   6 +-
 .../api/uri/UriResourcePrimitiveProperty.java   |   6 +-
 .../server/api/uri/UriResourceProperty.java     |   4 +-
 .../olingo/server/api/uri/UriResourceRef.java   |   6 +-
 .../olingo/server/api/uri/UriResourceRoot.java  |   6 +-
 .../server/api/uri/UriResourceSingleton.java    |   4 +-
 .../olingo/server/api/uri/UriResourceValue.java |   6 +-
 .../olingo/server/api/uri/package-info.java     |   6 +-
 .../api/uri/queryoption/AliasQueryOption.java   |   4 +-
 .../server/api/uri/queryoption/CountOption.java |   4 +-
 .../api/uri/queryoption/CustomQueryOption.java  |   6 +-
 .../server/api/uri/queryoption/ExpandItem.java  |   4 +-
 .../api/uri/queryoption/ExpandOption.java       |   4 +-
 .../api/uri/queryoption/FilterOption.java       |   4 +-
 .../api/uri/queryoption/FormatOption.java       |   4 +-
 .../server/api/uri/queryoption/IdOption.java    |   4 +-
 .../api/uri/queryoption/LevelsExpandOption.java |   4 +-
 .../server/api/uri/queryoption/OrderByItem.java |   4 +-
 .../api/uri/queryoption/OrderByOption.java      |   4 +-
 .../server/api/uri/queryoption/QueryOption.java |   4 +-
 .../api/uri/queryoption/SearchOption.java       |   4 +-
 .../server/api/uri/queryoption/SelectItem.java  |   4 +-
 .../api/uri/queryoption/SelectOption.java       |   4 +-
 .../server/api/uri/queryoption/SkipOption.java  |   4 +-
 .../api/uri/queryoption/SkipTokenOption.java    |   4 +-
 .../api/uri/queryoption/SystemQueryOption.java  |   4 +-
 .../uri/queryoption/SystemQueryOptionKind.java  |   4 +-
 .../server/api/uri/queryoption/TopOption.java   |   4 +-
 .../api/uri/queryoption/expression/Alias.java   |   4 +-
 .../api/uri/queryoption/expression/Binary.java  |   4 +-
 .../expression/BinaryOperatorKind.java          |   4 +-
 .../uri/queryoption/expression/Enumeration.java |   4 +-
 .../uri/queryoption/expression/Expression.java  |   6 +-
 .../expression/ExpressionVisitException.java    |   4 +-
 .../expression/ExpressionVisitor.java           |   4 +-
 .../uri/queryoption/expression/LambdaRef.java   |   4 +-
 .../api/uri/queryoption/expression/Literal.java |  10 +-
 .../api/uri/queryoption/expression/Member.java  |   4 +-
 .../api/uri/queryoption/expression/Method.java  |   4 +-
 .../uri/queryoption/expression/MethodKind.java  |   4 +-
 .../uri/queryoption/expression/TypeLiteral.java |   4 +-
 .../api/uri/queryoption/expression/Unary.java   |   4 +-
 .../expression/UnaryOperatorKind.java           |   4 +-
 .../expression/VisitableExpression.java         |   4 +-
 .../queryoption/expression/package-info.java    |   4 +-
 .../api/uri/queryoption/package-info.java       |   4 +-
 .../uri/queryoption/search/SearchBinary.java    |   4 +-
 .../search/SearchBinaryOperatorKind.java        |   4 +-
 .../queryoption/search/SearchExpression.java    |  18 ++--
 .../api/uri/queryoption/search/SearchTerm.java  |   4 +-
 .../api/uri/queryoption/search/SearchUnary.java |   5 +-
 .../search/SearchUnaryOperatorKind.java         |   4 +-
 .../uri/queryoption/search/package-info.java    |   4 +-
 .../olingo/server/api/ODataRequestTest.java     |   4 +-
 .../server/api/TranslatedExceptionsTest.java    |   4 +-
 .../api/prefer/PreferencesAppliedTest.java      |  22 ++--
 158 files changed, 517 insertions(+), 515 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/HttpHeaders.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/HttpHeaders.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/HttpHeaders.java
index cc0fd33..ff82dc0 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/HttpHeaders.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/HttpHeaders.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
index 75b2e27..8e90c57 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,10 +21,10 @@ package org.apache.olingo.server.api;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.olingo.commons.api.ex.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider;
+import org.apache.olingo.commons.api.ex.ODataRuntimeException;
 import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.server.api.debug.DebugResponseHelper;
 import org.apache.olingo.server.api.deserializer.DeserializerException;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java
index 3e92820..7105dce 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java
index a2180c8..26d14c3 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java
index f7f5dee..6c9fe05 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataRequest.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataRequest.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataRequest.java
index 21122b8..bab04a1 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataRequest.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataRequest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -226,7 +226,7 @@ public class ODataRequest {
    * @param protocol
    * @see #getProtocol()
    */
-  public void setProtocol(String protocol) {
+  public void setProtocol(final String protocol) {
     this.protocol = protocol;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataResponse.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataResponse.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataResponse.java
index 3b63af7..3644295 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataResponse.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataResponse.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -115,7 +115,6 @@ public class ODataResponse {
     return values == null || values.isEmpty() ? null : values.get(0);
   }
 
-
   /**
    * Sets the content (body).
    * @param content the content as {@link InputStream}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java
index b9c6dcb..0e6c72c 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/ServiceMetadata.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ServiceMetadata.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ServiceMetadata.java
index 91c782a..7840115 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ServiceMetadata.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ServiceMetadata.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/BatchFacade.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/BatchFacade.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/BatchFacade.java
index 72625de..3794b4d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/BatchFacade.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/BatchFacade.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,57 +17,57 @@
  * under the License.
  */package org.apache.olingo.server.api.batch;
 
-import org.apache.olingo.server.api.ODataApplicationException;
-import org.apache.olingo.server.api.ODataLibraryException;
-import org.apache.olingo.server.api.ODataRequest;
-import org.apache.olingo.server.api.ODataResponse;
-import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart;
-import org.apache.olingo.server.api.deserializer.batch.ODataResponsePart;
+ import org.apache.olingo.server.api.ODataApplicationException;
+ import org.apache.olingo.server.api.ODataLibraryException;
+ import org.apache.olingo.server.api.ODataRequest;
+ import org.apache.olingo.server.api.ODataResponse;
+ import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart;
+ import org.apache.olingo.server.api.deserializer.batch.ODataResponsePart;
 
-/**
- * <p>Provides methods to process {@link ODataRequest}s and {@link BatchRequestPart}s
- * in the context of a batch request.</p>
- *
- * <p>Within a {@link org.apache.olingo.server.api.processor.BatchProcessor BatchProcessor}
- * implementation BatchRequestParts should be passed to {@link #handleBatchRequest(BatchRequestPart)}.
- * Only if the BatchRequestPart represents a change set, the request will be delegated to
- * {@link org.apache.olingo.server.api.processor.BatchProcessor#processChangeSet(BatchFacade, java.util.List)}.
- * Otherwise the requests will be directly executed.</p>
- *
- * <p>The processor implementation could use {@link #handleODataRequest(ODataRequest)} to process
- * requests in a change set.</p>
- */
-public interface BatchFacade {
-  /**
-   * Executes an ODataRequest, which must be a part of a change set.
-   * Each request must have a Content-Id header field, which holds an identifier
-   * that is unique in the whole batch request.
-   * @param request ODataRequest to process
-   * @return corresponding ODataResponse to the given request
-   * @throws ODataApplicationException
-   * @throws ODataLibraryException
-   */
-  public ODataResponse handleODataRequest(ODataRequest request)
-      throws ODataApplicationException, ODataLibraryException;
+ /**
+  * <p>Provides methods to process {@link ODataRequest}s and {@link BatchRequestPart}s
+  * in the context of a batch request.</p>
+  *
+  * <p>Within a {@link org.apache.olingo.server.api.processor.BatchProcessor BatchProcessor} implementation
+ * BatchRequestParts should be passed to {@link #handleBatchRequest(BatchRequestPart)}.
+  * Only if the BatchRequestPart represents a change set, the request will be delegated to
+  * {@link org.apache.olingo.server.api.processor.BatchProcessor#processChangeSet(BatchFacade, java.util.List)}.
+  * Otherwise the requests will be directly executed.</p>
+  *
+  * <p>The processor implementation could use {@link #handleODataRequest(ODataRequest)} to process
+  * requests in a change set.</p>
+  */
+ public interface BatchFacade {
+   /**
+    * Executes an ODataRequest, which must be a part of a change set.
+    * Each request must have a Content-Id header field, which holds an identifier
+    * that is unique in the whole batch request.
+    * @param request ODataRequest to process
+    * @return corresponding ODataResponse to the given request
+    * @throws ODataApplicationException
+    * @throws ODataLibraryException
+    */
+   public ODataResponse handleODataRequest(ODataRequest request)
+       throws ODataApplicationException, ODataLibraryException;
 
-  /**
-   * Handles a BatchRequestPart.
-   * @param request Request to process
-   * @return corresponding {@link ODataResponsePart}
-   * @throws ODataApplicationException
-   * @throws ODataLibraryException
-   */
-  public ODataResponsePart handleBatchRequest(BatchRequestPart request)
-      throws ODataApplicationException, ODataLibraryException;
+   /**
+    * Handles a BatchRequestPart.
+    * @param request Request to process
+    * @return corresponding {@link ODataResponsePart}
+    * @throws ODataApplicationException
+    * @throws ODataLibraryException
+    */
+   public ODataResponsePart handleBatchRequest(BatchRequestPart request)
+       throws ODataApplicationException, ODataLibraryException;
 
-  /**
-   * Extracts the boundary of a multipart/mixed header.
-   * See RFC 2046#5.1
-   * @param contentType Content Type
-   * @return boundary
-   * @throws ODataApplicationException
-   * @throws ODataLibraryException
-   */
-  public String extractBoundaryFromContentType(String contentType)
-      throws ODataApplicationException, ODataLibraryException;
-}
+   /**
+    * Extracts the boundary of a multipart/mixed header.
+    * See RFC 2046#5.1
+    * @param contentType Content Type
+    * @return boundary
+    * @throws ODataApplicationException
+    * @throws ODataLibraryException
+    */
+   public String extractBoundaryFromContentType(String contentType)
+       throws ODataApplicationException, ODataLibraryException;
+ }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/package-info.java
index a6952ad..5906051 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugInformation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugInformation.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugInformation.java
index 2f4e67d..e91a0dd 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugInformation.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugInformation.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -46,7 +46,7 @@ public class DebugInformation {
     return request;
   }
 
-  public void setRequest(ODataRequest request) {
+  public void setRequest(final ODataRequest request) {
     this.request = request;
   }
 
@@ -59,7 +59,7 @@ public class DebugInformation {
     return applicationResponse;
   }
 
-  public void setApplicationResponse(ODataResponse applicationResponse) {
+  public void setApplicationResponse(final ODataResponse applicationResponse) {
     this.applicationResponse = applicationResponse;
   }
 
@@ -72,7 +72,7 @@ public class DebugInformation {
     return uriInfo;
   }
 
-  public void setUriInfo(UriInfo uriInfo) {
+  public void setUriInfo(final UriInfo uriInfo) {
     this.uriInfo = uriInfo;
   }
 
@@ -85,7 +85,7 @@ public class DebugInformation {
     return exception;
   }
 
-  public void setException(Exception exception) {
+  public void setException(final Exception exception) {
     this.exception = exception;
   }
 
@@ -98,7 +98,7 @@ public class DebugInformation {
     return serverEnvironmentVariables;
   }
 
-  public void setServerEnvironmentVariables(Map<String, String> serverEnvironmentVariables) {
+  public void setServerEnvironmentVariables(final Map<String, String> serverEnvironmentVariables) {
     this.serverEnvironmentVariables = serverEnvironmentVariables;
   }
 
@@ -111,7 +111,7 @@ public class DebugInformation {
     return runtimeInformation;
   }
 
-  public void setRuntimeInformation(List<RuntimeMeasurement> runtimeInformation) {
+  public void setRuntimeInformation(final List<RuntimeMeasurement> runtimeInformation) {
     this.runtimeInformation = runtimeInformation;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugResponseHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugResponseHelper.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugResponseHelper.java
index ec6a2c4..02845be 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugResponseHelper.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugResponseHelper.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java
index 34527b9..8a62427 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DebugSupport.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -33,8 +33,7 @@ public interface DebugSupport {
 
   /**
    * Initializes the debug support implementation.
-   * Is called before {@link #isUserAuthorized()} and
-   * {@link #createDebugResponse(String, DebugInformation)}.
+   * Is called before {@link #isUserAuthorized()} and {@link #createDebugResponse(String, DebugInformation)}.
    * @param odata
    */
   void init(OData odata);
@@ -49,7 +48,7 @@ public interface DebugSupport {
    * Creates a debug response and delivers it back to the Olingo library.
    * This method MUST NEVER throw an exception.
    * @param debugFormat the value of the odata-debug query parameter
-   * @param debugInfo   all necessary information to construct debug output
+   * @param debugInfo all necessary information to construct debug output
    * @return a new debug response which will be sent to the client
    */
   ODataResponse createDebugResponse(String debugFormat, DebugInformation debugInfo);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DefaultDebugSupport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DefaultDebugSupport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DefaultDebugSupport.java
index 7079e76..b8c86f6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DefaultDebugSupport.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/DefaultDebugSupport.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,7 +29,7 @@ public class DefaultDebugSupport implements DebugSupport {
   private OData odata;
 
   @Override
-  public void init(OData odata) {
+  public void init(final OData odata) {
     this.odata = odata;
   }
 
@@ -39,7 +39,7 @@ public class DefaultDebugSupport implements DebugSupport {
   }
 
   @Override
-  public ODataResponse createDebugResponse(String debugFormat, DebugInformation debugInfo) {
+  public ODataResponse createDebugResponse(final String debugFormat, final DebugInformation debugInfo) {
     // Check if debugFormat is supported by the library
     if (DebugSupport.ODATA_DEBUG_JSON.equalsIgnoreCase(debugFormat)
         || DebugSupport.ODATA_DEBUG_HTML.equalsIgnoreCase(debugFormat)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/RuntimeMeasurement.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/RuntimeMeasurement.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/RuntimeMeasurement.java
index 69e30da..bdf10fb 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/RuntimeMeasurement.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/RuntimeMeasurement.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,7 +35,7 @@ public class RuntimeMeasurement {
    * Sets the class name.
    * @param className the name of the class that is measured
    */
-  public void setClassName(String className) {
+  public void setClassName(final String className) {
     this.className = className;
   }
 
@@ -51,7 +51,7 @@ public class RuntimeMeasurement {
    * Sets the method name.
    * @param methodName the name of the method that is measured
    */
-  public void setMethodName(String methodName) {
+  public void setMethodName(final String methodName) {
     this.methodName = methodName;
   }
 
@@ -68,7 +68,7 @@ public class RuntimeMeasurement {
    * @param timeStarted the start time in nanoseconds
    * @see System#nanoTime()
    */
-  public void setTimeStarted(long timeStarted) {
+  public void setTimeStarted(final long timeStarted) {
     this.timeStarted = timeStarted;
   }
 
@@ -86,7 +86,7 @@ public class RuntimeMeasurement {
    * @param timeStopped the stop time in nanoseconds
    * @see System#nanoTime()
    */
-  public void setTimeStopped(long timeStopped) {
+  public void setTimeStopped(final long timeStopped) {
     this.timeStopped = timeStopped;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/package-info.java
index 91c95e6..9936711 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/debug/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerException.java
index 56567f2..2ce55aa 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerResult.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerResult.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerResult.java
index c096118..e9f035c 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerResult.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/DeserializerResult.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/FixedFormatDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/FixedFormatDeserializer.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/FixedFormatDeserializer.java
index 0bf8e0d..4828668 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/FixedFormatDeserializer.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/FixedFormatDeserializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -39,23 +39,23 @@ public interface FixedFormatDeserializer {
 
   /**
    * Reads primitive-type data from an InputStream.
-   * @param content  the textual value as input stream
+   * @param content the textual value as input stream
    * @param property EDM property
    */
   public Object primitiveValue(InputStream content, EdmProperty property) throws DeserializerException;
 
   /**
    * Reads parameter data (in URI syntax) from a String.
-   * @param content   the textual value as String
+   * @param content the textual value as String
    * @param parameter EDM parameter
    */
   public Parameter parameter(String content, EdmParameter parameter) throws DeserializerException;
 
   /**
    * Reads batch data from an InputStream.
-   * @param content  the data as multipart input stream
+   * @param content the data as multipart input stream
    * @param boundary the boundary between the parts
-   * @param options  options for the deserializer
+   * @param options options for the deserializer
    * @return a list of batch-request parts
    */
   public List<BatchRequestPart> parseBatchRequest(InputStream content, String boundary, BatchOptions options)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/ODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/ODataDeserializer.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/ODataDeserializer.java
index ac40352..cc09e7d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/ODataDeserializer.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/ODataDeserializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,7 +32,7 @@ public interface ODataDeserializer {
   /**
    * Deserializes an entity stream into an {@link org.apache.olingo.commons.api.data.Entity Entity} object.
    * Validates: property types, no double properties, correct json types.
-   * Returns a deserialized {@link org.apache.olingo.commons.api.data.Entity Entity} object and an 
+   * Returns a deserialized {@link org.apache.olingo.commons.api.data.Entity Entity} object and an
    * {@link org.apache.olingo.server.api.uri.queryoption.ExpandOption ExpandOption} object.
    * @param stream
    * @param edmEntityType
@@ -42,8 +42,8 @@ public interface ODataDeserializer {
   DeserializerResult entity(InputStream stream, EdmEntityType edmEntityType) throws DeserializerException;
 
   /**
-   * Deserializes an entity collection stream into an
-   * {@link org.apache.olingo.commons.api.data.EntityCollection EntityCollection} object.
+   * Deserializes an entity collection stream into an {@link org.apache.olingo.commons.api.data.EntityCollection
+   * EntityCollection} object.
    * @param stream
    * @param edmEntityType
    * @return {@link DeserializerResult#getEntityCollection()}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchDeserializerException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchDeserializerException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchDeserializerException.java
index e7a81da..6420ba6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchDeserializerException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchDeserializerException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -76,8 +76,8 @@ public class BatchDeserializerException extends DeserializerException {
   /**
    * Creates batch deserializer exception.
    * @param developmentMessage message text as fallback and for debugging purposes
-   * @param messageKey         one of the {@link MessageKeys} for the exception text in the resource bundle
-   * @param parameters         parameters for the exception text
+   * @param messageKey one of the {@link MessageKeys} for the exception text in the resource bundle
+   * @param parameters parameters for the exception text
    */
   public BatchDeserializerException(final String developmentMessage, final MessageKey messageKey,
       final String... parameters) {
@@ -87,9 +87,9 @@ public class BatchDeserializerException extends DeserializerException {
   /**
    * Creates batch deserializer exception.
    * @param developmentMessage message text as fallback and for debugging purposes
-   * @param cause              the cause of this exception
-   * @param messageKey         one of the {@link MessageKeys} for the exception text in the resource bundle
-   * @param parameters         parameters for the exception text
+   * @param cause the cause of this exception
+   * @param messageKey one of the {@link MessageKeys} for the exception text in the resource bundle
+   * @param parameters parameters for the exception text
    */
   public BatchDeserializerException(final String developmentMessage, final Throwable cause,
       final MessageKey messageKey, final String... parameters) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java
index b0f929a..52ef213 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,8 +20,8 @@ package org.apache.olingo.server.api.deserializer.batch;
 
 /**
  * Options for the batch deserializer.
- * @see org.apache.olingo.server.api.deserializer.FixedFormatDeserializer
- * #parseBatchRequest(java.io.InputStream, String, BatchOptions)
+ * @see org.apache.olingo.server.api.deserializer.FixedFormatDeserializer #parseBatchRequest(java.io.InputStream,
+ * String, BatchOptions)
  */
 public final class BatchOptions {
   private boolean isStrict = true;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchRequestPart.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchRequestPart.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchRequestPart.java
index 5802c9e..225bacf 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchRequestPart.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchRequestPart.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/ODataResponsePart.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/ODataResponsePart.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/ODataResponsePart.java
index 8b0bd52..aff6874 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/ODataResponsePart.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/ODataResponsePart.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -38,7 +38,7 @@ public class ODataResponsePart {
    * An ODataResponsePart represents a collection of ODataResponses.
    * A list of ODataResponseParts can be combined by the BatchSerializer to a single
    * OData batch response.
-   * 
+   *
    * @param responses A list of {@link ODataResponse}
    * @param isChangeSet whether this ODataResponsePart represents a change set
    */
@@ -53,7 +53,7 @@ public class ODataResponsePart {
    * An ODataResponsePart represents a collection of ODataResponses.
    * A list of ODataResponseParts can be combined by the BatchSerializer to a single
    * OData batch response.
-   * 
+   *
    * @param response A single {@link ODataResponse}
    * @param isChangeSet whether this ODataResponsePart represents a change set
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/package-info.java
index 41554cb..8f951a4 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/package-info.java
index 499d684..9c7839b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/CustomETagSupport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/CustomETagSupport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/CustomETagSupport.java
index 8194b96..873db13 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/CustomETagSupport.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/CustomETagSupport.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ETagHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ETagHelper.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ETagHelper.java
index b47c6aa..bbc0bd9 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ETagHelper.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ETagHelper.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,7 +26,7 @@ import java.util.Collection;
 public interface ETagHelper {
   /**
    * <p>Checks the preconditions of a read request with a given ETag value
-   * against the If-Match and If-None-Match HTTP headers.</p> 
+   * against the If-Match and If-None-Match HTTP headers.</p>
    * <p>If the given ETag value is not matched by the ETag information in the If-Match headers,
    * and there are ETags in the headers to be matched, a "Precondition Failed" exception is
    * thrown.</p>
@@ -37,30 +37,30 @@ public interface ETagHelper {
    * <a href="https://www.ietf.org/rfc/rfc7232.txt">RFC 7232</a>, section 2.3.2.</p>
    * <p>This method does not nothing and returns <code>false</code> if the ETag value is
    * <code>null</code>.</p>
-   * @param eTag               the ETag value to match
-   * @param ifMatchHeaders     the If-Match header values
+   * @param eTag the ETag value to match
+   * @param ifMatchHeaders the If-Match header values
    * @param ifNoneMatchHeaders the If-None-Match header values
    * @return whether a "Not Modified" response should be used
    */
   public boolean checkReadPreconditions(String eTag,
       Collection<String> ifMatchHeaders, Collection<String> ifNoneMatchHeaders)
-      throws PreconditionException;
+          throws PreconditionException;
 
   /**
    * <p>Checks the preconditions of a change request (with HTTP methods PUT, PATCH, or DELETE)
-   * with a given ETag value against the If-Match and If-None-Match HTTP headers.</p> 
+   * with a given ETag value against the If-Match and If-None-Match HTTP headers.</p>
    * <p>If the given ETag value is not matched by the ETag information in the If-Match headers,
    * and there are ETags in the headers to be matched, or
    * if the given ETag value is matched by the ETag information in the If-None-Match headers,
-   *  a "Precondition Failed" exception is thrown.</p>
+   * a "Precondition Failed" exception is thrown.</p>
    * <p>All matching uses weak comparison as described in
    * <a href="https://www.ietf.org/rfc/rfc7232.txt">RFC 7232</a>, section 2.3.2.</p>
    * <p>This method does not nothing if the ETag value is <code>null</code>.</p>
-   * @param eTag               the ETag value to match
-   * @param ifMatchHeaders     the If-Match header values
+   * @param eTag the ETag value to match
+   * @param ifMatchHeaders the If-Match header values
    * @param ifNoneMatchHeaders the If-None-Match header values
    */
   public void checkChangePreconditions(String eTag,
       Collection<String> ifMatchHeaders, Collection<String> ifNoneMatchHeaders)
-      throws PreconditionException;
+          throws PreconditionException;
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/PreconditionException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/PreconditionException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/PreconditionException.java
index efa606c..43aabb7 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/PreconditionException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/PreconditionException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ServiceMetadataETagSupport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ServiceMetadataETagSupport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ServiceMetadataETagSupport.java
index 430fce5..6c82b18 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ServiceMetadataETagSupport.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/ServiceMetadataETagSupport.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -44,5 +44,5 @@ public interface ServiceMetadataETagSupport {
    * @return the application generated etag for the service document
    */
   String getServiceDocumentETag();
-  
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/package-info.java
index 82ebdc8..fd69dc8 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/etag/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/package-info.java
index fcac1f9..98d8ad0 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/Preferences.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/Preferences.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/Preferences.java
index 2050474..0d0561d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/Preferences.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/Preferences.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -59,7 +59,10 @@ public interface Preferences {
   /** Whether the preference <code>odata.track-changes</code> has been set. */
   public boolean hasTrackChanges();
 
-  public enum Return { REPRESENTATION, MINIMAL }
+  public enum Return {
+    REPRESENTATION, MINIMAL
+  }
+
   /**
    * Gets the value of the preference <code>return</code> or <code>null</code> if not set
    * or the value is not valid.
@@ -73,7 +76,7 @@ public interface Preferences {
    * Gets the value of the preference <code>wait</code> or <code>null</code> if not set
    * or the value is not valid.
    * @return the number of seconds the client is prepared to wait for the service
-   *         to process the request synchronously
+   * to process the request synchronously
    */
   public Integer getWait();
 
@@ -104,7 +107,7 @@ public interface Preferences {
     public Map<String, String> getParameters() {
       return parameters == null ?
           Collections.<String, String> emptyMap() :
-          Collections.unmodifiableMap(parameters);
+            Collections.unmodifiableMap(parameters);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java
index 5aa04c1..ab2b8b6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -62,16 +62,16 @@ public final class PreferencesApplied {
       if (entry.getValue() != null) {
         final boolean safe = isSafe(key);
         result.append('=')
-            .append(safe ? "" : '"')
-            .append(entry.getValue().replaceAll("\\\\|\"", "\\\\$0"))
-            .append(safe ? "" : '"');
+        .append(safe ? "" : '"')
+        .append(entry.getValue().replaceAll("\\\\|\"", "\\\\$0"))
+        .append(safe ? "" : '"');
       }
     }
     return result.toString();
   }
 
-  private boolean isSafe(String key) {
-    if(SAFE_PREFERENCE_NAMES.isEmpty()) {
+  private boolean isSafe(final String key) {
+    if (SAFE_PREFERENCE_NAMES.isEmpty()) {
       SAFE_PREFERENCE_NAMES.add(PreferenceName.ALLOW_ENTITY_REFERENCES.getName());
       SAFE_PREFERENCE_NAMES.add(PreferenceName.CALLBACK.getName());
       SAFE_PREFERENCE_NAMES.add(PreferenceName.CONTINUE_ON_ERROR.getName());
@@ -156,7 +156,7 @@ public final class PreferencesApplied {
      * The preference name is converted to lowercase.
      * The value of this preference may be <code>null</code>.
      * Name and value are not checked for validity.
-     * @param name  preference name
+     * @param name preference name
      * @param value preference value
      */
     public Builder preference(final String name, final String value) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/package-info.java
index 7d387d5..ba66bd0 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java
index 245ccfb..aa7fc27 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java
index 49fd8f2..ccc6cfe 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java
index bfa70a0..450d939 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java
index c0b1263..00a61a0 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java
index 31d5fe7..aa9eb33 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java
index 0905aeb..865cc56 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionVoidProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionVoidProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionVoidProcessor.java
index 3d5dae2..f6fd0c0 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionVoidProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionVoidProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
index cb7f02a..1e8fb96 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java
index 97b86d9..d6a0484 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java
index 72acfb3..b43e232 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountComplexCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountComplexCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountComplexCollectionProcessor.java
index fb25ab7..192ac84 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountComplexCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountComplexCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java
index a19419d..94acecb 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountPrimitiveCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountPrimitiveCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountPrimitiveCollectionProcessor.java
index 0d6ee1a..3781702 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountPrimitiveCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountPrimitiveCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
index 46c7d88..bde6aa4 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeltaProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeltaProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeltaProcessor.java
index 0be8371..981dd3d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeltaProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeltaProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,17 +23,17 @@ package org.apache.olingo.server.api.processor;
  */
 public interface DeltaProcessor extends Processor {
 
-  //  NOT YET AVAILABLE
-  //  /**
-  //   * Reads delta information from persistence and put it as serialized content and
-  //   * with according status into the response.
-  //   * @param request  OData request object containing raw HTTP information
-  //   * @param response OData response object for collecting response data
-  //   * @param uriInfo  information of a parsed OData URI
-  //   * @param responseFormat   requested content type after content negotiation
-  //   * @throws ODataApplicationException if the service implementation encounters a failure
-  //   * @throws ODataLibraryException
-  //   */
-  //  void readDelta(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat)
-  //      throws ODataApplicationException, ODataLibraryException;
+  // NOT YET AVAILABLE
+  // /**
+  // * Reads delta information from persistence and put it as serialized content and
+  // * with according status into the response.
+  // * @param request OData request object containing raw HTTP information
+  // * @param response OData response object for collecting response data
+  // * @param uriInfo information of a parsed OData URI
+  // * @param responseFormat requested content type after content negotiation
+  // * @throws ODataApplicationException if the service implementation encounters a failure
+  // * @throws ODataLibraryException
+  // */
+  // void readDelta(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat)
+  // throws ODataApplicationException, ODataLibraryException;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java
index 7e0db59..95be3b0 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY


[35/51] [abbrv] olingo-odata4 git commit: [OLINGO-834] clean-up exceptions

Posted by mi...@apache.org.
[OLINGO-834] clean-up exceptions

Signed-off-by: Christian Amend <ch...@sap.com>


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 6837fd765152a23dc208546d32188e6cc34c3858
Parents: b881e9c
Author: Klaus Straubinger <kl...@sap.com>
Authored: Wed Jan 13 16:15:44 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Jan 18 13:30:11 2016 +0100

----------------------------------------------------------------------
 .../core/uri/parser/ExpressionParser.java       | 20 +++++++++----------
 .../uri/parser/UriParserSemanticException.java  | 21 +-------------------
 .../uri/validator/UriValidationException.java   |  2 --
 .../server-core-exceptions-i18n.properties      | 15 --------------
 4 files changed, 11 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6837fd76/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
index 6fa415f..ef7d6da 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
@@ -560,9 +560,10 @@ public class ExpressionParser {
       }
       break;
 
-    default:
-      throw new UriParserSemanticException("Unkown method '" + methodKind.name() + "'",
-          UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED, methodKind.name()); // TODO: better message
+    // Can have one or two parameters.  These methods are handled elsewhere.
+    case CAST:
+    case ISOF:
+      break;
     }
     ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
     return parameters;
@@ -1108,11 +1109,10 @@ public class ExpressionParser {
   private void checkType(final Expression expression, final EdmPrimitiveTypeKind... kinds) throws UriParserException {
     final EdmType type = getType(expression);
     if (!isType(type, kinds)) {
-      throw new UriParserSemanticException("Incompatible type.",
-          UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, // TODO: better message
-          type == null ?
-              "" :
-              type.getFullQualifiedName().getFullQualifiedNameAsString());
+      throw new UriParserSemanticException("Incompatible types.",
+          UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE,
+          type == null ? "" : type.getFullQualifiedName().getFullQualifiedNameAsString(),
+          Arrays.deepToString(kinds));
     }
   }
 
@@ -1166,8 +1166,8 @@ public class ExpressionParser {
       return new EnumerationImpl(enumType,
           Arrays.asList(enumType.fromUriLiteral(primitiveValueLiteral).split(",")));
     } catch (final EdmPrimitiveTypeException e) {
-      // TODO: Better error message.
-      throw new UriParserSemanticException("Wrong enumeration value.", e,
+      // This part should not be reached, so a general error message key can be re-used.
+      throw new UriParserSemanticException("Wrong enumeration value '" + primitiveValueLiteral + "'.", e,
           UriParserSemanticException.MessageKeys.UNKNOWN_PART, primitiveValueLiteral);
     }
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6837fd76/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
index 8f5aa67..423c875 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriParserSemanticException.java
@@ -27,8 +27,6 @@ public class UriParserSemanticException extends UriParserException {
     /** parameters: function-import name, function parameters */
     FUNCTION_NOT_FOUND,
     /** parameter: resource part */
-    RESOURCE_PART_ONLY_FOR_TYPED_PARTS,
-    /** parameter: resource part */
     RESOURCE_PART_MUST_BE_PRECEDED_BY_STRUCTURAL_TYPE,
     /** parameter: property name */
     PROPERTY_AFTER_COLLECTION,
@@ -36,54 +34,37 @@ public class UriParserSemanticException extends UriParserException {
     PROPERTY_NOT_IN_TYPE,
     /** parameters: type name, property name */
     EXPRESSION_PROPERTY_NOT_IN_TYPE,
-    /** parameter: property name */
-    UNKNOWN_PROPERTY_TYPE,
     /** parameter: type filter */
     INCOMPATIBLE_TYPE_FILTER,
     /** parameters: previous type filter, last type filter */
     TYPE_FILTER_NOT_CHAINABLE,
     /** parameter: type filter */
     PREVIOUS_PART_NOT_TYPED,
-    /** parameter: type */
-    FUNCTION_PARAMETERS_EXPECTED,
     /** parameter: resource part */
     UNKNOWN_PART,
     /** parameter: type */
     UNKNOWN_TYPE,
     /** parameter: expression */
     ONLY_FOR_TYPED_PARTS,
-    /** parameter: entity type name */
-    UNKNOWN_ENTITY_TYPE,
     /** parameter: expression */
     ONLY_FOR_COLLECTIONS,
     /** parameter: expression */
     ONLY_FOR_ENTITY_TYPES,
     /** parameter: expression */
     ONLY_FOR_STRUCTURAL_TYPES,
-    /** parameter: expression */
-    ONLY_FOR_TYPED_PROPERTIES,
     /** parameter: value */
     INVALID_KEY_VALUE,
-    PARAMETERS_LIST_ONLY_FOR_TYPED_PARTS,
     /** parameters: expected number, actual number */
     WRONG_NUMBER_OF_KEY_PROPERTIES,
-    NOT_ENOUGH_REFERENTIAL_CONSTRAINTS,
     KEY_NOT_ALLOWED,
-    RESOURCE_PATH_NOT_TYPED,
-    ONLY_SIMPLE_AND_COMPLEX_PROPERTIES_IN_SELECT,
-    COMPLEX_PROPERTY_OF_ENTITY_TYPE_EXPECTED,
-    NOT_FOR_ENTITY_TYPE,
-    PREVIOUS_PART_TYPED,
     /** parameter: resource_name */
     RESOURCE_NOT_FOUND,
     /** parameter: not implemented part */
     NOT_IMPLEMENTED,
-    /** parameter: namespace **/
+    /** parameter: namespace */
     NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT,
     /** parameter: complex parameter value */
     COMPLEX_PARAMETER_IN_RESOURCE_PATH,
-    /** parameter: function import name */
-    FUNCTION_IMPORT_NOT_ALLOWED, 
     /** parameters: left type, right type */
     TYPES_NOT_COMPATIBLE;
     

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6837fd76/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
index 2d8f842..1656150 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
@@ -49,8 +49,6 @@ public class UriValidationException extends ODataLibraryException {
     DOUBLE_KEY_PROPERTY,
     /** parameter: untyped segment name */
     LAST_SEGMENT_NOT_TYPED,
-    /** parameter: untyped segment name */
-    SECOND_LAST_SEGMENT_NOT_TYPED,
     /** parameter: unallowed kind before $value */
     UNALLOWED_KIND_BEFORE_VALUE,
     /** parameter: unallowed kind before $count */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6837fd76/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties b/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
index e178fed..6bbad3b 100644
--- a/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
+++ b/lib/server-core/src/main/resources/server-core-exceptions-i18n.properties
@@ -50,41 +50,27 @@ SearchTokenizerException.NOT_FINISHED_QUERY=Search query end in an invalid state
 SearchTokenizerException.INVALID_TOKEN_STATE=Token '%1$s' is in an invalid state.
 SearchTokenizerException.ALREADY_FINISHED=Token '%1$s' is already in finished state.
 
-
 UriParserSemanticException.FUNCTION_NOT_FOUND=The function import '%1$s' has no function with parameters '%2$s'.
-UriParserSemanticException.RESOURCE_PART_ONLY_FOR_TYPED_PARTS='%1$s' is only allowed for typed parts.
 UriParserSemanticException.RESOURCE_PART_MUST_BE_PRECEDED_BY_STRUCTURAL_TYPE=The resource part '%1$s' must be preceded by a structural type.
 UriParserSemanticException.PROPERTY_AFTER_COLLECTION=The property '%1$s' must not follow a collection.
 UriParserSemanticException.PROPERTY_NOT_IN_TYPE=The type '%1$s' has no property '%2$s'.
 UriParserSemanticException.EXPRESSION_PROPERTY_NOT_IN_TYPE=The property '%2$s', used in a query expression, is not defined in type '%1$s'.
-UriParserSemanticException.UNKNOWN_PROPERTY_TYPE=The type of the property '%1$s' is unknown.
 UriParserSemanticException.INCOMPATIBLE_TYPE_FILTER=The type filter '%1$s' is incompatible.
 UriParserSemanticException.TYPE_FILTER_NOT_CHAINABLE=The type filter '%2$s' can not be chained with '%1$s'.
 UriParserSemanticException.PREVIOUS_PART_NOT_TYPED=The previous part of the type filter '%1$s' is not typed.
-UriParserSemanticException.FUNCTION_PARAMETERS_EXPECTED=Function parameters expected for type '%1$s'.
 UriParserSemanticException.UNKNOWN_PART=The part '%1$s' is not defined.
 UriParserSemanticException.ONLY_FOR_TYPED_PARTS='%1$s' is only allowed for typed parts.
-UriParserSemanticException.UNKNOWN_ENTITY_TYPE=The entity type '%1$s' is not defined.
 UriParserSemanticException.UNKNOWN_TYPE=The type of the type cast '%1$s' is not defined.
 UriParserSemanticException.ONLY_FOR_COLLECTIONS='%1$s' is only allowed for collections.
 UriParserSemanticException.ONLY_FOR_ENTITY_TYPES='%1$s' is only allowed for entity types.
 UriParserSemanticException.ONLY_FOR_STRUCTURAL_TYPES='%1$s' is only allowed for structural types.
-UriParserSemanticException.ONLY_FOR_TYPED_PROPERTIES='%1$s' is only allowed for typed properties.
 UriParserSemanticException.INVALID_KEY_VALUE=The key value '%1$s' is invalid.
-UriParserSemanticException.PARAMETERS_LIST_ONLY_FOR_TYPED_PARTS=A list of parameters is only allowed for typed parts.
 UriParserSemanticException.WRONG_NUMBER_OF_KEY_PROPERTIES=There are %2$s key properties instead of the expected %1$s.
-UriParserSemanticException.NOT_ENOUGH_REFERENTIAL_CONSTRAINTS=There are not enough referential constraints.
 UriParserSemanticException.KEY_NOT_ALLOWED=A key is not allowed.
-UriParserSemanticException.RESOURCE_PATH_NOT_TYPED=The resource path is not typed.
-UriParserSemanticException.ONLY_SIMPLE_AND_COMPLEX_PROPERTIES_IN_SELECT=Only simple and complex properties are allowed in selection.
-UriParserSemanticException.COMPLEX_PROPERTY_OF_ENTITY_TYPE_EXPECTED=A complex property of an entity type is expected.
-UriParserSemanticException.NOT_FOR_ENTITY_TYPE=Not allowed for entity type.
-UriParserSemanticException.PREVIOUS_PART_TYPED=The previous part is typed.
 UriParserSemanticException.RESOURCE_NOT_FOUND=Cannot find EntitySet, Singleton, ActionImport or FunctionImport with name '%1$s'.
 UriParserSemanticException.NOT_IMPLEMENTED='%1$s' is not implemented!
 UriParserSemanticException.NAMESPACE_NOT_ALLOWED_AT_FIRST_ELEMENT=Namespace is not allowed for Entity Sets, Singletons, Action Imports and Function Imports; found '%1$s'.
 UriParserSemanticException.COMPLEX_PARAMETER_IN_RESOURCE_PATH=Complex parameters must not appear in resource path segments; found: '%1$s'.
-UriParserSemanticException.FUNCTION_IMPORT_NOT_ALLOWED=Function Imports are not allowed in $filter or $orderby. Found: '%1$s'.
 UriParserSemanticException.TYPES_NOT_COMPATIBLE=The types '%1$s' and '%2$s' are not compatible.
 
 UriValidationException.UNSUPPORTED_QUERY_OPTION=The query option '%1$s' is not supported.
@@ -99,7 +85,6 @@ UriValidationException.SYSTEM_QUERY_OPTION_NOT_ALLOWED_FOR_HTTP_METHOD=The syste
 UriValidationException.INVALID_KEY_PROPERTY=The key property '%1$s' is invalid.
 UriValidationException.DOUBLE_KEY_PROPERTY=The key property '%1$s' has been specified twice.
 UriValidationException.LAST_SEGMENT_NOT_TYPED=The last segment '%1$s' is not typed.
-UriValidationException.SECOND_LAST_SEGMENT_NOT_TYPED=The second last segment '%1$s' is not typed.
 UriValidationException.UNALLOWED_KIND_BEFORE_VALUE=The kind '%1$s' is not allowed before '$value'.
 UriValidationException.UNALLOWED_KIND_BEFORE_COUNT=The kind '%1$s' is not allowed before '$count'.
 UriValidationException.UNALLOWED_RESOURCE_PATH=The resource part '%1$s' is not allowed.


[43/51] [abbrv] olingo-odata4 git commit: [OLINGO-851] Added getInternalName to Mapping object

Posted by mi...@apache.org.
[OLINGO-851] Added getInternalName to Mapping object

I also added the mapping to the EdmBindingTarget.


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 27e17aba90b5e4449f36a1e4cf6fe779db7e8ee4
Parents: 36e6dc9
Author: Christian Amend <ch...@sap.com>
Authored: Wed Jan 20 14:25:38 2016 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Wed Jan 20 14:25:38 2016 +0100

----------------------------------------------------------------------
 .../commons/api/edm/EdmBindingTarget.java       |  2 +-
 .../olingo/commons/api/edm/EdmMapping.java      |  7 ++++
 .../api/edm/provider/CsdlBindingTarget.java     | 25 ++++++++++--
 .../commons/api/edm/provider/CsdlEntitySet.java |  6 +++
 .../commons/api/edm/provider/CsdlMapping.java   | 21 ++++++++++
 .../commons/api/edm/provider/CsdlSingleton.java | 14 +++++--
 .../core/edm/AbstractEdmBindingTarget.java      | 12 ++++--
 .../core/edm/provider/EdmMappingTest.java       | 42 +++++++++++++++++++-
 8 files changed, 116 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
index e3fbc37..48c2078 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
@@ -24,7 +24,7 @@ import java.util.List;
  * Entity Sets or Singletons can be bound to each other using a navigation property binding so an
  * {@link EdmBindingTarget} can either be an {@link EdmEntitySet} or an {@link EdmSingleton}.
  */
-public interface EdmBindingTarget extends EdmNamed, EdmAnnotatable {
+public interface EdmBindingTarget extends EdmNamed, EdmAnnotatable, EdmMappable {
 
   /**
    * Returns a human readable title or null if not set.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
index e223152..c51b1c5 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
@@ -24,6 +24,13 @@ package org.apache.olingo.commons.api.edm;
 public interface EdmMapping {
 
   /**
+   * Returns the internal name for this mapped object. This name won`t be used by the Olingo library but can be used by 
+   * applications to access their database easier.
+   * @return the internal name of this mapped object
+   */
+  String getInternalName();
+  
+  /**
    * The class which is returned here will be used to during deserialization to replace the default java class for a
    * primitive type.
    * @return class used during deserialization

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
index 2a748f4..50e0dee 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,7 +32,7 @@ public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements C
    * The Name.
    */
   protected String name;
-  
+
   /**
    * The human readable title.
    */
@@ -49,6 +49,11 @@ public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements C
   protected List<CsdlNavigationPropertyBinding> navigationPropertyBindings =
       new ArrayList<CsdlNavigationPropertyBinding>();
 
+  /**
+   * Mapping for server use cases
+   */
+  protected CsdlMapping mapping;
+
   private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
 
   @Override
@@ -156,4 +161,18 @@ public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements C
     this.title = title;
     return this;
   }
+
+  public CsdlMapping getMapping() {
+    return mapping;
+  }
+
+  /**
+   * Sets the mapping object for this binding target.
+   * @param mapping
+   * @return this instance
+   */
+  public CsdlBindingTarget setMapping(CsdlMapping mapping) {
+    this.mapping = mapping;
+    return this;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
index 41380c5..4b035ee 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java
@@ -87,4 +87,10 @@ public class CsdlEntitySet extends CsdlBindingTarget {
     super.setTitle(title);
     return this;
   }
+  
+  @Override
+  public CsdlEntitySet setMapping(CsdlMapping mapping) {
+    this.mapping = mapping;
+    return this;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java
index 779ab2e..625f78a 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java
@@ -26,8 +26,21 @@ import org.apache.olingo.commons.api.edm.EdmMapping;
  */
 public class CsdlMapping implements EdmMapping {
 
+  private String internalName;
   private Class<?> mappedJavaClass;
 
+  
+  /**
+   * Sets the internal name for this mapped object. This name won`t be used by the Olingo library but can be used by 
+   * applications to access their database easier.
+   * @param internalName
+   * @return this for method chaining
+   */
+  public CsdlMapping setInternalName(String internalName){
+    this.internalName = internalName;
+    return this;
+  }
+  
   /**
    * Sets the class to be used during deserialization to transform an EDM primitive type into this java class. To see
    * which classes work for which primitive type refer to {@link org.apache.olingo.commons.api.edm.EdmPrimitiveType}.
@@ -49,4 +62,12 @@ public class CsdlMapping implements EdmMapping {
     return mappedJavaClass;
   }
 
+  /* (non-Javadoc)
+   * @see org.apache.olingo.commons.api.edm.EdmMapping#getInternalName()
+   */
+  @Override
+  public String getInternalName() {
+    return internalName;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
index 235b240..1e7a872 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -51,16 +51,22 @@ public class CsdlSingleton extends CsdlBindingTarget {
     this.navigationPropertyBindings = navigationPropertyBindings;
     return this;
   }
-  
+
   @Override
   public CsdlSingleton setAnnotations(final List<CsdlAnnotation> annotations) {
     super.setAnnotations(annotations);
     return this;
   }
-  
+
   @Override
   public CsdlSingleton setTitle(String title) {
     super.setTitle(title);
     return this;
   }
+
+  @Override
+  public CsdlSingleton setMapping(CsdlMapping mapping) {
+    this.mapping = mapping;
+    return this;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java
index 90ac9f8..96b9f06 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,6 +28,7 @@ import org.apache.olingo.commons.api.edm.EdmBindingTarget;
 import org.apache.olingo.commons.api.edm.EdmEntityContainer;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
 import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmMapping;
 import org.apache.olingo.commons.api.edm.EdmNavigationPropertyBinding;
 import org.apache.olingo.commons.api.edm.provider.CsdlBindingTarget;
 import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding;
@@ -119,9 +120,14 @@ public abstract class AbstractEdmBindingTarget extends AbstractEdmNamed implemen
 
     return bindingTarget;
   }
-  
+
   @Override
   public String getTitle() {
     return target.getTitle();
   }
+
+  @Override
+  public EdmMapping getMapping() {
+    return target.getMapping();
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27e17aba/lib/commons-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java b/lib/commons-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java
index 455dd15..2e5ae40 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java
@@ -24,14 +24,20 @@ import static org.junit.Assert.assertNull;
 
 import java.util.Date;
 
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
 import org.apache.olingo.commons.api.edm.EdmParameter;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
 import org.apache.olingo.commons.api.edm.provider.CsdlMapping;
 import org.apache.olingo.commons.api.edm.provider.CsdlParameter;
 import org.apache.olingo.commons.api.edm.provider.CsdlProperty;
+import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
+import org.apache.olingo.commons.core.edm.EdmEntitySetImpl;
 import org.apache.olingo.commons.core.edm.EdmParameterImpl;
 import org.apache.olingo.commons.core.edm.EdmPropertyImpl;
+import org.apache.olingo.commons.core.edm.EdmSingletonImpl;
 import org.junit.Test;
 
 public class EdmMappingTest {
@@ -40,13 +46,45 @@ public class EdmMappingTest {
   public void initialMappingMustBeNull() {
     CsdlProperty property = new CsdlProperty().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName());
     EdmProperty edmProperty = new EdmPropertyImpl(null, property);
-
     assertNull(edmProperty.getMapping());
 
     CsdlParameter parameter = new CsdlParameter().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName());
     EdmParameter edmParameter = new EdmParameterImpl(null, parameter);
-
     assertNull(edmParameter.getMapping());
+
+    CsdlEntitySet es = new CsdlEntitySet().setName("test");
+    EdmEntitySet edmES = new EdmEntitySetImpl(null, null, es);
+    assertNull(edmES.getMapping());
+
+    CsdlSingleton si = new CsdlSingleton().setName("test");
+    EdmSingleton edmSi = new EdmSingletonImpl(null, null, si);
+    assertNull(edmSi.getMapping());
+  }
+
+  public void getInternalNameViaMapping() {
+    CsdlMapping mapping = new CsdlMapping().setInternalName("internalName");
+
+    CsdlProperty property =
+        new CsdlProperty().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()).setMapping(mapping);
+    EdmProperty edmProperty = new EdmPropertyImpl(null, property);
+    assertNotNull(edmProperty.getMapping());
+    assertEquals("internalName", edmProperty.getMapping().getInternalName());
+
+    CsdlParameter parameter =
+        new CsdlParameter().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()).setMapping(mapping);
+    EdmParameter edmParameter = new EdmParameterImpl(null, parameter);
+    assertNotNull(edmParameter.getMapping());
+    assertEquals("internalName", edmParameter.getMapping().getInternalName());
+
+    CsdlEntitySet es = new CsdlEntitySet().setName("test").setMapping(mapping);
+    EdmEntitySet edmES = new EdmEntitySetImpl(null, null, es);
+    assertNotNull(edmES.getMapping());
+    assertEquals("internalName", edmES.getMapping().getInternalName());
+
+    CsdlSingleton si = new CsdlSingleton().setName("test").setMapping(mapping);
+    EdmSingleton edmSi = new EdmSingletonImpl(null, null, si);
+    assertNotNull(edmSi.getMapping());
+    assertEquals("internalName", edmSi.getMapping().getInternalName());
   }
 
   @Test


[10/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] Set 4.1.0-RC01 release candidate version

Posted by mi...@apache.org.
[OLINGO-841] Set 4.1.0-RC01 release candidate version


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: d1c4c743fd6f6fd4316d2c720f63f789d820dac1
Parents: 371bf9a
Author: Christian Amend <ch...@sap.com>
Authored: Fri Dec 18 15:56:11 2015 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Fri Dec 18 15:56:11 2015 +0100

----------------------------------------------------------------------
 dist/android-lib/pom.xml                              | 2 +-
 dist/client-lib/pom.xml                               | 2 +-
 dist/javadoc/pom.xml                                  | 2 +-
 dist/pom.xml                                          | 2 +-
 dist/server-lib/pom.xml                               | 2 +-
 ext/client-android/pom.xml                            | 2 +-
 ext/client-proxy/pom.xml                              | 2 +-
 ext/karaf/karaf-features/pom.xml                      | 2 +-
 ext/karaf/karaf-fit/pom.xml                           | 2 +-
 ext/karaf/pom.xml                                     | 2 +-
 ext/pojogen-maven-plugin/pom.xml                      | 2 +-
 ext/pom.xml                                           | 2 +-
 fit/pom.xml                                           | 2 +-
 lib/client-api/pom.xml                                | 2 +-
 lib/client-core/pom.xml                               | 2 +-
 lib/commons-api/pom.xml                               | 2 +-
 lib/commons-core/pom.xml                              | 2 +-
 lib/pom.xml                                           | 2 +-
 lib/server-api/pom.xml                                | 2 +-
 lib/server-core-ext/pom.xml                           | 2 +-
 lib/server-core/pom.xml                               | 2 +-
 lib/server-tecsvc/pom.xml                             | 2 +-
 lib/server-test/pom.xml                               | 2 +-
 pom.xml                                               | 2 +-
 samples/client/pom.xml                                | 2 +-
 samples/osgi/server/pom.xml                           | 2 +-
 samples/pom.xml                                       | 2 +-
 samples/server/pom.xml                                | 2 +-
 samples/tutorials/p0_all/pom.xml                      | 4 ++--
 samples/tutorials/p10_media/pom.xml                   | 4 ++--
 samples/tutorials/p11_batch/pom.xml                   | 4 ++--
 samples/tutorials/p12_deep_insert/pom.xml             | 4 ++--
 samples/tutorials/p12_deep_insert_preparation/pom.xml | 4 ++--
 samples/tutorials/p1_read/pom.xml                     | 4 ++--
 samples/tutorials/p2_readep/pom.xml                   | 4 ++--
 samples/tutorials/p3_write/pom.xml                    | 4 ++--
 samples/tutorials/p4_navigation/pom.xml               | 4 ++--
 samples/tutorials/p5_queryoptions-tcs/pom.xml         | 4 ++--
 samples/tutorials/p6_queryoptions-es/pom.xml          | 4 ++--
 samples/tutorials/p7_queryoptions-o/pom.xml           | 4 ++--
 samples/tutorials/p8_queryoptions-f/pom.xml           | 4 ++--
 samples/tutorials/p9_action/pom.xml                   | 4 ++--
 samples/tutorials/p9_action_preparation/pom.xml       | 4 ++--
 samples/tutorials/pom.xml                             | 2 +-
 44 files changed, 59 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/dist/android-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/android-lib/pom.xml b/dist/android-lib/pom.xml
index 2fa4050..2fcf4fb 100644
--- a/dist/android-lib/pom.xml
+++ b/dist/android-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/dist/client-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/client-lib/pom.xml b/dist/client-lib/pom.xml
index 214c1c3..5f53082 100644
--- a/dist/client-lib/pom.xml
+++ b/dist/client-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/dist/javadoc/pom.xml b/dist/javadoc/pom.xml
index e52e02e..909f62c 100644
--- a/dist/javadoc/pom.xml
+++ b/dist/javadoc/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/dist/pom.xml
----------------------------------------------------------------------
diff --git a/dist/pom.xml b/dist/pom.xml
index 7c94e30..9d6a3f8 100644
--- a/dist/pom.xml
+++ b/dist/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/dist/server-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/server-lib/pom.xml b/dist/server-lib/pom.xml
index 303ab30..dce055d 100644
--- a/dist/server-lib/pom.xml
+++ b/dist/server-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/ext/client-android/pom.xml
----------------------------------------------------------------------
diff --git a/ext/client-android/pom.xml b/ext/client-android/pom.xml
index 3d4f1b0..0fc694c 100644
--- a/ext/client-android/pom.xml
+++ b/ext/client-android/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/ext/client-proxy/pom.xml
----------------------------------------------------------------------
diff --git a/ext/client-proxy/pom.xml b/ext/client-proxy/pom.xml
index d5ab098..99c88bb 100644
--- a/ext/client-proxy/pom.xml
+++ b/ext/client-proxy/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/ext/karaf/karaf-features/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-features/pom.xml b/ext/karaf/karaf-features/pom.xml
index 0290c44..832d240 100644
--- a/ext/karaf/karaf-features/pom.xml
+++ b/ext/karaf/karaf-features/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-karaf</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
     <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/ext/karaf/karaf-fit/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-fit/pom.xml b/ext/karaf/karaf-fit/pom.xml
index 3006949..9889316 100644
--- a/ext/karaf/karaf-fit/pom.xml
+++ b/ext/karaf/karaf-fit/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-karaf</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
   <dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/ext/karaf/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/pom.xml b/ext/karaf/pom.xml
index bbc3fe1..0965df5 100644
--- a/ext/karaf/pom.xml
+++ b/ext/karaf/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/ext/pojogen-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/pom.xml b/ext/pojogen-maven-plugin/pom.xml
index 945e353..5eadead 100644
--- a/ext/pojogen-maven-plugin/pom.xml
+++ b/ext/pojogen-maven-plugin/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/ext/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pom.xml b/ext/pom.xml
index 54aedfc..dcdc1ed 100644
--- a/ext/pom.xml
+++ b/ext/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/fit/pom.xml
----------------------------------------------------------------------
diff --git a/fit/pom.xml b/fit/pom.xml
index a0c43be..e09c387 100644
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/client-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-api/pom.xml b/lib/client-api/pom.xml
index 2ea1eaf..ad551f2 100644
--- a/lib/client-api/pom.xml
+++ b/lib/client-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/client-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/pom.xml b/lib/client-core/pom.xml
index 02075b1..3cd6d49 100644
--- a/lib/client-core/pom.xml
+++ b/lib/client-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/commons-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-api/pom.xml b/lib/commons-api/pom.xml
index 4b5f9a9..b2ac6d0 100644
--- a/lib/commons-api/pom.xml
+++ b/lib/commons-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/commons-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-core/pom.xml b/lib/commons-core/pom.xml
index c175d77..a2ebb94 100644
--- a/lib/commons-core/pom.xml
+++ b/lib/commons-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/pom.xml
----------------------------------------------------------------------
diff --git a/lib/pom.xml b/lib/pom.xml
index 6062cd0..d630462 100644
--- a/lib/pom.xml
+++ b/lib/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/server-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-api/pom.xml b/lib/server-api/pom.xml
index a801d65..bc87f28 100644
--- a/lib/server-api/pom.xml
+++ b/lib/server-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/server-core-ext/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/pom.xml b/lib/server-core-ext/pom.xml
index 82b2beb..fc2ec50 100644
--- a/lib/server-core-ext/pom.xml
+++ b/lib/server-core-ext/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
   <dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/server-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml
index 6f1e984..2101d2f 100644
--- a/lib/server-core/pom.xml
+++ b/lib/server-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/server-tecsvc/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/pom.xml b/lib/server-tecsvc/pom.xml
index bc7934e..f603ff0 100644
--- a/lib/server-tecsvc/pom.xml
+++ b/lib/server-tecsvc/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/lib/server-test/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-test/pom.xml b/lib/server-test/pom.xml
index b7535c6..6666a68 100644
--- a/lib/server-test/pom.xml
+++ b/lib/server-test/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ff48fb4..dbf4b42 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
 
   <groupId>org.apache.olingo</groupId>
   <artifactId>odata-parent</artifactId>
-  <version>4.1.0-SNAPSHOT</version>
+  <version>4.1.0-RC01</version>
   <packaging>pom</packaging>
 
   <name>Olingo-OData</name>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/client/pom.xml b/samples/client/pom.xml
index c13f4a1..999f124 100644
--- a/samples/client/pom.xml
+++ b/samples/client/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/osgi/server/pom.xml
----------------------------------------------------------------------
diff --git a/samples/osgi/server/pom.xml b/samples/osgi/server/pom.xml
index 247ae1b..5f3e369 100644
--- a/samples/osgi/server/pom.xml
+++ b/samples/osgi/server/pom.xml
@@ -30,7 +30,7 @@ under the License.
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>../..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/pom.xml
----------------------------------------------------------------------
diff --git a/samples/pom.xml b/samples/pom.xml
index 9f83d77..ddf3b0a 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/server/pom.xml
----------------------------------------------------------------------
diff --git a/samples/server/pom.xml b/samples/server/pom.xml
index 913a8c4..08c7567 100644
--- a/samples/server/pom.xml
+++ b/samples/server/pom.xml
@@ -30,7 +30,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>odata-samples</artifactId>
-		<version>4.1.0-SNAPSHOT</version>
+		<version>4.1.0-RC01</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p0_all/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p0_all/pom.xml b/samples/tutorials/p0_all/pom.xml
index 29cb4f7..8490651 100644
--- a/samples/tutorials/p0_all/pom.xml
+++ b/samples/tutorials/p0_all/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId} Webapp</name>
 
@@ -35,7 +35,7 @@
 
     <properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p10_media/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p10_media/pom.xml b/samples/tutorials/p10_media/pom.xml
index 5082f81..cd8d979 100644
--- a/samples/tutorials/p10_media/pom.xml
+++ b/samples/tutorials/p10_media/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Media</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p11_batch/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p11_batch/pom.xml b/samples/tutorials/p11_batch/pom.xml
index 84fe2c0..80673f0 100644
--- a/samples/tutorials/p11_batch/pom.xml
+++ b/samples/tutorials/p11_batch/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Batch</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p12_deep_insert/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p12_deep_insert/pom.xml b/samples/tutorials/p12_deep_insert/pom.xml
index 4560876..48becc1 100644
--- a/samples/tutorials/p12_deep_insert/pom.xml
+++ b/samples/tutorials/p12_deep_insert/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-DeepInsert</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p12_deep_insert_preparation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p12_deep_insert_preparation/pom.xml b/samples/tutorials/p12_deep_insert_preparation/pom.xml
index fa08fe7..5a6469b 100644
--- a/samples/tutorials/p12_deep_insert_preparation/pom.xml
+++ b/samples/tutorials/p12_deep_insert_preparation/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-DeepInsertPreparation</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p1_read/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p1_read/pom.xml b/samples/tutorials/p1_read/pom.xml
index 10bcad4..f4e9786 100755
--- a/samples/tutorials/p1_read/pom.xml
+++ b/samples/tutorials/p1_read/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
 	<artifactId>DemoService-Read</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p2_readep/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p2_readep/pom.xml b/samples/tutorials/p2_readep/pom.xml
index bcbe846..b6ea350 100755
--- a/samples/tutorials/p2_readep/pom.xml
+++ b/samples/tutorials/p2_readep/pom.xml
@@ -9,7 +9,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-ReadEp</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -19,7 +19,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p3_write/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p3_write/pom.xml b/samples/tutorials/p3_write/pom.xml
index 4945993..9f87d8f 100755
--- a/samples/tutorials/p3_write/pom.xml
+++ b/samples/tutorials/p3_write/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Write</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p4_navigation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p4_navigation/pom.xml b/samples/tutorials/p4_navigation/pom.xml
index 589cc1a..b215b30 100755
--- a/samples/tutorials/p4_navigation/pom.xml
+++ b/samples/tutorials/p4_navigation/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
   <artifactId>DemoService-Navigation</artifactId>
   <packaging>war</packaging>
-  <version>4.0.0</version>
+  <version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p5_queryoptions-tcs/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p5_queryoptions-tcs/pom.xml b/samples/tutorials/p5_queryoptions-tcs/pom.xml
index 3e4ca51..5bcc7c5 100755
--- a/samples/tutorials/p5_queryoptions-tcs/pom.xml
+++ b/samples/tutorials/p5_queryoptions-tcs/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-TCS</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p6_queryoptions-es/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p6_queryoptions-es/pom.xml b/samples/tutorials/p6_queryoptions-es/pom.xml
index f3976df..bf7f729 100755
--- a/samples/tutorials/p6_queryoptions-es/pom.xml
+++ b/samples/tutorials/p6_queryoptions-es/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
   <artifactId>DemoService-QueryOptions-ES</artifactId>
   <packaging>war</packaging>
-  <version>4.0.0</version>
+  <version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p7_queryoptions-o/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p7_queryoptions-o/pom.xml b/samples/tutorials/p7_queryoptions-o/pom.xml
index 3588c5f..f2c7bdc 100644
--- a/samples/tutorials/p7_queryoptions-o/pom.xml
+++ b/samples/tutorials/p7_queryoptions-o/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-O</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p8_queryoptions-f/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p8_queryoptions-f/pom.xml b/samples/tutorials/p8_queryoptions-f/pom.xml
index 9599c88..3bf50aa 100644
--- a/samples/tutorials/p8_queryoptions-f/pom.xml
+++ b/samples/tutorials/p8_queryoptions-f/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-F</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId} Webapp</name>
 
@@ -35,7 +35,7 @@
 
     <properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p9_action/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p9_action/pom.xml b/samples/tutorials/p9_action/pom.xml
index 5c950d4..ebdcd62 100644
--- a/samples/tutorials/p9_action/pom.xml
+++ b/samples/tutorials/p9_action/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Action</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/p9_action_preparation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p9_action_preparation/pom.xml b/samples/tutorials/p9_action_preparation/pom.xml
index bc76664..f400571 100644
--- a/samples/tutorials/p9_action_preparation/pom.xml
+++ b/samples/tutorials/p9_action_preparation/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-ActionPreparation</artifactId>
 	<packaging>war</packaging>
-	<version>4.0.0</version>
+	<version>4.1.0-RC01</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-SNAPSHOT</odata.version>
+		<odata.version>4.1.0-RC01</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1c4c743/samples/tutorials/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/pom.xml b/samples/tutorials/pom.xml
index 2d2d0f9..b204bc9 100644
--- a/samples/tutorials/pom.xml
+++ b/samples/tutorials/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0-SNAPSHOT</version>
+    <version>4.1.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 


[02/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] CleanUp Server API

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java
index 16d8a5e..4734cdd 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -77,6 +77,6 @@ public interface EntityProcessor extends Processor {
    * @throws ODataLibraryException
    */
   void deleteEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo) throws ODataApplicationException,
-      ODataLibraryException;
+  ODataLibraryException;
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java
index c58d25d..97e7f3b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ErrorProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,9 +19,9 @@
 package org.apache.olingo.server.api.processor;
 
 import org.apache.olingo.commons.api.format.ContentType;
-import org.apache.olingo.server.api.ODataServerError;
 import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.ODataResponse;
+import org.apache.olingo.server.api.ODataServerError;
 
 /**
  * Processor which is called if any error/exception occurs inside the library or another processor.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MediaEntityProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MediaEntityProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MediaEntityProcessor.java
index aedce5a..7787ec5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MediaEntityProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MediaEntityProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
index caaf8ad..26e1d9a 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java
index 9dd805a..1e2e95b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java
index 517da55..c9cd5fe 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -57,7 +57,7 @@ public interface PrimitiveProcessor extends Processor {
    */
   void updatePrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo,
       ContentType requestFormat, ContentType responseFormat)
-      throws ODataApplicationException, ODataLibraryException;
+          throws ODataApplicationException, ODataLibraryException;
 
   /**
    * Deletes primitive-type value from an entity and puts the status into the response.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveValueProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveValueProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveValueProcessor.java
index 797ee85..f6899c3 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveValueProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveValueProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -57,7 +57,7 @@ public interface PrimitiveValueProcessor extends PrimitiveProcessor {
    */
   void updatePrimitiveValue(ODataRequest request, ODataResponse response, UriInfo uriInfo,
       ContentType requestFormat, ContentType responseFormat)
-      throws ODataApplicationException, ODataLibraryException;
+          throws ODataApplicationException, ODataLibraryException;
 
   /**
    * Deletes primitive-type raw value from an entity and puts the status into the response.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/Processor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/Processor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/Processor.java
index 2cd39e9..bf60e87 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/Processor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/Processor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceCollectionProcessor.java
index 07ae60d..1731443 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceCollectionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceCollectionProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceProcessor.java
index b2547c0..ea9a6ab 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ReferenceProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
index 74a58c6..1bfc6e2 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/package-info.java
index db41fb2..1c3bc5e 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,3 +32,4 @@
  * in order to overwrite the default behavior.
  */
 package org.apache.olingo.server.api.processor;
+

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/BatchSerializerException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/BatchSerializerException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/BatchSerializerException.java
index ddef3ae..1e68c93 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/BatchSerializerException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/BatchSerializerException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,9 +18,8 @@
  */
 package org.apache.olingo.server.api.serializer;
 
-
 /**
- * Thrown for invalid  batch payloads.
+ * Thrown for invalid batch payloads.
  */
 public class BatchSerializerException extends SerializerException {
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
index 99c6926..d6788e5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,7 +28,7 @@ public class ComplexSerializerOptions {
   private ContextURL contextURL;
   private ExpandOption expand;
   private SelectOption select;
-  
+
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
     return contextURL;
@@ -43,7 +43,7 @@ public class ComplexSerializerOptions {
   public SelectOption getSelect() {
     return select;
   }
-  
+
   private ComplexSerializerOptions() {}
 
   /** Initializes the options builder. */
@@ -77,7 +77,7 @@ public class ComplexSerializerOptions {
       options.select = select;
       return this;
     }
-    
+
     /** Builds the OData serializer options. */
     public ComplexSerializerOptions build() {
       return options;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/CustomContentTypeSupport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/CustomContentTypeSupport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/CustomContentTypeSupport.java
index 6d2fef5..4e63148 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/CustomContentTypeSupport.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/CustomContentTypeSupport.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
index c1f9869..611485f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -57,7 +57,7 @@ public class EntityCollectionSerializerOptions {
   public boolean getWriteOnlyReferences() {
     return writeOnlyReferences;
   }
-  
+
   /** Gets the id of the entity collection */
   public String getId() {
     return id;
@@ -106,7 +106,7 @@ public class EntityCollectionSerializerOptions {
       options.writeOnlyReferences = ref;
       return this;
     }
-    
+
     /** Sets id of the collection */
     public Builder id(final String id) {
       options.id = id;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
index b6dfa48..16481a2 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,7 +28,7 @@ public class EntitySerializerOptions {
   private ExpandOption expand;
   private SelectOption select;
   private boolean writeOnlyReferences;
-  
+
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
     return contextURL;
@@ -88,7 +88,7 @@ public class EntitySerializerOptions {
       options.writeOnlyReferences = ref;
       return this;
     }
-    
+
     /** Builds the OData serializer options. */
     public EntitySerializerOptions build() {
       return options;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/FixedFormatSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/FixedFormatSerializer.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/FixedFormatSerializer.java
index 42b6efd..0e6a440 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/FixedFormatSerializer.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/FixedFormatSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -52,7 +52,7 @@ public interface FixedFormatSerializer {
   /**
    * Serializes a batch response.
    * @param batchResponses the response parts
-   * @param boundary       the boundary between the parts
+   * @param boundary the boundary between the parts
    * @return response as an input stream
    */
   InputStream batchResponse(List<ODataResponsePart> batchResponses, String boundary) throws BatchSerializerException;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializer.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializer.java
index 21066bb..5dd5187 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializer.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ODataSerializer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -37,7 +37,7 @@ public interface ODataSerializer {
   /**
    * Writes the service document into an InputStream.
    * @param serviceMetadata the metadata information for the service
-   * @param serviceRoot     the service-root URI of this OData service
+   * @param serviceRoot the service-root URI of this OData service
    */
   SerializerResult serviceDocument(ServiceMetadata serviceMetadata, String serviceRoot) throws SerializerException;
 
@@ -55,20 +55,20 @@ public interface ODataSerializer {
 
   /**
    * Writes entity-collection data into an InputStream.
-   * @param metadata   metadata for the service
+   * @param metadata metadata for the service
    * @param entityType the {@link EdmEntityType}
-   * @param entitySet  the data of the entity set
-   * @param options    options for the serializer
+   * @param entitySet the data of the entity set
+   * @param options options for the serializer
    */
   SerializerResult entityCollection(ServiceMetadata metadata, EdmEntityType entityType,
       EntityCollection entitySet, EntityCollectionSerializerOptions options) throws SerializerException;
 
   /**
    * Writes entity data into an InputStream.
-   * @param metadata   metadata for the service
+   * @param metadata metadata for the service
    * @param entityType the {@link EdmEntityType}
-   * @param entity     the data of the entity
-   * @param options    options for the serializer
+   * @param entity the data of the entity
+   * @param options options for the serializer
    */
   SerializerResult entity(ServiceMetadata metadata, EdmEntityType entityType, Entity entity,
       EntitySerializerOptions options) throws SerializerException;
@@ -76,9 +76,9 @@ public interface ODataSerializer {
   /**
    * Writes primitive-type instance data into an InputStream.
    * @param metadata metadata for the service
-   * @param type     primitive type
+   * @param type primitive type
    * @param property property value
-   * @param options  options for the serializer
+   * @param options options for the serializer
    */
   SerializerResult primitive(ServiceMetadata metadata, EdmPrimitiveType type, Property property,
       PrimitiveSerializerOptions options) throws SerializerException;
@@ -86,9 +86,9 @@ public interface ODataSerializer {
   /**
    * Writes complex-type instance data into an InputStream.
    * @param metadata metadata for the service
-   * @param type     complex type
+   * @param type complex type
    * @param property property value
-   * @param options  options for the serializer
+   * @param options options for the serializer
    */
   SerializerResult complex(ServiceMetadata metadata, EdmComplexType type, Property property,
       ComplexSerializerOptions options) throws SerializerException;
@@ -96,9 +96,9 @@ public interface ODataSerializer {
   /**
    * Writes data of a collection of primitive-type instances into an InputStream.
    * @param metadata metadata for the service
-   * @param type     primitive type
+   * @param type primitive type
    * @param property property value
-   * @param options  options for the serializer
+   * @param options options for the serializer
    */
   SerializerResult primitiveCollection(ServiceMetadata metadata, EdmPrimitiveType type, Property property,
       PrimitiveSerializerOptions options) throws SerializerException;
@@ -106,30 +106,30 @@ public interface ODataSerializer {
   /**
    * Writes data of a collection of complex-type instances into an InputStream.
    * @param metadata metadata for the service
-   * @param type     complex type
+   * @param type complex type
    * @param property property value
-   * @param options  options for the serializer
+   * @param options options for the serializer
    */
   SerializerResult complexCollection(ServiceMetadata metadata, EdmComplexType type, Property property,
       ComplexSerializerOptions options) throws SerializerException;
 
   /**
    * Writes a single entity reference into an InputStream.
-   * @param metadata     metadata for the service
+   * @param metadata metadata for the service
    * @param edmEntitySet {@link EdmEntitySet}
-   * @param entity       data of the entity
-   * @param options      {@link ReferenceSerializerOptions}
+   * @param entity data of the entity
+   * @param options {@link ReferenceSerializerOptions}
    */
-  SerializerResult reference(ServiceMetadata metadata, EdmEntitySet edmEntitySet, Entity entity, 
+  SerializerResult reference(ServiceMetadata metadata, EdmEntitySet edmEntitySet, Entity entity,
       ReferenceSerializerOptions options) throws SerializerException;
-  
+
   /**
    * Writes entity-collection references into an InputStream.
-   * @param metadata         metadata for the service
-   * @param edmEntitySet     {@link EdmEntitySet}
+   * @param metadata metadata for the service
+   * @param edmEntitySet {@link EdmEntitySet}
    * @param entityCollection data of the entity collection
-   * @param ReferenceCollectionSerializerOptions       {@link ReferenceCollectionSerializerOptions}
+   * @param ReferenceCollectionSerializerOptions {@link ReferenceCollectionSerializerOptions}
    */
-  SerializerResult referenceCollection(ServiceMetadata metadata, EdmEntitySet edmEntitySet, 
+  SerializerResult referenceCollection(ServiceMetadata metadata, EdmEntitySet edmEntitySet,
       EntityCollection entityCollection, ReferenceCollectionSerializerOptions options) throws SerializerException;
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
index 3a507c6..1de20d8 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -30,7 +30,7 @@ public final class PrimitiveSerializerOptions {
   private Integer precision;
   private Integer scale;
   private Boolean isUnicode;
-  
+
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
     return contextURL;
@@ -60,7 +60,7 @@ public final class PrimitiveSerializerOptions {
   public Boolean isUnicode() {
     return isUnicode;
   }
-  
+
   private PrimitiveSerializerOptions() {}
 
   /** Initializes the options builder. */
@@ -112,7 +112,7 @@ public final class PrimitiveSerializerOptions {
       options.isUnicode = isUnicode;
       return this;
     }
-    
+
     /** Sets all facets from an EDM property. */
     public Builder facetsFrom(final EdmProperty property) {
       options.isNullable = property.isNullable();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveValueSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveValueSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveValueSerializerOptions.java
index a0e8ab9..e84aaa4 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveValueSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveValueSerializerOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
index 16f03e3..b38545e 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,17 +25,17 @@ import org.apache.olingo.server.api.uri.queryoption.CountOption;
 public final class ReferenceCollectionSerializerOptions {
   private ContextURL contextURL;
   private CountOption count;
-  
+
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
     return contextURL;
   }
-  
+
   /** Gets the $count system query option. */
   public CountOption getCount() {
     return count;
   }
-  
+
   private ReferenceCollectionSerializerOptions() {}
 
   /** Initializes the options builder. */
@@ -62,7 +62,7 @@ public final class ReferenceCollectionSerializerOptions {
       options.count = count;
       return this;
     }
-    
+
     /** Builds the OData serializer options. */
     public ReferenceCollectionSerializerOptions build() {
       return options;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java
index 7a5e2e6..d468a6c 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceSerializerOptions.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/RepresentationType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/RepresentationType.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/RepresentationType.java
index 29b251a..16f224a 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/RepresentationType.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/RepresentationType.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerException.java
index 6db8230..99dda4b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerException.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerResult.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerResult.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerResult.java
index edf3ac8..85c625d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerResult.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/SerializerResult.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/package-info.java
index 7733e2c..25546be 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriHelper.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriHelper.java
index 35bac79..e1899d2 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriHelper.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriHelper.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -67,7 +67,7 @@ public interface UriHelper {
    * @return the key predicate
    */
   String buildKeyPredicate(EdmEntityType edmEntityType, Entity entity) throws SerializerException;
-  
+
   /**
    * Parses a given entity-id. Provides the entity set and key predicates.
    * A canonical entiy-id to an entity must follow the pattern
@@ -76,10 +76,10 @@ public interface UriHelper {
    * with an entity-container name if not in the default entity container) and a
    * syntactically valid key that identifies a single entity; example:
    * <code>http://example.server.com/service.svc/Employees('42')</code>.
-   * 
+   *
    * @param edm the edm the entity belongs to
    * @param entityId URI of the entity-id
-   * @param rawServiceRoot  the root URI of the service
+   * @param rawServiceRoot the root URI of the service
    * @return {@link UriResourceEntitySet} - contains the entity set and the key predicates
    * @throws DeserializerException in case the entity-id is malformed
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
index 12cfdba..4e0d3f1 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,7 +29,7 @@ import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
  * Use method {@link #getKind()} to obtain URI info kind information and to perform an appropriate cast.</p>
  */
 public interface UriInfo extends UriInfoService, UriInfoMetadata, UriInfoResource, UriInfoBatch,
-    UriInfoAll, UriInfoCrossjoin, UriInfoEntityId {
+UriInfoAll, UriInfoCrossjoin, UriInfoEntityId {
 
   /**
    * See {@link UriInfoKind} for more details which kinds are allowed.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java
index dbbc023..b249b67 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,5 +23,5 @@ package org.apache.olingo.server.api.uri;
  * http://.../serviceroot/$all
  */
 public interface UriInfoAll {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java
index 8aff381..4e16bd5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,5 +23,5 @@ package org.apache.olingo.server.api.uri;
  * http://.../serviceroot/$batch
  */
 public interface UriInfoBatch {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java
index 0229ec3..657c120 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -40,7 +40,7 @@ public interface UriInfoCrossjoin {
    * @return List of entity set names
    */
   List<String> getEntitySetNames();
-  
+
   /**
    * @return Object containing information of the $expand option
    */
@@ -84,5 +84,5 @@ public interface UriInfoCrossjoin {
   /**
    * @return Object containing information of the $top option
    */
-  TopOption getTopOption();  
+  TopOption getTopOption();
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java
index 5dc5521..8659bd5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java
index a09bffd..61dda8a 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java
index 2b9619d..75ca9f3 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
index c418bf9..0550eae 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java
index 189dfad..c284f6f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,5 +23,5 @@ package org.apache.olingo.server.api.uri;
  * http://.../serviceroot
  */
 public interface UriInfoService {
-  //No additional methods needed here.
+  // No additional methods needed here.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java
index 6125492..5918dc9 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java
index 016cbcb..f771778 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java
index cc01a11..e916ce5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java
index 58d94ec..5a1f0ae 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java
index 66e1a37..b58b206 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,5 +23,5 @@ package org.apache.olingo.server.api.uri;
  * For example: http://.../serviceroot/entityset(1)/$count
  */
 public interface UriResourceCount extends UriResource {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java
index 5029716..d0fd554 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java
index f509bd7..b593486 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java
index f9a5ee0..c61ce19 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java
index 456de7d..9e65dc1 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java
index 2abe93e..ba2309e 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java
index 198ac3c..59615e6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java
index 376e88f..2c29159 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java
index fab09a3..ef45451 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java
index 407623e..4359fb2 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -39,7 +39,7 @@ public interface UriResourcePartTyped extends UriResource {
    * @return String representation of the type
    */
   public String getSegmentValue(final boolean includeFilters);
-  
+
   /**
    * @return String representation of the type
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java
index 907d10c..0bc2fe8 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,5 +23,5 @@ package org.apache.olingo.server.api.uri;
  * For example: http://.../serviceroot/entityset(1)/property
  */
 public interface UriResourcePrimitiveProperty extends UriResourceProperty {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java
index c2b0493..c9f7f85 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java
index 5c564f2..728d876 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,5 +23,5 @@ package org.apache.olingo.server.api.uri;
  * For example: http://.../serviceroot/entityset/$ref
  */
 public interface UriResourceRef extends UriResource {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java
index 09e6ed0..38a992e 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,5 +24,5 @@ package org.apache.olingo.server.api.uri;
  * For example: http://.../serviceroot/entityset(1)?$filter=property eq $root/singleton/configstring
  */
 public interface UriResourceRoot extends UriResource {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java
index 3a85f69..89004cc 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java
index 287e8f6..c0235f4 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,5 +23,5 @@ package org.apache.olingo.server.api.uri;
  * For example: http://.../serviceroot/entityset(1)/property/$value
  */
 public interface UriResourceValue extends UriResource {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/package-info.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/package-info.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/package-info.java
index 091f833..b8ad606 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/package-info.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/package-info.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,7 +22,7 @@
  * The URI package is used to condense all information about the OData path used to query the data.
  * <br> In order to support filter and orderby statements the
  * {@link org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitor} has to be implemented by an
- * application. 
+ * application.
  */
 package org.apache.olingo.server.api.uri;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java
index 4f36803..2095c48 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java
index cec4466..4d78b77 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java
index 895f04b..dee7470 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,5 +24,5 @@ package org.apache.olingo.server.api.uri.queryoption;
  * http://.../entitySet?myOption=true
  */
 public interface CustomQueryOption extends QueryOption {
-  //No additional methods needed for now.
+  // No additional methods needed for now.
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
index a16c137..6d3e74f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java
index 5894dc9..634802d 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java
index 87c1183..15c8e2f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java
index c831a01..0efb0d4 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java
index ab8b467..89b18b1 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d4902f72/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java
index 67da30f..69166fc 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY


[15/51] [abbrv] olingo-odata4 git commit: [OLINGO-841] Set release version 4.1.0

Posted by mi...@apache.org.
[OLINGO-841] Set release version 4.1.0


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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: 0242519cc4a47e0c6180c3b99e2b2650f8787d9e
Parents: d1c4c74
Author: Christian Amend <ch...@sap.com>
Authored: Mon Dec 21 12:18:07 2015 +0100
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Dec 21 12:18:07 2015 +0100

----------------------------------------------------------------------
 dist/android-lib/pom.xml                              | 2 +-
 dist/client-lib/pom.xml                               | 2 +-
 dist/javadoc/pom.xml                                  | 2 +-
 dist/pom.xml                                          | 2 +-
 dist/server-lib/pom.xml                               | 2 +-
 ext/client-android/pom.xml                            | 2 +-
 ext/client-proxy/pom.xml                              | 2 +-
 ext/karaf/karaf-features/pom.xml                      | 2 +-
 ext/karaf/karaf-fit/pom.xml                           | 2 +-
 ext/karaf/pom.xml                                     | 2 +-
 ext/pojogen-maven-plugin/pom.xml                      | 2 +-
 ext/pom.xml                                           | 2 +-
 fit/pom.xml                                           | 2 +-
 lib/client-api/pom.xml                                | 2 +-
 lib/client-core/pom.xml                               | 2 +-
 lib/commons-api/pom.xml                               | 2 +-
 lib/commons-core/pom.xml                              | 2 +-
 lib/pom.xml                                           | 2 +-
 lib/server-api/pom.xml                                | 2 +-
 lib/server-core-ext/pom.xml                           | 2 +-
 lib/server-core/pom.xml                               | 2 +-
 lib/server-tecsvc/pom.xml                             | 2 +-
 lib/server-test/pom.xml                               | 2 +-
 pom.xml                                               | 2 +-
 samples/client/pom.xml                                | 2 +-
 samples/osgi/server/pom.xml                           | 2 +-
 samples/pom.xml                                       | 2 +-
 samples/server/pom.xml                                | 2 +-
 samples/tutorials/p0_all/pom.xml                      | 4 ++--
 samples/tutorials/p10_media/pom.xml                   | 4 ++--
 samples/tutorials/p11_batch/pom.xml                   | 4 ++--
 samples/tutorials/p12_deep_insert/pom.xml             | 4 ++--
 samples/tutorials/p12_deep_insert_preparation/pom.xml | 4 ++--
 samples/tutorials/p1_read/pom.xml                     | 4 ++--
 samples/tutorials/p2_readep/pom.xml                   | 4 ++--
 samples/tutorials/p3_write/pom.xml                    | 4 ++--
 samples/tutorials/p4_navigation/pom.xml               | 4 ++--
 samples/tutorials/p5_queryoptions-tcs/pom.xml         | 4 ++--
 samples/tutorials/p6_queryoptions-es/pom.xml          | 4 ++--
 samples/tutorials/p7_queryoptions-o/pom.xml           | 4 ++--
 samples/tutorials/p8_queryoptions-f/pom.xml           | 4 ++--
 samples/tutorials/p9_action/pom.xml                   | 4 ++--
 samples/tutorials/p9_action_preparation/pom.xml       | 4 ++--
 samples/tutorials/pom.xml                             | 2 +-
 44 files changed, 59 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/dist/android-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/android-lib/pom.xml b/dist/android-lib/pom.xml
index 2fcf4fb..80b16b3 100644
--- a/dist/android-lib/pom.xml
+++ b/dist/android-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/dist/client-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/client-lib/pom.xml b/dist/client-lib/pom.xml
index 5f53082..8e04bbb 100644
--- a/dist/client-lib/pom.xml
+++ b/dist/client-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/dist/javadoc/pom.xml b/dist/javadoc/pom.xml
index 909f62c..afb6c7b 100644
--- a/dist/javadoc/pom.xml
+++ b/dist/javadoc/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/dist/pom.xml
----------------------------------------------------------------------
diff --git a/dist/pom.xml b/dist/pom.xml
index 9d6a3f8..92bea67 100644
--- a/dist/pom.xml
+++ b/dist/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/dist/server-lib/pom.xml
----------------------------------------------------------------------
diff --git a/dist/server-lib/pom.xml b/dist/server-lib/pom.xml
index dce055d..27889e2 100644
--- a/dist/server-lib/pom.xml
+++ b/dist/server-lib/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-dist</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/ext/client-android/pom.xml
----------------------------------------------------------------------
diff --git a/ext/client-android/pom.xml b/ext/client-android/pom.xml
index 0fc694c..f2f19af 100644
--- a/ext/client-android/pom.xml
+++ b/ext/client-android/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/ext/client-proxy/pom.xml
----------------------------------------------------------------------
diff --git a/ext/client-proxy/pom.xml b/ext/client-proxy/pom.xml
index 99c88bb..4bb4160 100644
--- a/ext/client-proxy/pom.xml
+++ b/ext/client-proxy/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/ext/karaf/karaf-features/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-features/pom.xml b/ext/karaf/karaf-features/pom.xml
index 832d240..d92dd28 100644
--- a/ext/karaf/karaf-features/pom.xml
+++ b/ext/karaf/karaf-features/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-karaf</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
     <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/ext/karaf/karaf-fit/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/karaf-fit/pom.xml b/ext/karaf/karaf-fit/pom.xml
index 9889316..05cce87 100644
--- a/ext/karaf/karaf-fit/pom.xml
+++ b/ext/karaf/karaf-fit/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-karaf</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
   <dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/ext/karaf/pom.xml
----------------------------------------------------------------------
diff --git a/ext/karaf/pom.xml b/ext/karaf/pom.xml
index 0965df5..97a22da 100644
--- a/ext/karaf/pom.xml
+++ b/ext/karaf/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/ext/pojogen-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/pom.xml b/ext/pojogen-maven-plugin/pom.xml
index 5eadead..3a5781e 100644
--- a/ext/pojogen-maven-plugin/pom.xml
+++ b/ext/pojogen-maven-plugin/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-ext</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/ext/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pom.xml b/ext/pom.xml
index dcdc1ed..6f77ed6 100644
--- a/ext/pom.xml
+++ b/ext/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/fit/pom.xml
----------------------------------------------------------------------
diff --git a/fit/pom.xml b/fit/pom.xml
index e09c387..e9130e8 100644
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/client-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-api/pom.xml b/lib/client-api/pom.xml
index ad551f2..d4c2c7d 100644
--- a/lib/client-api/pom.xml
+++ b/lib/client-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/client-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/pom.xml b/lib/client-core/pom.xml
index 3cd6d49..f41ddf3 100644
--- a/lib/client-core/pom.xml
+++ b/lib/client-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/commons-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-api/pom.xml b/lib/commons-api/pom.xml
index b2ac6d0..4b666bc 100644
--- a/lib/commons-api/pom.xml
+++ b/lib/commons-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/commons-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/commons-core/pom.xml b/lib/commons-core/pom.xml
index a2ebb94..01a7c13 100644
--- a/lib/commons-core/pom.xml
+++ b/lib/commons-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/pom.xml
----------------------------------------------------------------------
diff --git a/lib/pom.xml b/lib/pom.xml
index d630462..f19e4c3 100644
--- a/lib/pom.xml
+++ b/lib/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/server-api/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-api/pom.xml b/lib/server-api/pom.xml
index bc87f28..41c8244 100644
--- a/lib/server-api/pom.xml
+++ b/lib/server-api/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/server-core-ext/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/pom.xml b/lib/server-core-ext/pom.xml
index fc2ec50..9b066cb 100644
--- a/lib/server-core-ext/pom.xml
+++ b/lib/server-core-ext/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
   <dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/server-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml
index 2101d2f..fd9f52c 100644
--- a/lib/server-core/pom.xml
+++ b/lib/server-core/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/server-tecsvc/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/pom.xml b/lib/server-tecsvc/pom.xml
index f603ff0..f2b7df2 100644
--- a/lib/server-tecsvc/pom.xml
+++ b/lib/server-tecsvc/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/lib/server-test/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-test/pom.xml b/lib/server-test/pom.xml
index 6666a68..ff2411c 100644
--- a/lib/server-test/pom.xml
+++ b/lib/server-test/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-lib</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index dbf4b42..cf58a9f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
 
   <groupId>org.apache.olingo</groupId>
   <artifactId>odata-parent</artifactId>
-  <version>4.1.0-RC01</version>
+  <version>4.1.0</version>
   <packaging>pom</packaging>
 
   <name>Olingo-OData</name>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/client/pom.xml
----------------------------------------------------------------------
diff --git a/samples/client/pom.xml b/samples/client/pom.xml
index 999f124..c4b7eaf 100644
--- a/samples/client/pom.xml
+++ b/samples/client/pom.xml
@@ -31,7 +31,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/osgi/server/pom.xml
----------------------------------------------------------------------
diff --git a/samples/osgi/server/pom.xml b/samples/osgi/server/pom.xml
index 5f3e369..a82a6fe 100644
--- a/samples/osgi/server/pom.xml
+++ b/samples/osgi/server/pom.xml
@@ -30,7 +30,7 @@ under the License.
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>../..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/pom.xml
----------------------------------------------------------------------
diff --git a/samples/pom.xml b/samples/pom.xml
index ddf3b0a..d0e3ade 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-parent</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/server/pom.xml
----------------------------------------------------------------------
diff --git a/samples/server/pom.xml b/samples/server/pom.xml
index 08c7567..79fe9dc 100644
--- a/samples/server/pom.xml
+++ b/samples/server/pom.xml
@@ -30,7 +30,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>odata-samples</artifactId>
-		<version>4.1.0-RC01</version>
+		<version>4.1.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p0_all/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p0_all/pom.xml b/samples/tutorials/p0_all/pom.xml
index 8490651..10968d5 100644
--- a/samples/tutorials/p0_all/pom.xml
+++ b/samples/tutorials/p0_all/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId} Webapp</name>
 
@@ -35,7 +35,7 @@
 
     <properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p10_media/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p10_media/pom.xml b/samples/tutorials/p10_media/pom.xml
index cd8d979..7ed3a23 100644
--- a/samples/tutorials/p10_media/pom.xml
+++ b/samples/tutorials/p10_media/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Media</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p11_batch/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p11_batch/pom.xml b/samples/tutorials/p11_batch/pom.xml
index 80673f0..d788697 100644
--- a/samples/tutorials/p11_batch/pom.xml
+++ b/samples/tutorials/p11_batch/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Batch</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p12_deep_insert/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p12_deep_insert/pom.xml b/samples/tutorials/p12_deep_insert/pom.xml
index 48becc1..89221c6 100644
--- a/samples/tutorials/p12_deep_insert/pom.xml
+++ b/samples/tutorials/p12_deep_insert/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-DeepInsert</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p12_deep_insert_preparation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p12_deep_insert_preparation/pom.xml b/samples/tutorials/p12_deep_insert_preparation/pom.xml
index 5a6469b..0e4fcd5 100644
--- a/samples/tutorials/p12_deep_insert_preparation/pom.xml
+++ b/samples/tutorials/p12_deep_insert_preparation/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-DeepInsertPreparation</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p1_read/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p1_read/pom.xml b/samples/tutorials/p1_read/pom.xml
index f4e9786..4b80777 100755
--- a/samples/tutorials/p1_read/pom.xml
+++ b/samples/tutorials/p1_read/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
 	<artifactId>DemoService-Read</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p2_readep/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p2_readep/pom.xml b/samples/tutorials/p2_readep/pom.xml
index b6ea350..e3a392f 100755
--- a/samples/tutorials/p2_readep/pom.xml
+++ b/samples/tutorials/p2_readep/pom.xml
@@ -9,7 +9,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-ReadEp</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -19,7 +19,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p3_write/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p3_write/pom.xml b/samples/tutorials/p3_write/pom.xml
index 9f87d8f..4da371e 100755
--- a/samples/tutorials/p3_write/pom.xml
+++ b/samples/tutorials/p3_write/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Write</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p4_navigation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p4_navigation/pom.xml b/samples/tutorials/p4_navigation/pom.xml
index b215b30..9a9919e 100755
--- a/samples/tutorials/p4_navigation/pom.xml
+++ b/samples/tutorials/p4_navigation/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
   <artifactId>DemoService-Navigation</artifactId>
   <packaging>war</packaging>
-  <version>4.1.0-RC01</version>
+  <version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p5_queryoptions-tcs/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p5_queryoptions-tcs/pom.xml b/samples/tutorials/p5_queryoptions-tcs/pom.xml
index 5bcc7c5..40c671b 100755
--- a/samples/tutorials/p5_queryoptions-tcs/pom.xml
+++ b/samples/tutorials/p5_queryoptions-tcs/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-TCS</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p6_queryoptions-es/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p6_queryoptions-es/pom.xml b/samples/tutorials/p6_queryoptions-es/pom.xml
index bf7f729..6ddc3ee 100755
--- a/samples/tutorials/p6_queryoptions-es/pom.xml
+++ b/samples/tutorials/p6_queryoptions-es/pom.xml
@@ -25,7 +25,7 @@
   <groupId>my.group.id</groupId>
   <artifactId>DemoService-QueryOptions-ES</artifactId>
   <packaging>war</packaging>
-  <version>4.1.0-RC01</version>
+  <version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p7_queryoptions-o/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p7_queryoptions-o/pom.xml b/samples/tutorials/p7_queryoptions-o/pom.xml
index f2c7bdc..4fc8048 100644
--- a/samples/tutorials/p7_queryoptions-o/pom.xml
+++ b/samples/tutorials/p7_queryoptions-o/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-O</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p8_queryoptions-f/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p8_queryoptions-f/pom.xml b/samples/tutorials/p8_queryoptions-f/pom.xml
index 3bf50aa..476c213 100644
--- a/samples/tutorials/p8_queryoptions-f/pom.xml
+++ b/samples/tutorials/p8_queryoptions-f/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-QueryOptions-F</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId} Webapp</name>
 
@@ -35,7 +35,7 @@
 
     <properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p9_action/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p9_action/pom.xml b/samples/tutorials/p9_action/pom.xml
index ebdcd62..fa441f9 100644
--- a/samples/tutorials/p9_action/pom.xml
+++ b/samples/tutorials/p9_action/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-Action</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/p9_action_preparation/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/p9_action_preparation/pom.xml b/samples/tutorials/p9_action_preparation/pom.xml
index f400571..ba631db 100644
--- a/samples/tutorials/p9_action_preparation/pom.xml
+++ b/samples/tutorials/p9_action_preparation/pom.xml
@@ -25,7 +25,7 @@
 	<groupId>my.group.id</groupId>
 	<artifactId>DemoService-ActionPreparation</artifactId>
 	<packaging>war</packaging>
-	<version>4.1.0-RC01</version>
+	<version>4.1.0</version>
 
 	<name>${project.artifactId}-Webapp</name>
 
@@ -35,7 +35,7 @@
 
 	<properties>
 		<javax.version>2.5</javax.version>
-		<odata.version>4.1.0-RC01</odata.version>
+		<odata.version>4.1.0</odata.version>
 		<slf4j.version>1.7.7</slf4j.version>
 	</properties>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0242519c/samples/tutorials/pom.xml
----------------------------------------------------------------------
diff --git a/samples/tutorials/pom.xml b/samples/tutorials/pom.xml
index b204bc9..5187f78 100644
--- a/samples/tutorials/pom.xml
+++ b/samples/tutorials/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>odata-samples</artifactId>
-    <version>4.1.0-RC01</version>
+    <version>4.1.0</version>
     <relativePath>..</relativePath>
   </parent>