Repository: olingo-odata2 Updated Branches: refs/heads/master f829d06db -> b33cdc411
[OLINGO-1139] - Merge of GitHub pull request (about typos) Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/b33cdc41 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/b33cdc41 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/b33cdc41 Branch: refs/heads/master Commit: b33cdc411ac8731162266ebb19ae97a90ca88be9 Parents: f829d06 Author: mibo <[email protected]> Authored: Thu Jun 15 07:00:13 2017 +0200 Committer: mibo <[email protected]> Committed: Thu Jun 15 07:00:13 2017 +0200 ---------------------------------------------------------------------- .../core/access/data/JPAFunctionContext.java | 32 ++++++++------------ 1 file changed, 13 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b33cdc41/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAFunctionContext.java ---------------------------------------------------------------------- diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAFunctionContext.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAFunctionContext.java index 0e7630f..2dfb933 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAFunctionContext.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAFunctionContext.java @@ -46,15 +46,15 @@ public class JPAFunctionContext extends JPAMethodContext { public class JPAFunctionContextBuilder extends JPAMethodContextBuilder { - protected GetFunctionImportUriInfo functiontView; + protected GetFunctionImportUriInfo functionView; private EdmFunctionImport functionImport; private EdmMapping mapping; @Override public JPAMethodContext build() throws ODataJPAModelException, ODataJPARuntimeException { - if (functiontView != null) { + if (functionView != null) { - functionImport = functiontView.getFunctionImport(); + functionImport = functionView.getFunctionImport(); try { mapping = functionImport.getMapping(); @@ -85,7 +85,7 @@ public class JPAFunctionContext extends JPAMethodContext { @Override protected void setResultsView(final Object resultsView) { if (resultsView instanceof GetFunctionImportUriInfo) { - functiontView = (GetFunctionImportUriInfo) resultsView; + functionView = (GetFunctionImportUriInfo) resultsView; } } @@ -96,35 +96,32 @@ public class JPAFunctionContext extends JPAMethodContext { Class<?>[] parameterTypes = getParameterTypes(); Method method = getMethod(parameterTypes); Type returnType = getReturnType(); - Object[] args = getAruguments(); + Object[] args = getArguments(); - JPAFunction jpafunction = new JPAFunction(method, parameterTypes, returnType, args); - - return jpafunction; + return new JPAFunction(method, parameterTypes, returnType, args); } - private Object[] getAruguments() throws EdmException { - Map<String, EdmLiteral> edmArguements = functiontView.getFunctionImportParameters(); + private Object[] getArguments() throws EdmException { + Map<String, EdmLiteral> edmArguments = functionView.getFunctionImportParameters(); - if (edmArguements == null) { + if (edmArguments == null) { return null; } else { Collection<String> paramNames = functionImport.getParameterNames(); Object[] args = new Object[paramNames.size()]; int i = 0; for (String paramName : functionImport.getParameterNames()) { - EdmLiteral literal = edmArguements.get(paramName); + EdmLiteral literal = edmArguments.get(paramName); EdmParameter parameter = functionImport.getParameter(paramName); JPAEdmMapping mapping = (JPAEdmMapping) parameter.getMapping(); - args[i] = convertArguement(literal, parameter.getFacets(), mapping.getJPAType()); - i++; + args[i++] = convertArgument(literal, parameter.getFacets(), mapping.getJPAType()); } return args; } } - private Object convertArguement(final EdmLiteral edmLiteral, final EdmFacets facets, final Class<?> targetType) + private Object convertArgument(final EdmLiteral edmLiteral, final EdmFacets facets, final Class<?> targetType) throws EdmSimpleTypeException { Object value = null; if (edmLiteral != null) { @@ -140,8 +137,7 @@ public class JPAFunctionContext extends JPAMethodContext { int i = 0; for (String parameterName : functionImport.getParameterNames()) { EdmParameter parameter = functionImport.getParameter(parameterName); - parameterTypes[i] = ((JPAEdmMapping) parameter.getMapping()).getJPAType(); - i++; + parameterTypes[i++] = ((JPAEdmMapping) parameter.getMapping()).getJPAType(); } return parameterTypes; @@ -167,8 +163,6 @@ public class JPAFunctionContext extends JPAMethodContext { Object[] params = null; return type.getConstructor((Class<?>[]) params).newInstance(params); - } - } }
