Conversation
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
=========================================
Coverage 93.15% 93.15%
Complexity 65 65
=========================================
Files 9 9
Lines 263 263
Branches 22 22
=========================================
Hits 245 245
Misses 8 8
Partials 10 10 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| if (MapUtils.isNotEmpty(headers) && headers.get("Content-Type") != null) { | ||
| Object contentTypeObj = headers.get("Content-Type"); | ||
| if (contentTypeObj instanceof List) { | ||
| customContentType = ((List) contentTypeObj).get(0).toString(); |
There was a problem hiding this comment.
use List<?> to avoid warning
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
| * @param headers | ||
| * @return | ||
| */ | ||
| public static MediaType parseCustomContentType(MultivaluedMap<String, Object> headers) { |
There was a problem hiding this comment.
maybe private static should be better, but it's not a big problem
There was a problem hiding this comment.
i will fix this case in next PR
| if (MapUtils.isNotEmpty(headers) && headers.get("Content-Type") != null) { | ||
| Object contentTypeObj = headers.get("Content-Type"); | ||
| if (contentTypeObj instanceof List) { | ||
| customContentType = ((List<?>) contentTypeObj).get(0).toString(); |
There was a problem hiding this comment.
Is the contentTypeObj possible to be empty
There was a problem hiding this comment.
it will happens, but i think no one will write code like this:
headers.put("Content-Type", LIsts.newArrayList());
i will fix this case in next PR
| public static MediaType parseCustomContentType(MultivaluedMap<String, Object> headers) { | ||
| String customContentType = null; | ||
| if (MapUtils.isNotEmpty(headers) && headers.get("Content-Type") != null) { | ||
| Object contentTypeObj = headers.get("Content-Type"); |
There was a problem hiding this comment.
seems we don't need Object here, just use List<?>
| String customContentType = null; | ||
| if (MapUtils.isNotEmpty(headers) && headers.get("Content-Type") != null) { | ||
| Object contentTypeObj = headers.get("Content-Type"); | ||
| if (contentTypeObj instanceof List) { |
There was a problem hiding this comment.
and here the judge is redundant, change it to xx != null, I address them in PR #115

No description provided.