Skip to content
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

Spotbugs #1076

Merged
merged 12 commits into from Feb 11, 2020
Merged

Spotbugs #1076

merged 12 commits into from Feb 11, 2020

Conversation

bgrozev
Copy link
Member

@bgrozev bgrozev commented Feb 4, 2020

I fixed or supressed the obvious warnings, but there are 9 warning left that are valid and require some thought. That's why I've not added it to the verify phase in maven yet.

@@ -26,6 +27,7 @@
/**
* @author Boris Grozev
*/
@SuppressFBWarnings("SE_BAD_FIELD")
Copy link
Member

@bbaldino bbaldino Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the description of this warning, I wonder if it's one we should disable overall?

@@ -88,7 +88,7 @@ private static void check(Conference conference)
throw new RuntimeException(ioe);
}

endpoints.add(endpoint);
//endpoints.add(endpoint);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a block of code below which uses endpoints, but it's commented out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So nothing is using endpoints?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok...I expanded the file and see now.

@SuppressWarnings("unchecked")
@SuppressFBWarnings(
value = "IS2_INCONSISTENT_SYNC",
justification = "We intentionally avoid synchronizing while reading" +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading through this class, I find the synchronization we're doing a bit confusing (I probably haven't parsed it fully) but I wonder if it's worth a look.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know whether the syncronization in the rest of the class makes sense, but for getDebugState my intention is as described: read the int fields without aquiring any locks to reduce the risk of a deadlock (since this runs in a completely different context)

@@ -96,6 +99,10 @@
* payload type (could be VP9, could be H264, could be VP8) so it has to be
* created on packet arrival.
*/
@SuppressFBWarnings(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, I wonder if we should just get rid of the synchronized on getContext (the comments there even state it isn't necessary now).

@@ -885,9 +897,6 @@ public final Videobridge getVideobridge()
*/
public boolean isExpired()
{
// Conference starts with expired equal to false and the only assignment
// to expired is to set it to true so there is no need to synchronize
// the reading of expired.
return expired;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep this explanation, which is better than just "is deemed safe" imo.

@@ -484,12 +478,14 @@ private VP8FrameProjection createInLayerProjection(@NotNull VP8Frame frame,
}
else
{
do {
do
{
f2 = prevFrame(f1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably conflict when you rebase on master, so you might want to do that sooner rather than later.

@@ -145,7 +145,7 @@ static MediaType readMediaType(byte[] buf, int off, int len)
case OCTO_MEDIA_TYPE_DATA:
return MediaType.DATA;
default:
return null;
throw new IllegalArgumentException("Invalid media type value" + mediaType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space here.

JonathanLennox
JonathanLennox previously approved these changes Feb 5, 2020
JonathanLennox
JonathanLennox previously approved these changes Feb 6, 2020
@bgrozev bgrozev merged commit e298c53 into jitsi:master Feb 11, 2020
bgrozev added a commit that referenced this pull request Feb 14, 2020
This reverts commit e298c53.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants