Skip to content
Permalink
Browse files

[OLINGO-1391]Code Improvements

  • Loading branch information...
ramya vasanth
ramya vasanth committed Sep 13, 2019
1 parent 8f4d031 commit 6c2103ccd4fce21b1270bad52c72c01627d39ea4
Showing with 189 additions and 199 deletions.
  1. +7 −7 lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java
  2. +9 −9 lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSchemaImpl.java
  3. +1 −1 lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTermImpl.java
  4. +1 −1 lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/FunctionMapKey.java
  5. +1 −1 lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmApplyImpl.java
  6. +1 −1 lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCollectionImpl.java
  7. +1 −1 ...s-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantExpressionImpl.java
  8. +1 −1 lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmRecordImpl.java
  9. +8 −8 ...s-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
  10. +3 −3 lib/server-api/src/main/java/org/apache/olingo/server/api/HttpHeaders.java
  11. +2 −2 lib/server-api/src/main/java/org/apache/olingo/server/api/deserializer/batch/BatchRequestPart.java
  12. +2 −2 lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java
  13. +1 −1 lib/server-core-ext/src/main/java/org/apache/olingo/server/core/MetadataParser.java
  14. +9 −9 lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java
  15. +1 −3 lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ServiceDispatcher.java
  16. +1 −1 lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ServiceRequest.java
  17. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerImpl.java
  18. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
  19. +3 −3 lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
  20. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java
  21. +1 −1 ...in/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java
  22. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java
  23. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabResponse.java
  24. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabRuntime.java
  25. +2 −2 lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugTabUri.java
  26. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java
  27. +2 −2 lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/DeserializerResultImpl.java
  28. +3 −3 lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchBodyPart.java
  29. +2 −2 lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchLineReader.java
  30. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java
  31. +3 −3 ...server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParserCommon.java
  32. +2 −2 ...ore/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestTransformator.java
  33. +6 −6 lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/Header.java
  34. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HeaderField.java
  35. +1 −1 ...er-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLine.java
  36. +1 −1 ...r-core/src/main/java/org/apache/olingo/server/core/deserializer/helper/ExpandTreeBuilderImpl.java
  37. +14 −14 ...ver-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
  38. +2 −2 lib/server-core/src/main/java/org/apache/olingo/server/core/etag/ETagParser.java
  39. +3 −3 lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferParser.java
  40. +4 −4 lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializer.java
  41. +2 −2 ...c/main/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerWithNavigations.java
  42. +10 −10 ...e/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java
  43. +4 −8 lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
  44. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java
  45. +6 −6 lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
  46. +13 −13 lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java
  47. +3 −3 ...ore/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java
  48. +1 −5 lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
  49. +5 −5 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
  50. +2 −2 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ApplyParser.java
  51. +6 −6 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java
  52. +9 −9 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ParserHelper.java
  53. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ResourcePathParser.java
  54. +2 −2 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/SelectParser.java
  55. +3 −3 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/UriDecoder.java
  56. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java
  57. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/ExpandOptionImpl.java
  58. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/OrderByOptionImpl.java
  59. +1 −1 ...re/src/main/java/org/apache/olingo/server/core/uri/queryoption/apply/AggregateExpressionImpl.java
  60. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/apply/AggregateImpl.java
  61. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/apply/ComputeImpl.java
  62. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/apply/ConcatImpl.java
  63. +2 −2 ...core/src/main/java/org/apache/olingo/server/core/uri/queryoption/apply/DynamicStructuredType.java
  64. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/apply/GroupByImpl.java
  65. +1 −1 ...erver-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/apply/GroupByItemImpl.java
  66. +1 −1 ...erver-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/BinaryImpl.java
  67. +1 −1 ...erver-core/src/main/java/org/apache/olingo/server/core/uri/queryoption/expression/MethodImpl.java
  68. +1 −1 lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
@@ -409,7 +409,7 @@ private void removeAnnotationsAddedToCTNavPropFromES(CsdlStructuralType structur
try {
CsdlEntityType entType = provider.getEntityType(entitySet.getTypeFQN());
List<CsdlProperty> entTypeProperties = null != entType ?
entType.getProperties() : new ArrayList<CsdlProperty>();
entType.getProperties() : new ArrayList<>();
for (CsdlProperty entTypeProperty : entTypeProperties) {
if (null != entTypeProperty.getType() &&
entTypeProperty.getType().equalsIgnoreCase(typeName.getFullQualifiedNameAsString())) {
@@ -465,7 +465,7 @@ private void updateAnnotationsOnStructuralProperties(CsdlStructuralType structur
String schemaName = null;
String entitySetName = null;
List<CsdlEntitySet> entitySets = null != csdlEntityContainer ?
csdlEntityContainer.getEntitySets() : new ArrayList<CsdlEntitySet>();
csdlEntityContainer.getEntitySets() : new ArrayList<>();
if (structuralType instanceof CsdlComplexType) {
removeAnnotationsAddedToCTTypePropFromES(structuralType, typeName, csdlEntityContainer, properties, entitySets);
} else {
@@ -551,7 +551,7 @@ private void removeAnnotationsAddedToCTTypePropFromES(CsdlStructuralType structu
try {
CsdlEntityType entType = provider.getEntityType(entitySet.getTypeFQN());
List<CsdlProperty> entTypeProperties = null != entType ?
entType.getProperties() : new ArrayList<CsdlProperty>();
entType.getProperties() : new ArrayList<>();
for (CsdlProperty entTypeProperty : entTypeProperties) {
if (null != entTypeProperty.getType() &&
entTypeProperty.getType().endsWith(DOT + structuralType.getName())) {
@@ -792,7 +792,7 @@ public EdmFunction createBoundFunction(final FullQualifiedName functionName,

@Override
protected Map<String, String> createAliasToNamespaceInfo() {
final Map<String, String> aliasToNamespaceInfos = new HashMap<String, String>();
final Map<String, String> aliasToNamespaceInfos = new HashMap<>();
try {
final List<CsdlAliasInfo> aliasInfos = provider.getAliasInfos();
if (aliasInfos != null) {
@@ -833,7 +833,7 @@ protected EdmAction createUnboundAction(final FullQualifiedName actionName) {

@Override
protected List<EdmFunction> createUnboundFunctions(final FullQualifiedName functionName) {
List<EdmFunction> result = new ArrayList<EdmFunction>();
List<EdmFunction> result = new ArrayList<>();

try {
List<CsdlFunction> functions = functionsMap.get(functionName);
@@ -880,7 +880,7 @@ protected EdmFunction createUnboundFunction(final FullQualifiedName functionName
providerParameters = Collections.emptyList();
}
if (parameterNamesCopy.size() == providerParameters.size()) {
final List<String> functionParameterNames = new ArrayList<String>();
final List<String> functionParameterNames = new ArrayList<>();
for (CsdlParameter parameter : providerParameters) {
functionParameterNames.add(parameter.getName());
}
@@ -902,7 +902,7 @@ protected EdmFunction createUnboundFunction(final FullQualifiedName functionName
@Override
protected Map<String, EdmSchema> createSchemas() {
try {
final Map<String, EdmSchema> providerSchemas = new LinkedHashMap<String, EdmSchema>();
final Map<String, EdmSchema> providerSchemas = new LinkedHashMap<>();
List<CsdlSchema> localSchemas = provider.getSchemas();
if (localSchemas != null) {
for (CsdlSchema schema : localSchemas) {
@@ -162,7 +162,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmTypeDefinition> createTypeDefinitions() {
final List<EdmTypeDefinition> typeDefns = new ArrayList<EdmTypeDefinition>();
final List<EdmTypeDefinition> typeDefns = new ArrayList<>();
final List<CsdlTypeDefinition> providerTypeDefinitions = schema.getTypeDefinitions();
if (providerTypeDefinitions != null) {
for (CsdlTypeDefinition def : providerTypeDefinitions) {
@@ -177,7 +177,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmEnumType> createEnumTypes() {
final List<EdmEnumType> enumTyps = new ArrayList<EdmEnumType>();
final List<EdmEnumType> enumTyps = new ArrayList<>();
final List<CsdlEnumType> providerEnumTypes = schema.getEnumTypes();
if (providerEnumTypes != null) {
for (CsdlEnumType enumType : providerEnumTypes) {
@@ -192,7 +192,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmEntityType> createEntityTypes() {
final List<EdmEntityType> edmEntityTypes = new ArrayList<EdmEntityType>();
final List<EdmEntityType> edmEntityTypes = new ArrayList<>();
final List<CsdlEntityType> providerEntityTypes = schema.getEntityTypes();
if (providerEntityTypes != null) {
for (CsdlEntityType entityType : providerEntityTypes) {
@@ -207,7 +207,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmComplexType> createComplexTypes() {
final List<EdmComplexType> edmComplexTypes = new ArrayList<EdmComplexType>();
final List<EdmComplexType> edmComplexTypes = new ArrayList<>();
final List<CsdlComplexType> providerComplexTypes = schema.getComplexTypes();
if (providerComplexTypes != null) {
for (CsdlComplexType complexType : providerComplexTypes) {
@@ -222,7 +222,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmAction> createActions() {
final List<EdmAction> edmActions = new ArrayList<EdmAction>();
final List<EdmAction> edmActions = new ArrayList<>();
final List<CsdlAction> providerActions = schema.getActions();
if (providerActions != null) {
for (CsdlAction action : providerActions) {
@@ -237,7 +237,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmFunction> createFunctions() {
final List<EdmFunction> edmFunctions = new ArrayList<EdmFunction>();
final List<EdmFunction> edmFunctions = new ArrayList<>();
final List<CsdlFunction> providerFunctions = schema.getFunctions();
if (providerFunctions != null) {
for (CsdlFunction function : providerFunctions) {
@@ -252,7 +252,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmTerm> createTerms() {
final List<EdmTerm> edmTerms = new ArrayList<EdmTerm>();
final List<EdmTerm> edmTerms = new ArrayList<>();
final List<CsdlTerm> providerTerms = schema.getTerms();
if (providerTerms != null) {
for (CsdlTerm term : providerTerms) {
@@ -266,7 +266,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmAnnotations> createAnnotationGroups() {
final List<EdmAnnotations> edmAnnotationGroups = new ArrayList<EdmAnnotations>();
final List<EdmAnnotations> edmAnnotationGroups = new ArrayList<>();
final List<CsdlAnnotations> providerAnnotations =
schema.getAnnotationGroups();
if (providerAnnotations != null) {
@@ -286,7 +286,7 @@ protected EdmEntityContainer createEntityContainer() {
}

protected List<EdmAnnotation> createAnnotations() {
final List<EdmAnnotation> edmAnnotations = new ArrayList<EdmAnnotation>();
final List<EdmAnnotation> edmAnnotations = new ArrayList<>();
final List<CsdlAnnotation> providerAnnotations =
schema.getAnnotations();
if (providerAnnotations != null) {
@@ -75,7 +75,7 @@ public EdmTerm getBaseTerm() {
@Override
public List<TargetType> getAppliesTo() {
if (appliesTo == null) {
ArrayList<TargetType> localAppliesTo = new ArrayList<TargetType>();
ArrayList<TargetType> localAppliesTo = new ArrayList<>();
for (String apply : term.getAppliesTo()) {
try {
localAppliesTo.add(TargetType.valueOf(apply));
@@ -45,7 +45,7 @@ public FunctionMapKey(final FullQualifiedName functionName, final FullQualifiedN
}
this.bindingParameterTypeName = bindingParameterTypeName;
this.isBindingParameterCollection = isBindingParameterCollection;
this.parameterNames = new ArrayList<String>();
this.parameterNames = new ArrayList<>();
if (parameterNames != null) {
this.parameterNames.addAll(parameterNames);
Collections.sort(this.parameterNames);
@@ -55,7 +55,7 @@ public String getFunction() {
@Override
public List<EdmExpression> getParameters() {
if (parameters == null) {
List<EdmExpression> localParameters = new ArrayList<EdmExpression>();
List<EdmExpression> localParameters = new ArrayList<>();
if (csdlExp.getParameters() != null) {
for (CsdlExpression param : csdlExp.getParameters()) {
localParameters.add(getExpression(edm, param));
@@ -41,7 +41,7 @@ public EdmCollectionImpl(Edm edm, CsdlCollection csdlExp) {
@Override
public List<EdmExpression> getItems() {
if (items == null) {
List<EdmExpression> localItems = new ArrayList<EdmExpression>();
List<EdmExpression> localItems = new ArrayList<>();
if (csdlCollection.getItems() != null) {
for (CsdlExpression item : csdlCollection.getItems()) {
localItems.add(getExpression(edm, item));
@@ -58,7 +58,7 @@ private void build() {
if (csdlExp.getValue() == null) {
throw new EdmException("Expression value must not be null");
}
final List<String> localEnumValues = new ArrayList<String>();
final List<String> localEnumValues = new ArrayList<>();
for (String split : csdlExp.getValue().split(" ")) {
final String[] enumSplit = split.split("/");
if (enumSplit.length != 2) {
@@ -45,7 +45,7 @@ public EdmRecordImpl(final Edm edm, CsdlRecord csdlExp) {
@Override
public List<EdmPropertyValue> getPropertyValues() {
if (propertyValues == null) {
List<EdmPropertyValue> localValues = new ArrayList<EdmPropertyValue>();
List<EdmPropertyValue> localValues = new ArrayList<>();
if (record.getPropertyValues() != null) {
for (CsdlPropertyValue value : record.getPropertyValues()) {
localValues.add(new EdmPropertyValueImpl(edm, value));
@@ -117,7 +117,7 @@ protected MultiPoint stringToMultiPoint(final String value, final Boolean isNull

final Matcher matcher = getMatcher(PATTERN, value);

final List<Point> points = new ArrayList<Point>();
final List<Point> points = new ArrayList<>();
for (final String pointCoo : split(matcher.group(4), ',')) {
points.add(newPoint(null, pointCoo.substring(1, pointCoo.length() - 1),
isNullable, maxLength, precision, scale, isUnicode));
@@ -130,7 +130,7 @@ private LineString newLineString(final SRID srid, final String lineString, final
final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode)
throws EdmPrimitiveTypeException {

final List<Point> points = new ArrayList<Point>();
final List<Point> points = new ArrayList<>();
for (final String pointCoo : split(lineString, ',')) {
points.add(newPoint(null, pointCoo, isNullable, maxLength, precision, scale, isUnicode));
}
@@ -153,7 +153,7 @@ protected MultiLineString stringToMultiLineString(final String value, final Bool

final Matcher matcher = getMatcher(PATTERN, value);

final List<LineString> lineStrings = new ArrayList<LineString>();
final List<LineString> lineStrings = new ArrayList<>();
for (String coo : matcher.group(4).contains("),(")
? matcher.group(4).split("\\),\\(") : new String[] { matcher.group(4) }) {

@@ -177,7 +177,7 @@ private Polygon newPolygon(final SRID srid, final String polygon, final Boolean

final String[] first = polygon.split("\\),\\(");

final List<LineString> interiorRings = new ArrayList<LineString>();
final List<LineString> interiorRings = new ArrayList<>();
for (int i = 0; i < first.length -1; i++) {
List<Point> interior = new ArrayList<Point>();
for (final String pointCoo : split(first[i].substring(i==0?1:0, first[i].length()), ',')) {
@@ -207,7 +207,7 @@ protected MultiPolygon stringToMultiPolygon(final String value, final Boolean is

final Matcher matcher = getMatcher(PATTERN, value);

final List<Polygon> polygons = new ArrayList<Polygon>();
final List<Polygon> polygons = new ArrayList<>();
for (String coo : matcher.group(4).contains(")),((") ?
matcher.group(4).split("\\)\\),\\(\\(") :
new String[] { matcher.group(4) }) {
@@ -246,7 +246,7 @@ protected GeospatialCollection stringToCollection(final String value, final Bool
break;

case MULTIPOINT:
final List<Point> points = new ArrayList<Point>();
final List<Point> points = new ArrayList<>();
for (final String pointCoo : split(matcher.group(4), ',')) {
points.add(newPoint(null, pointCoo.substring(1, pointCoo.length() - 1),
isNullable, maxLength, precision, scale, isUnicode));
@@ -261,7 +261,7 @@ protected GeospatialCollection stringToCollection(final String value, final Bool
break;

case MULTILINESTRING:
final List<LineString> lineStrings = new ArrayList<LineString>();
final List<LineString> lineStrings = new ArrayList<>();
for (final String coo : split(matcher.group(4), ',')) {
lineStrings.add(newLineString(null, coo.substring(1, coo.length() - 1),
isNullable, maxLength, precision, scale, isUnicode));
@@ -276,7 +276,7 @@ protected GeospatialCollection stringToCollection(final String value, final Bool
break;

case MULTIPOLYGON:
final List<Polygon> polygons = new ArrayList<Polygon>();
final List<Polygon> polygons = new ArrayList<>();
for (final String coo : split(matcher.group(4), ',')) {
polygons.add(newPolygon(null, coo.substring(1, coo.length() - 1),
isNullable, maxLength, precision, scale, isUnicode));
@@ -31,7 +31,7 @@
* @see ODataResponse
*/
final class HttpHeaders {
private final Map<String, List<String>> headers = new LinkedHashMap<String, List<String>>();
private final Map<String, List<String>> headers = new LinkedHashMap<>();

/**
* Adds a header with given name and value.
@@ -44,7 +44,7 @@ public HttpHeaders addHeader(final String name, final String value) {
final String canonicalName = getCanonicalName(name);
List<String> header = headers.get(canonicalName);
if (header == null) {
header = new ArrayList<String>();
header = new ArrayList<>();
}
header.add(value);
headers.put(canonicalName, header);
@@ -62,7 +62,7 @@ public HttpHeaders addHeader(final String name, final List<String> values) {
final String canonicalName = getCanonicalName(name);
List<String> header = headers.get(canonicalName);
if (header == null) {
header = new ArrayList<String>();
header = new ArrayList<>();
}
header.addAll(values);
headers.put(canonicalName, header);
@@ -28,7 +28,7 @@
* Represents a distinct MIME part of a Batch Request body - either a Change Set or a Query Operation
*/
public class BatchRequestPart {
private List<ODataRequest> requests = new ArrayList<ODataRequest>();
private List<ODataRequest> requests = new ArrayList<>();
private boolean isChangeSet;

/**
@@ -48,7 +48,7 @@ public BatchRequestPart(final boolean isChangeSet, final List<ODataRequest> requ
*/
public BatchRequestPart(final boolean isChangeSet, final ODataRequest request) {
this.isChangeSet = isChangeSet;
requests = new ArrayList<ODataRequest>();
requests = new ArrayList<>();
requests.add(request);
}

@@ -35,11 +35,11 @@
*/
public final class PreferencesApplied {

private static final Set<String> SAFE_PREFERENCE_NAMES = new HashSet<String>();
private static final Set<String> SAFE_PREFERENCE_NAMES = new HashSet<>();
private Map<String, String> applied;

private PreferencesApplied() {
applied = new LinkedHashMap<String, String>();
applied = new LinkedHashMap<>();
}

/**
@@ -103,7 +103,7 @@
private boolean useLocalCoreVocabularies = true;
private boolean implicitlyLoadCoreVocabularies = false;
private boolean recursivelyLoadReferences = false;
private Map<String, SchemaBasedEdmProvider> globalReferenceMap = new HashMap<String, SchemaBasedEdmProvider>();
private Map<String, SchemaBasedEdmProvider> globalReferenceMap = new HashMap<>();

/**
* Avoid reading the annotations in the $metadata
@@ -48,19 +48,19 @@
import org.apache.olingo.commons.api.ex.ODataException;

public class SchemaBasedEdmProvider implements CsdlEdmProvider {
private final List<CsdlSchema> edmSchemas = new ArrayList<CsdlSchema>();
private final Map<String, EdmxReference> references = new ConcurrentHashMap<String, EdmxReference>();
private final List<CsdlSchema> edmSchemas = new ArrayList<>();
private final Map<String, EdmxReference> references = new ConcurrentHashMap<>();
private final Map<String, SchemaBasedEdmProvider> referenceSchemas =
new ConcurrentHashMap<String, SchemaBasedEdmProvider>();
new ConcurrentHashMap<>();
private final Map<String, SchemaBasedEdmProvider> coreVocabularySchemas =
new ConcurrentHashMap<String, SchemaBasedEdmProvider>();
new ConcurrentHashMap<>();

protected void addSchema(CsdlSchema schema) {
this.edmSchemas.add(schema);
}

public List<EdmxReference> getReferences(){
return new ArrayList<EdmxReference>(references.values());
return new ArrayList<>(references.values());
}

protected void addReferenceSchema(String ns, SchemaBasedEdmProvider provider) {
@@ -164,7 +164,7 @@ public CsdlTypeDefinition getTypeDefinition(FullQualifiedName fqn) throws ODataE

@Override
public List<CsdlFunction> getFunctions(FullQualifiedName fqn) throws ODataException {
ArrayList<CsdlFunction> foundFuncs = new ArrayList<CsdlFunction>();
ArrayList<CsdlFunction> foundFuncs = new ArrayList<>();
CsdlSchema schema = getSchema(fqn.getNamespace());
if (schema != null) {
List<CsdlFunction> functions = schema.getFunctions();
@@ -292,7 +292,7 @@ public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName fqn) thr

@Override
public List<CsdlAliasInfo> getAliasInfos() throws ODataException {
ArrayList<CsdlAliasInfo> list = new ArrayList<CsdlAliasInfo>();
ArrayList<CsdlAliasInfo> list = new ArrayList<>();
for (CsdlSchema s : this.edmSchemas) {
if (s.getAlias() != null) {
CsdlAliasInfo ai = new CsdlAliasInfo();
@@ -338,7 +338,7 @@ public CsdlEntityContainer getEntityContainer() throws ODataException {

@Override
public List<CsdlSchema> getSchemas() throws ODataException {
return new ArrayList<CsdlSchema>(this.edmSchemas);
return new ArrayList<>(this.edmSchemas);
}

@Override
@@ -369,7 +369,7 @@ public CsdlComplexType getComplexType(final FullQualifiedName fqn) throws ODataE

@Override
public List<CsdlAction> getActions(final FullQualifiedName fqn) throws ODataException {
ArrayList<CsdlAction> actions = new ArrayList<CsdlAction>();
ArrayList<CsdlAction> actions = new ArrayList<>();
CsdlSchema schema = getSchema(fqn.getNamespace());
if (schema != null) {
List<CsdlAction> types = schema.getActions();

0 comments on commit 6c2103c

Please sign in to comment.
You can’t perform that action at this time.