We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There're 2 issues:
private static void createDefaultObjectMapper(final DateFormat defaultDateFormat, final AbstractJackson2HttpMessageConverter converter) { final DateFormat dateFormat = defaultDateFormat; if (Objects.isNull(defaultDateFormat)) { dateFormat = createDefaultDateFormat(); } final ObjectMapper mapper = converter.getObjectMapper(); mapper.setDateFormat(dateFormat); mapper.registerModule(new JavaTimeModule()); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); }
DateFormat shouldn't be declared final.
public MultiValueMap<String, String> parameterToMultiValueMap(final CollectionFormat collectionFormat, final String name, final Object value) { final MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(); if (name == null || name.isEmpty() || value == null) { return params; } if (collectionFormat == null) { collectionFormat = CollectionFormat.CSV; } if (value instanceof Map) { @SuppressWarnings("unchecked") final Map<String, Object> valuesMap = (Map<String, Object>) value; for (final Entry<String, Object> entry : valuesMap.entrySet()) { params.add(entry.getKey(), parameterToString(entry.getValue())); } return params; } Collection<?> valueCollection = null; if (value instanceof Collection) { valueCollection = (Collection<?>) value; } else { params.add(name, parameterToString(value)); return params; } if (valueCollection.isEmpty()) { return params; } if (collectionFormat.equals(CollectionFormat.MULTI)) { for (Object item : valueCollection) { params.add(name, parameterToString(item)); } return params; } List<String> values = new ArrayList<String>(); for (Object o : valueCollection) { values.add(parameterToString(o)); } params.add(name, collectionFormat.collectionToString(values)); return params; }
The parameter collectionFormat shouldn't be declared final
public String collectionPathParameterToString(final CollectionFormat collectionFormat, final Collection<?> values) { String result; if (CollectionFormat.MULTI.equals(collectionFormat)) { result = parameterToString(values); } if(collectionFormat == null) { result = CollectionFormat.CSV.collectionToString(values); } else { result = collectionFormat.collectionToString(values) } return result; }
The text was updated successfully, but these errors were encountered:
RobertoSngular
Successfully merging a pull request may close this issue.
There're 2 issues:
It's declaring variables finals and then changing his value so a compiles error is made.
DateFormat shouldn't be declared final.
The parameter collectionFormat shouldn't be declared final
It's missing a semicolon in the last result assigment.
The text was updated successfully, but these errors were encountered: