You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/03/26 11:13:44 UTC
git commit: Run code clean up
Repository: olingo-odata2
Updated Branches:
refs/heads/master 9b1ba14ba -> f57601c20
Run code clean up
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/f57601c2
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/f57601c2
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/f57601c2
Branch: refs/heads/master
Commit: f57601c20793e48154b60c3a22d9191f22f98c6d
Parents: 9b1ba14
Author: Michael Bolz <mi...@apache.org>
Authored: Wed Mar 26 11:09:48 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Wed Mar 26 11:09:48 2014 +0100
----------------------------------------------------------------------
.../processor/api/AnnotationServiceFactory.java | 2 +-
.../processor/core/ListsProcessor.java | 11 ++--
.../core/edm/AnnotationEdmProvider.java | 62 ++++++++++----------
.../processor/core/util/AnnotationHelper.java | 2 +-
.../core/util/AnnotationRuntimeException.java | 8 +--
.../core/edm/AnnotationEdmProviderTest.java | 2 +-
.../processor/core/util/ClassHelperTest.java | 12 ----
.../annotation/processor/ref/model/City.java | 2 +-
.../processor/ref/model/Location.java | 2 +-
.../processor/ref/AbstractRefJsonTest.java | 2 +-
.../processor/ref/AbstractRefTest.java | 2 +-
.../processor/ref/AbstractRefXmlTest.java | 2 +-
.../processor/ref/EntryJsonCreateTest.java | 60 +++++++++----------
.../processor/ref/ServiceJsonTest.java | 2 +-
.../processor/ref/ServiceXmlTest.java | 2 +-
.../core/model/JPAEdmFunctionImport.java | 1 -
.../model/JPACustomProcessorNegativeMock.java | 2 +-
.../olingo/odata2/api/ep/EntityProvider.java | 2 +-
.../api/exception/ODataMessageException.java | 8 +--
.../olingo/odata2/api/rt/RuntimeDelegate.java | 2 +-
.../olingo/odata2/core/commons/XmlHelper.java | 2 +-
.../olingo/odata2/core/debug/DebugInfoBody.java | 4 +-
.../odata2/core/debug/DebugInfoException.java | 6 +-
.../odata2/core/debug/DebugInfoRequest.java | 2 +-
.../odata2/core/debug/DebugInfoResponse.java | 4 +-
.../odata2/core/debug/DebugInfoRuntime.java | 4 +-
.../odata2/core/debug/DebugInfoServer.java | 2 +-
.../olingo/odata2/core/debug/DebugInfoUri.java | 8 +--
.../core/debug/ODataDebugResponseWrapper.java | 4 +-
.../olingo/odata2/core/edm/EdmDouble.java | 8 ---
.../ep/consumer/XmlErrorDocumentConsumer.java | 42 ++++++-------
.../odata2/core/rest/ODataSubLocator.java | 2 +-
.../odata2/core/servlet/ODataServlet.java | 2 +-
.../odata2/core/ep/ProviderFacadeImplTest.java | 4 +-
.../core/exception/ODataExceptionTest.java | 26 ++++++--
.../odata2/fit/ref/AbstractRefJsonTest.java | 2 +-
.../BasicContentNegotiationTest.java | 2 +-
.../odata2/testutil/fit/AbstractFitTest.java | 11 ++--
.../testutil/fit/FitStaticServiceFactory.java | 2 +-
.../odata2/testutil/server/TestServer.java | 42 ++++++-------
40 files changed, 179 insertions(+), 188 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java b/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
index 9db29ff..92f47e6 100644
--- a/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
+++ b/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
@@ -113,7 +113,7 @@ public abstract class AnnotationServiceFactory {
* for model definition and data access.
* @throws ODataException if an error during initialization occurs
*/
- public static ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses)
+ public static ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses)
throws ODataException {
return getInstance().createAnnotationService(annotatedClasses);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
index 9a77940..2c18668 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
@@ -1516,7 +1516,6 @@ public class ListsProcessor extends DataSourceProcessor {
}
}
-
private <T> Map<String, Object> getSimpleTypeValueMap(final T data, final List<EdmProperty> propertyPath)
throws ODataException {
final EdmProperty property = propertyPath.get(propertyPath.size() - 1);
@@ -1570,12 +1569,12 @@ public class ListsProcessor extends DataSourceProcessor {
final EdmProperty property = (EdmProperty) type.getProperty(propertyName);
if (property.isSimple()) {
Object value = valueAccess.getPropertyType(data, property);
- if(value != null) {
+ if (value != null) {
typeMap.put(propertyName, value);
}
} else {
Object value = valueAccess.getPropertyValue(data, property);
- if(value == null) {
+ if (value == null) {
Class<?> complexClass = valueAccess.getPropertyType(data, property);
value = createInstance(complexClass);
}
@@ -1591,7 +1590,7 @@ public class ListsProcessor extends DataSourceProcessor {
private <T> void setStructuralTypeValuesFromMap(final T data, final EdmStructuralType type,
final Map<String, Object> valueMap, final boolean merge) throws ODataException {
- if(data == null) {
+ if (data == null) {
throw new ODataException("Unable to set structural type values to NULL data.");
}
ODataContext context = getContext();
@@ -1615,7 +1614,7 @@ public class ListsProcessor extends DataSourceProcessor {
@SuppressWarnings("unchecked")
final Map<String, Object> values = (Map<String, Object>) value;
Object complexData = valueAccess.getPropertyValue(data, property);
- if(complexData == null) {
+ if (complexData == null) {
Class<?> complexClass = valueAccess.getPropertyType(data, property);
complexData = createInstance(complexClass);
valueAccess.setPropertyValue(data, property, complexData);
@@ -1629,7 +1628,7 @@ public class ListsProcessor extends DataSourceProcessor {
context.stopRuntimeMeasurement(timingHandle);
}
- private Object createInstance(Class<?> complexClass) throws ODataException {
+ private Object createInstance(final Class<?> complexClass) throws ODataException {
try {
return complexClass.newInstance();
} catch (InstantiationException e) {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
index cf7b94e..984a677 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
@@ -497,37 +497,37 @@ public class AnnotationEdmProvider extends EdmProvider {
return navProp;
}
-// private EdmSimpleTypeKind getEdmSimpleType(Class<?> type) {
-// if (type == String.class) {
-// return EdmType.String;
-// } else if (type == boolean.class || type == Boolean.class) {
-// return EdmType.Boolean;
-// } else if (type == byte.class || type == Byte.class) {
-// return EdmType.SByte;
-// } else if (type == short.class || type == Short.class) {
-// return EdmType.Int16;
-// } else if (type == int.class || type == Integer.class) {
-// return EdmType.Int32;
-// } else if (type == long.class || type == Long.class) {
-// return EdmType.Int64;
-// } else if (type == double.class || type == Double.class) {
-// return EdmType.Double;
-// } else if (type == float.class || type == Float.class) {
-// return EdmType.Single;
-// } else if (type == BigInteger.class || type == BigDecimal.class) {
-// return EdmType.Decimal;
-// } else if (type == Byte[].class || type == byte[].class) {
-// return EdmType.Binary;
-// } else if (type == Date.class) {
-// return EdmType.DateTime;
-// } else if (type == Calendar.class) {
-// return EdmType.DateTimeOffset;
-// } else if (type == UUID.class) {
-// return EdmType.Guid;
-// } else {
-// throw new UnsupportedOperationException("Not yet supported type '" + type + "'.");
-// }
-// }
+ // private EdmSimpleTypeKind getEdmSimpleType(Class<?> type) {
+ // if (type == String.class) {
+ // return EdmType.String;
+ // } else if (type == boolean.class || type == Boolean.class) {
+ // return EdmType.Boolean;
+ // } else if (type == byte.class || type == Byte.class) {
+ // return EdmType.SByte;
+ // } else if (type == short.class || type == Short.class) {
+ // return EdmType.Int16;
+ // } else if (type == int.class || type == Integer.class) {
+ // return EdmType.Int32;
+ // } else if (type == long.class || type == Long.class) {
+ // return EdmType.Int64;
+ // } else if (type == double.class || type == Double.class) {
+ // return EdmType.Double;
+ // } else if (type == float.class || type == Float.class) {
+ // return EdmType.Single;
+ // } else if (type == BigInteger.class || type == BigDecimal.class) {
+ // return EdmType.Decimal;
+ // } else if (type == Byte[].class || type == byte[].class) {
+ // return EdmType.Binary;
+ // } else if (type == Date.class) {
+ // return EdmType.DateTime;
+ // } else if (type == Calendar.class) {
+ // return EdmType.DateTimeOffset;
+ // } else if (type == UUID.class) {
+ // return EdmType.Guid;
+ // } else {
+ // throw new UnsupportedOperationException("Not yet supported type '" + type + "'.");
+ // }
+ // }
private EdmType getEdmType(final Class<?> type) {
if (type == String.class) {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
index d7a165f..0d2ff11 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
@@ -452,7 +452,7 @@ public class AnnotationHelper {
private Field getFieldForPropertyName(final String propertyName,
final Class<?> resultClass, final boolean inherited) {
-
+
Field[] fields = resultClass.getDeclaredFields();
for (Field field : fields) {
EdmProperty property = field.getAnnotation(EdmProperty.class);
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
index 92183c5..177b2b7 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
@@ -25,16 +25,16 @@ public class AnnotationRuntimeException extends RuntimeException {
/** Manual generated */
private static final long serialVersionUID = 42L;
-
- public AnnotationRuntimeException(String message) {
+
+ public AnnotationRuntimeException(final String message) {
super(message);
}
- public AnnotationRuntimeException(Throwable cause) {
+ public AnnotationRuntimeException(final Throwable cause) {
super(cause);
}
- public AnnotationRuntimeException(String message, Throwable cause) {
+ public AnnotationRuntimeException(final String message, final Throwable cause) {
super(message, cause);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
index 24f550a..84e9192 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
@@ -359,7 +359,7 @@ public class AnnotationEdmProviderTest {
PropertyRef imageFormat = getPropertyRef(keyReferences, "ImageFormat");
assertEquals("ImageFormat", imageFormat.getName());
-// assertEquals(0, photo.getNavigationProperties().size());
+ // assertEquals(0, photo.getNavigationProperties().size());
assertNull(photo.getNavigationProperties());
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
index c3cd885..393b651 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
@@ -84,17 +84,5 @@ public class ClassHelperTest {
Long id;
@EdmProperty
String name;
-
- public SimpleEntity() {}
-
- public SimpleEntity(final Long id, final String name) {
- this.id = id;
- this.name = name;
- }
- }
-
- @SuppressWarnings("unused")
- private class NotAnnotatedBean {
- private String name;
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
index 33add0a..1cc166a 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
@@ -33,7 +33,7 @@ public class City {
private String cityName;
public City() {}
-
+
public City(final String postalCode, final String name) {
this.postalCode = postalCode;
cityName = name;
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
index 9a2b46b..52f2811 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
@@ -32,7 +32,7 @@ public class Location {
private City city;
public Location() {}
-
+
public Location(final String country, final String postalCode, final String cityName) {
this.country = country;
city = new City(postalCode, cityName);
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
index 7ae0e3c..5075486 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
@@ -30,7 +30,7 @@ import com.google.gson.reflect.TypeToken;
*/
@Ignore("no test methods")
public class AbstractRefJsonTest extends AbstractRefTest {
- public AbstractRefJsonTest(ServletType servletType) {
+ public AbstractRefJsonTest(final ServletType servletType) {
super(servletType);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
index b71064c..35f6678 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
@@ -51,7 +51,7 @@ import org.junit.Ignore;
@Ignore("no test methods")
public class AbstractRefTest extends AbstractFitTest {
- public AbstractRefTest(ServletType servletType) {
+ public AbstractRefTest(final ServletType servletType) {
super(servletType);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
index a5cb671..635e605 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
@@ -42,7 +42,7 @@ import org.xml.sax.SAXException;
*/
@Ignore("no test methods")
public class AbstractRefXmlTest extends AbstractRefTest {
- public AbstractRefXmlTest(ServletType servletType) {
+ public AbstractRefXmlTest(final ServletType servletType) {
super(servletType);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
index 183d023..90b0384 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
@@ -38,7 +38,7 @@ import com.google.gson.internal.StringMap;
*/
public class EntryJsonCreateTest extends AbstractRefJsonTest {
- public EntryJsonCreateTest(ServletType servletType) {
+ public EntryJsonCreateTest(final ServletType servletType) {
super(servletType);
}
@@ -129,38 +129,38 @@ public class EntryJsonCreateTest extends AbstractRefJsonTest {
StringMap<?> location = (StringMap<?>) updatedMap.get("Location");
assertEquals("Britian", location.get("Country"));
-
+
StringMap<?> city = (StringMap<?>) location.get("City");
assertEquals("12345", city.get("PostalCode"));
assertEquals("Sample", city.get("CityName"));
}
-
- private static final String JSON_EMPLOYEE = "{" +
- " \"d\": {" +
-// " \"__metadata\": {" +
-// " \"id\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," +
-// " \"uri\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," +
-// " \"type\": \"RefScenario.Employee\"," +
-// " \"content_type\": \"application/octet-stream\"," +
-// " \"media_src\": \"Employees('1')/$value\"," +
-// " \"edit_media\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')/$value\"" +
-// " }," +
- " \"EmployeeId\": \"1\"," +
- " \"EmployeeName\": \"Douglas\"," +
- " \"Age\": 42," +
- " \"Location\": {" +
- " \"__metadata\": {" +
- " \"type\": \"RefScenario.c_Location\"" +
- " }," +
- " \"Country\": \"Britian\"," +
- " \"City\": {" +
- " \"__metadata\": {" +
- " \"type\": \"RefScenario.c_City\"" +
- " }," +
- " \"PostalCode\": \"12345\"," +
- " \"CityName\": \"Sample\"" +
- " }" +
- " }" +
- " }" +
+
+ private static final String JSON_EMPLOYEE = "{" +
+ " \"d\": {" +
+ // " \"__metadata\": {" +
+ // " \"id\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," +
+ // " \"uri\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," +
+ // " \"type\": \"RefScenario.Employee\"," +
+ // " \"content_type\": \"application/octet-stream\"," +
+ // " \"media_src\": \"Employees('1')/$value\"," +
+ // " \"edit_media\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')/$value\"" +
+ // " }," +
+ " \"EmployeeId\": \"1\"," +
+ " \"EmployeeName\": \"Douglas\"," +
+ " \"Age\": 42," +
+ " \"Location\": {" +
+ " \"__metadata\": {" +
+ " \"type\": \"RefScenario.c_Location\"" +
+ " }," +
+ " \"Country\": \"Britian\"," +
+ " \"City\": {" +
+ " \"__metadata\": {" +
+ " \"type\": \"RefScenario.c_City\"" +
+ " }," +
+ " \"PostalCode\": \"12345\"," +
+ " \"CityName\": \"Sample\"" +
+ " }" +
+ " }" +
+ " }" +
"}";
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
index 0a875e1..f7ec2ec 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
@@ -40,7 +40,7 @@ import org.junit.Test;
*
*/
public class ServiceJsonTest extends AbstractRefTest {
- public ServiceJsonTest(ServletType servletType) {
+ public ServiceJsonTest(final ServletType servletType) {
super(servletType);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
index d620f37..d0569bf 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
@@ -37,7 +37,7 @@ import org.xml.sax.SAXException;
*/
public class ServiceXmlTest extends AbstractRefXmlTest {
- public ServiceXmlTest(ServletType servletType) {
+ public ServiceXmlTest(final ServletType servletType) {
super(servletType);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
index 2906121..60baa9d 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
@@ -77,7 +77,6 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
private JPAEdmEntityTypeView jpaEdmEntityTypeView = null;
private JPAEdmComplexTypeView jpaEdmComplexTypeView = null;
-
@Override
public void build() throws ODataJPAModelException, ODataJPARuntimeException {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
index b763ded..33b47ea 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
@@ -21,9 +21,9 @@ package org.apache.olingo.odata2.jpa.processor.core.mock.model;
import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport;
-import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImportParameter;
import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport.ReturnType;
import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport.ReturnType.Type;
+import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImportParameter;
public class JPACustomProcessorNegativeMock {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
index 8086924..b43e448 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
@@ -430,7 +430,7 @@ public final class EntityProvider {
* @return read error document
* @throws EntityProviderException if reading of data (de-serialization) fails
*/
- ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType) throws EntityProviderException;
+ ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType) throws EntityProviderException;
}
/**
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
index bdc2156..c1a476d 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
@@ -120,14 +120,14 @@ public abstract class ODataMessageException extends ODataException {
*/
@Override
public String getMessage() {
- if(messageReference == null) {
+ if (messageReference == null) {
return "No message reference given. Inherit message is = '" + super.getMessage() + "'";
}
-
+
String message = RuntimeDelegate.extractExceptionMessage(this);
- if(message == null) {
+ if (message == null) {
return "Message Reference key = '" + messageReference.getKey() +
- "' and inherit message = '" + super.getMessage() + "'";
+ "' and inherit message = '" + super.getMessage() + "'";
}
return message;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
index 051270a..db500c6 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
@@ -232,7 +232,7 @@ public abstract class RuntimeDelegate {
* @param exception which contains the message references.
* @return the message of the {@link ODataMessageException}
*/
- public static String extractExceptionMessage(ODataMessageException exception) {
+ public static String extractExceptionMessage(final ODataMessageException exception) {
return RuntimeDelegate.getInstance().extractExceptionMessage(exception);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
index 3efa87b..3433186 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
@@ -34,7 +34,7 @@ public class XmlHelper {
public static XMLStreamReader createStreamReader(final Object content) throws EntityProviderException {
if (content == null) {
throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT
- .addContent("Got not allowed NULL parameter for creation of XMLStreamReader."));
+ .addContent("Got not allowed NULL parameter for creation of XMLStreamReader."));
}
XMLStreamReader streamReader;
try {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
index b893e14..4954c75 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
@@ -72,7 +72,7 @@ public class DebugInfoBody implements DebugInfo {
}
@Override
- public void appendJson(JsonStreamWriter jsonStreamWriter) throws IOException {
+ public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException {
if (isJson) {
jsonStreamWriter.unquotedValue(getContentString());
} else if (isText) {
@@ -100,7 +100,7 @@ public class DebugInfoBody implements DebugInfo {
}
@Override
- public void appendHtml(Writer writer) throws IOException {
+ public void appendHtml(final Writer writer) throws IOException {
final String body = getContentString();
if (isImage) {
writer.append("<img src=\"data:").append(response.getContentHeader()).append(";base64,")
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
index 4201ba1..e8f6c5a 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
@@ -92,7 +92,7 @@ public class DebugInfoException implements DebugInfo {
}
@Override
- public void appendHtml(Writer writer) throws IOException {
+ public void appendHtml(final Writer writer) throws IOException {
appendException(exception, writer);
writer.append("<h2>Stacktrace</h2>\n");
int count = 0;
@@ -101,7 +101,7 @@ public class DebugInfoException implements DebugInfo {
}
}
- private void appendException(final Throwable throwable, Writer writer) throws IOException {
+ private void appendException(final Throwable throwable, final Writer writer) throws IOException {
if (throwable.getCause() != null) {
appendException(throwable.getCause(), writer);
}
@@ -114,7 +114,7 @@ public class DebugInfoException implements DebugInfo {
}
private void appendStackTraceElement(final StackTraceElement stackTraceElement,
- final boolean isFirst, final boolean isLast, Writer writer) throws IOException {
+ 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")
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
index 62af105..15e6b2f 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
@@ -80,7 +80,7 @@ public class DebugInfoRequest implements DebugInfo {
}
@Override
- public void appendHtml(Writer writer) throws IOException {
+ 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")
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
index a2e1d42..1260803 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
@@ -53,7 +53,7 @@ public class DebugInfoResponse implements DebugInfo {
}
@Override
- public void appendJson(JsonStreamWriter jsonStreamWriter) throws IOException {
+ public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException {
jsonStreamWriter.beginObject();
if (status != null) {
@@ -84,7 +84,7 @@ public class DebugInfoResponse implements DebugInfo {
}
@Override
- public void appendHtml(Writer writer) throws IOException {
+ 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")
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
index 250a2b4..90fdd37 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
@@ -159,11 +159,11 @@ public class DebugInfoRuntime implements DebugInfo {
}
@Override
- public void appendHtml(Writer writer) throws IOException {
+ public void appendHtml(final Writer writer) throws IOException {
appendRuntimeNode(rootNode, "", true, writer);
}
- private void appendRuntimeNode(final RuntimeNode node, final String draw, final boolean isLast, Writer writer)
+ private void appendRuntimeNode(final RuntimeNode node, final String draw, final boolean isLast, final Writer writer)
throws IOException {
if (node.className != null) {
writer.append("<li>")
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
index 97d5646..ad1fd4a 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
@@ -63,7 +63,7 @@ public class DebugInfoServer implements DebugInfo {
}
@Override
- public void appendHtml(Writer writer) throws IOException {
+ public void appendHtml(final Writer writer) throws IOException {
writer.append("<h2>Server Environment</h2>\n");
ODataDebugResponseWrapper.appendHtmlTable(writer, environment);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
index daecc7a..eb6d8b6 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
@@ -76,7 +76,7 @@ public class DebugInfoUri implements DebugInfo {
}
@Override
- public void appendJson(JsonStreamWriter jsonStreamWriter) throws IOException {
+ public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException {
jsonStreamWriter.beginObject();
if (exception != null && exception.getFilterTree() != null) {
@@ -127,7 +127,7 @@ public class DebugInfoUri implements DebugInfo {
}
@Override
- public void appendHtml(Writer writer) throws IOException {
+ public void appendHtml(final Writer writer) throws IOException {
if (exception != null && exception.getFilterTree() != null) {
writer.append("<h2>Expression Information</h2>\n")
.append("<pre class=\"code\">").append(exception.getFilterTree().getUriLiteral())
@@ -162,7 +162,7 @@ public class DebugInfoUri implements DebugInfo {
}
}
- private void appendExpression(final CommonExpression expression, Writer writer) throws IOException {
+ private void appendExpression(final CommonExpression expression, final Writer writer) throws IOException {
final ExpressionKind kind = expression.getKind();
writer.append("<span class=\"kind\">")
.append(kind.toString())
@@ -200,7 +200,7 @@ public class DebugInfoUri implements DebugInfo {
}
}
- private void appendExpandSelect(final ExpandSelectTreeNode expandSelect, Writer writer) throws IOException {
+ private void appendExpandSelect(final ExpandSelectTreeNode expandSelect, final Writer writer) throws IOException {
writer.append("<ul class=\"expand\">\n")
.append("<li>");
if (expandSelect.isAll()) {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
index 5eae0e9..78fe62f 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
@@ -242,7 +242,7 @@ public class ODataDebugResponseWrapper {
return value == null ? null : value.replace("&", "&").replace("<", "<").replace(">", ">");
}
- protected static void appendJsonTable(JsonStreamWriter jsonStreamWriter, final Map<String, String> entries)
+ protected static void appendJsonTable(final JsonStreamWriter jsonStreamWriter, final Map<String, String> entries)
throws IOException {
jsonStreamWriter.beginObject();
boolean first = true;
@@ -260,7 +260,7 @@ public class ODataDebugResponseWrapper {
jsonStreamWriter.endObject();
}
- 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");
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
index 0aaae45..a05e9c3 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
@@ -38,18 +38,10 @@ public class EdmDouble extends AbstractSimpleType {
private static final int MAX_PRECISION = 15;
private static final int MAX_SCALE = 308;
-
private static final Pattern PATTERN = Pattern.compile(
"(?:\\+|-)?\\p{Digit}+(?:\\.\\p{Digit}+)?(?:(?:E|e)(?:\\+|-)?\\p{Digit}{1,3})?(D|d)?");
private static final EdmDouble instance = new EdmDouble();
-
-
-
-
-
-
-
public static EdmDouble getInstance() {
return instance;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index d21cec4..9eb1a8f 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -23,6 +23,10 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
import org.apache.olingo.odata2.api.edm.Edm;
import org.apache.olingo.odata2.api.ep.EntityProviderException;
import org.apache.olingo.odata2.api.processor.ODataErrorContext;
@@ -30,10 +34,6 @@ import org.apache.olingo.odata2.core.commons.ContentType;
import org.apache.olingo.odata2.core.commons.XmlHelper;
import org.apache.olingo.odata2.core.ep.util.FormatXml;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
/**
* Consuming (read / deserialization) for OData error document in XML format.
*/
@@ -65,7 +65,7 @@ public class XmlErrorDocumentConsumer {
return parserError(reader);
} catch (XMLStreamException e) {
cachedException = new EntityProviderException(EntityProviderException.INVALID_STATE.addContent(
- e.getMessage()), e);
+ e.getMessage()), e);
throw cachedException;
} catch (EntityProviderException e) {
cachedException = e;
@@ -79,15 +79,15 @@ public class XmlErrorDocumentConsumer {
throw cachedException;
} else {
throw new EntityProviderException(
- EntityProviderException.EXCEPTION_OCCURRED.addContent(
- e.getClass().getSimpleName()), e);
+ EntityProviderException.EXCEPTION_OCCURRED.addContent(
+ e.getClass().getSimpleName()), e);
}
}
}
}
}
- private ODataErrorContext parserError(XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
+ private ODataErrorContext parserError(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
// read xml tag
reader.require(XMLStreamConstants.START_DOCUMENT, null, null);
reader.nextTag();
@@ -99,21 +99,21 @@ public class XmlErrorDocumentConsumer {
boolean codeFound = false;
boolean messageFound = false;
ODataErrorContext errorContext = new ODataErrorContext();
- while(notFinished(reader)) {
+ while (notFinished(reader)) {
reader.nextTag();
- if(reader.isStartElement()) {
+ if (reader.isStartElement()) {
String name = reader.getLocalName();
- if(FormatXml.M_CODE.equals(name)) {
+ if (FormatXml.M_CODE.equals(name)) {
codeFound = true;
handleCode(reader, errorContext);
- } else if(FormatXml.M_MESSAGE.equals(name)) {
+ } else if (FormatXml.M_MESSAGE.equals(name)) {
messageFound = true;
handleMessage(reader, errorContext);
- } else if(FormatXml.M_INNER_ERROR.equals(name)) {
+ } else if (FormatXml.M_INNER_ERROR.equals(name)) {
handleInnerError(reader, errorContext);
} else {
throw new EntityProviderException(
- EntityProviderException.INVALID_CONTENT.addContent(name, FormatXml.M_ERROR));
+ EntityProviderException.INVALID_CONTENT.addContent(name, FormatXml.M_ERROR));
}
}
}
@@ -123,34 +123,34 @@ public class XmlErrorDocumentConsumer {
return errorContext;
}
- private void validate(boolean codeFound, boolean messageFound) throws EntityProviderException {
+ private void validate(final boolean codeFound, final boolean messageFound) throws EntityProviderException {
if (!codeFound) {
throw new EntityProviderException(
- EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'code' property not found.'"));
+ EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'code' property not found.'"));
} else if (!messageFound) {
throw new EntityProviderException(
- EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'message' property not found.'"));
+ EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'message' property not found.'"));
}
}
- private boolean notFinished(XMLStreamReader reader) throws XMLStreamException {
+ private boolean notFinished(final XMLStreamReader reader) throws XMLStreamException {
boolean finished = reader.isEndElement() && FormatXml.M_ERROR.equals(reader.getLocalName());
return !finished && reader.hasNext();
}
- private void handleInnerError(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+ private void handleInnerError(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
String innerError = reader.getElementText();
errorContext.setInnerError(innerError);
}
- private void handleMessage(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+ private void handleMessage(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
String lang = reader.getAttributeValue(Edm.NAMESPACE_XML_1998, FormatXml.XML_LANG);
errorContext.setLocale(getLocale(lang));
String message = reader.getElementText();
errorContext.setMessage(message);
}
- private void handleCode(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+ private void handleCode(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
String code = reader.getElementText();
errorContext.setErrorCode(code);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
index 96c3b93..2c207bb 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
@@ -144,7 +144,7 @@ public final class ODataSubLocator {
ODataContextImpl context = new ODataContextImpl(request, serviceFactory);
context.setParameter(ODataContext.HTTP_SERVLET_REQUEST_OBJECT, httpRequest);
-
+
ODataService service = serviceFactory.createService(context);
service.getProcessor().setContext(context);
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
index 8c1852e..dbe2935 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
@@ -176,7 +176,7 @@ public class ODataServlet extends HttpServlet {
ODataService service = serviceFactory.createService(context);
context.setService(service);
service.getProcessor().setContext(context);
-
+
ODataRequestHandler requestHandler = new ODataRequestHandler(serviceFactory, service, context);
final ODataResponse odataResponse = requestHandler.handle(odataRequest);
createResponse(resp, odataResponse);
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
index 58577aa..e5236d4 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
@@ -252,13 +252,13 @@ public class ProviderFacadeImplTest extends AbstractConsumerTest {
public void readErrorDocumentXml() throws EntityProviderException {
ProviderFacadeImpl providerFacade = new ProviderFacadeImpl();
String errorDoc =
- "<?xml version='1.0' encoding='UTF-8'?>\n" +
+ "<?xml version='1.0' encoding='UTF-8'?>\n" +
"<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
"\t<code>ErrorCode</code>\n" +
"\t<message xml:lang=\"en-US\">Message</message>\n" +
"</error>";
ODataErrorContext errorContext = providerFacade.readErrorDocument(StringHelper.encapsulate(errorDoc),
- ContentType.APPLICATION_XML.toContentTypeString());
+ ContentType.APPLICATION_XML.toContentTypeString());
//
assertEquals("Wrong content type", "application/xml", errorContext.getContentType());
assertEquals("Wrong message", "Message", errorContext.getMessage());
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
index 4f4dc2b..a98044e 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
@@ -18,11 +18,31 @@
******************************************************************************/
package org.apache.olingo.odata2.core.exception;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Locale;
+
import org.apache.olingo.odata2.api.edm.EdmException;
import org.apache.olingo.odata2.api.edm.EdmLiteralException;
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeException;
import org.apache.olingo.odata2.api.ep.EntityProviderException;
-import org.apache.olingo.odata2.api.exception.*;
+import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
+import org.apache.olingo.odata2.api.exception.ODataConflictException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.exception.ODataForbiddenException;
+import org.apache.olingo.odata2.api.exception.ODataHttpException;
+import org.apache.olingo.odata2.api.exception.ODataMessageException;
+import org.apache.olingo.odata2.api.exception.ODataMethodNotAllowedException;
+import org.apache.olingo.odata2.api.exception.ODataNotAcceptableException;
+import org.apache.olingo.odata2.api.exception.ODataNotFoundException;
+import org.apache.olingo.odata2.api.exception.ODataNotImplementedException;
+import org.apache.olingo.odata2.api.exception.ODataPreconditionFailedException;
+import org.apache.olingo.odata2.api.exception.ODataPreconditionRequiredException;
+import org.apache.olingo.odata2.api.exception.ODataServiceUnavailableException;
+import org.apache.olingo.odata2.api.exception.ODataUnsupportedMediaTypeException;
import org.apache.olingo.odata2.api.uri.UriNotMatchingException;
import org.apache.olingo.odata2.api.uri.UriSyntaxException;
import org.apache.olingo.odata2.api.uri.expression.ExceptionVisitExpression;
@@ -35,10 +55,6 @@ import org.apache.olingo.odata2.testutil.fit.BaseTest;
import org.apache.olingo.odata2.testutil.helper.ODataMessageTextVerifier;
import org.junit.Test;
-import java.util.Locale;
-
-import static org.junit.Assert.*;
-
/**
*
*/
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
index 2beed3c..73b88aa 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
@@ -30,7 +30,7 @@ import com.google.gson.reflect.TypeToken;
*/
@Ignore("no test methods")
public class AbstractRefJsonTest extends AbstractRefTest {
-
+
public AbstractRefJsonTest(final ServletType servletType) {
super(servletType);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
index c4677a1..8533e42 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
@@ -197,7 +197,7 @@ public class BasicContentNegotiationTest extends AbstractContentNegotiationTest
final HttpResponse response = new DefaultHttpClient().execute(get);
final String contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
-// assertEquals(expectedResponseContentType, contentType);
+ // assertEquals(expectedResponseContentType, contentType);
try {
assertEquals(ContentType.APPLICATION_XML, ContentType.create(contentType));
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
index 47fb03a..7345c84 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
@@ -47,13 +47,10 @@ public abstract class AbstractFitTest extends BaseTest {
private final HttpClient httpClient = new DefaultHttpClient();
- private ServletType servletType;
-
- public AbstractFitTest(ServletType servletType) {
- this.servletType = servletType;
+ public AbstractFitTest(final ServletType servletType) {
server = new TestServer(this.getClass().getSimpleName(), servletType);
}
-
+
@Parameterized.Parameters
public static List<Object[]> data() {
// If desired this can be made dependent on runtime variables
@@ -65,8 +62,8 @@ public abstract class AbstractFitTest extends BaseTest {
return Arrays.asList(a);
}
-// public AbstractFitTest() {
-// }
+ // public AbstractFitTest() {
+ // }
protected URI getEndpoint() {
return server.getEndpoint();
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
index 4d1bd6f..8fcf979 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
@@ -73,7 +73,7 @@ public class FitStaticServiceFactory extends ODataServiceFactory {
assertNotNull(ctx);
assertNotNull(ctx.getAcceptableLanguages());
assertNotNull(ctx.getParameter(ODataContext.HTTP_SERVLET_REQUEST_OBJECT));
-
+
final Map<String, List<String>> requestHeaders = ctx.getRequestHeaders();
final String host = requestHeaders.get("Host").get(0);
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
index 05b9f0f..87e57ca 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
@@ -54,17 +54,17 @@ public class TestServer {
private int pathSplit = 0;
private ServletType servletType;
- public TestServer(ServletType type) {
+ public TestServer(final ServletType type) {
this(DEFAULT_PATH, type);
- }
-
- public TestServer(final String path, ServletType type) {
+ }
+
+ public TestServer(final String path, final ServletType type) {
if (path.startsWith("/")) {
this.path = path;
} else {
this.path = "/" + path;
}
- this.servletType = type;
+ servletType = type;
}
public int getPathSplit() {
@@ -154,22 +154,22 @@ public class TestServer {
return contextHandler;
}
-// private ServletContextHandler createODataContextHandler(final Class<? extends ODataServiceFactory> factoryClass)
-// throws InstantiationException, IllegalAccessException, ClassNotFoundException {
-// String odataServlet = "org.apache.olingo.odata2.core.servlet.ODataServlet";
-// final HttpServlet httpServlet = (HttpServlet) Class.forName(odataServlet).newInstance();
-// final ServletHolder odataServletHolder = new ServletHolder(httpServlet);
-// odataServletHolder.setInitParameter(ODataServiceFactory.FACTORY_LABEL, factoryClass.getCanonicalName());
-//
-// if (pathSplit > 0) {
-// odataServletHolder.setInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL, Integer.toString(pathSplit));
-// }
-//
-// final ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
-// contextHandler.setContextPath("/abc");
-// contextHandler.addServlet(odataServletHolder, path + "/*");
-// return contextHandler;
-// }
+ // private ServletContextHandler createODataContextHandler(final Class<? extends ODataServiceFactory> factoryClass)
+ // throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+ // String odataServlet = "org.apache.olingo.odata2.core.servlet.ODataServlet";
+ // final HttpServlet httpServlet = (HttpServlet) Class.forName(odataServlet).newInstance();
+ // final ServletHolder odataServletHolder = new ServletHolder(httpServlet);
+ // odataServletHolder.setInitParameter(ODataServiceFactory.FACTORY_LABEL, factoryClass.getCanonicalName());
+ //
+ // if (pathSplit > 0) {
+ // odataServletHolder.setInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL, Integer.toString(pathSplit));
+ // }
+ //
+ // final ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ // contextHandler.setContextPath("/abc");
+ // contextHandler.addServlet(odataServletHolder, path + "/*");
+ // return contextHandler;
+ // }
public void startServer(final ODataService service) {
startServer(FitStaticServiceFactory.class);