-
Notifications
You must be signed in to change notification settings - Fork 989
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
Added SuppressWarnings annotation #47
Conversation
Added @SuppressWarnings("unused") annotation to prevent dead code confusion regarding the StringUtils.isNullOrEmpty(eSelectedEndpointID) check done in the "if" block and within a "debug" block of code inside the previously mentioned "if" block. Lines 800 and 814.
Hey @mondain how did you manage to get the warning, I'm not seeing anything here. |
It showed up in eclipse 3.8.1 on linux. |
Eclipse 3.8 is rather old, but: if the code is actually unused it should be removed from the file or if it is indeed used (e.g. through reflection) then it should be marked as such. Simply adding a warning suppression without a justification is not the way to go. |
The code block is not unused per se, but it is only called when debug logging is enabled; this is the full section of the code:
Observe that "StringUtils.isNullOrEmpty(eSelectedEndpointID)" is in both the "if" and "log" sections; it is what is being "unused". |
Clearly the method that you have annotated as unused is not unused and it is not only called when debug logging is enabled. The only thing that's called only when debug logging is enabled is the debug message construction. I really don't see any unused code here, maybe there's a problem with the dead code detection facility in eclipse 3.8.1? |
The unused annotation doesn't mean that the overall method is unused, it is covering the detected dead code section within; since the annotation is not valid for placement above the "if" block. I cannot comment on the detection in Eclipse, but I can say that the code is confusing and could be streamlined. This is not a critical item for sure, but more or less an annoyance within the IDE. |
Putting an unused annotation doesn't make the code less confusing and there is no dead code anywhere in that method and the method is used. If you have any ideas on how to make the code less confusing please let us know. |
True and fair enough; will do. |
* wip: FIR/PLI aggregation/translation * converts a val into a const * reduces nesting * removes duplication * avoid creating too many fir command sequence numbers * simplifies code * replaces Object with Any * avoids extra work for plis * adds rtcp feedback information to new PayloadType instances * makes the keyframe request wait interval dynamic * minor non-functional changes in keyframe requester
* wip: FIR/PLI aggregation/translation * converts a val into a const * reduces nesting * removes duplication * avoid creating too many fir command sequence numbers * simplifies code * replaces Object with Any * avoids extra work for plis * adds rtcp feedback information to new PayloadType instances * makes the keyframe request wait interval dynamic * minor non-functional changes in keyframe requester
* wip: FIR/PLI aggregation/translation * converts a val into a const * reduces nesting * removes duplication * avoid creating too many fir command sequence numbers * simplifies code * replaces Object with Any * avoids extra work for plis * adds rtcp feedback information to new PayloadType instances * makes the keyframe request wait interval dynamic * minor non-functional changes in keyframe requester
Added @SuppressWarnings("unused") annotation to prevent dead code confusion regarding the StringUtils.isNullOrEmpty(eSelectedEndpointID) check done in the "if" block and within a "debug" block of code inside the previously mentioned "if" block. Lines 800 and 814.