You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/08/04 20:57:23 UTC
[GitHub] [helix] wmorgan6796 opened a new pull request, #2186: Fixes #2185 NullPointerException in ResourceUtil for admin-webapp
wmorgan6796 opened a new pull request, #2186:
URL: https://github.com/apache/helix/pull/2186
### Issues
Fixes #2185
### Description
Fixes a NullPointerException present in ResourceUtil.java. Its due to the order in which static class members are initialized and leads to the given exception because a different static object that is created before the `mapper` object uses the mapper (on line 49).
### Tests
Tests that were previously broken should pass.
### Changes that Break Backward Compatibility (Optional)
Does not break backwards compatability
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org
[GitHub] [helix] wmorgan6796 commented on a diff in pull request #2186: Fixes #2185 NullPointerException in ResourceUtil for admin-webapp
Posted by GitBox <gi...@apache.org>.
wmorgan6796 commented on code in PR #2186:
URL: https://github.com/apache/helix/pull/2186#discussion_r938325526
##########
helix-admin-webapp/src/main/java/org/apache/helix/webapp/resources/ResourceUtil.java:
##########
@@ -45,9 +45,9 @@
public class ResourceUtil {
private static final Logger LOG = LoggerFactory.getLogger(ResourceUtil.class);
+ private static ObjectMapper mapper = new ObjectMapper();
private static final String EMPTY_ZNRECORD_STRING =
objectToJson(ClusterRepresentationUtil.EMPTY_ZNRECORD);
Review Comment:
Was able to remove and added a `final` to the mapper (per Intellij's recommendations)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org
[GitHub] [helix] qqu0127 commented on a diff in pull request #2186: Fixes #2185 NullPointerException in ResourceUtil for admin-webapp
Posted by GitBox <gi...@apache.org>.
qqu0127 commented on code in PR #2186:
URL: https://github.com/apache/helix/pull/2186#discussion_r938279338
##########
helix-admin-webapp/src/main/java/org/apache/helix/webapp/resources/ResourceUtil.java:
##########
@@ -45,9 +45,9 @@
public class ResourceUtil {
private static final Logger LOG = LoggerFactory.getLogger(ResourceUtil.class);
+ private static ObjectMapper mapper = new ObjectMapper();
private static final String EMPTY_ZNRECORD_STRING =
objectToJson(ClusterRepresentationUtil.EMPTY_ZNRECORD);
Review Comment:
Thanks for the contribution.
I think you can safely remove `EMPTY_ZNRECORD_STRING` and `objectToJson`, I don't think they are ever used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org
[GitHub] [helix] wmorgan6796 commented on a diff in pull request #2186: Fixes #2185 NullPointerException in ResourceUtil for admin-webapp
Posted by GitBox <gi...@apache.org>.
wmorgan6796 commented on code in PR #2186:
URL: https://github.com/apache/helix/pull/2186#discussion_r938322848
##########
helix-admin-webapp/src/main/java/org/apache/helix/webapp/resources/ResourceUtil.java:
##########
@@ -45,9 +45,9 @@
public class ResourceUtil {
private static final Logger LOG = LoggerFactory.getLogger(ResourceUtil.class);
+ private static ObjectMapper mapper = new ObjectMapper();
private static final String EMPTY_ZNRECORD_STRING =
objectToJson(ClusterRepresentationUtil.EMPTY_ZNRECORD);
Review Comment:
I'll try it out.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org