-
Notifications
You must be signed in to change notification settings - Fork 3.9k
11922 :: UdsChannelBuilder does not work with WiFi Proxy on Android. #12324
New issue
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
.getMethod("socketFactory", SocketFactory.class) | ||
.invoke(builder, new UdsSocketFactory(path, namespace)); | ||
return builder; | ||
if (builder == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this check for builder == null. There is no need for this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kannanjgithub for the review. I've added a null check to resolve the following warnings and satisfy the code quality check:
Warning:(85, 22) Method invocation 'proxyDetector' may produce 'NullPointerException'
The warnings will be resolved with 'assert builder != null' or a 'null check'. Could you please confirm if it's okay for me to ignore these warnings and remove the null check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can suppress the warnings. NPE will happen for reflected methods when the requested method name or class name is not available but that cannot happen here since we know they are definitely available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions @kannanjgithub , I have addressed the review comments and please review it once You get some bandwidth.
* @param path unix file system path to use for Unix Domain Socket. | ||
* @param namespace the type of the namespace that the path belongs to. | ||
*/ | ||
@SuppressWarnings("ConstantConditions") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ejona86 , This code was added to fix the NullPointerException warning that was appearing for proxyDetector.
Warning:(85, 22) Method invocation 'proxyDetector' may produce 'NullPointerException'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IDE was saying that, or our build? We don't have any nullness checks in our build. We don't tend to put IDE suppressions in the code.
Fixes : #11922