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

Usage debug #285

Merged
merged 4 commits into from
Feb 10, 2021
Merged

Usage debug #285

merged 4 commits into from
Feb 10, 2021

Conversation

mdoube
Copy link
Member

@mdoube mdoube commented Feb 10, 2021

Usage data were not being collected for Legacy plugins when debug mode was off.

Previous design allowed usage report to be sent for Legacy
plugins only when debugMode was set to true.
@mdoube
Copy link
Member Author

mdoube commented Feb 10, 2021

This PR should be approved and merged after #283 due to the scijava version bump commit that is hanging around here.

reader.lines().forEach(IJ::log);
}
} catch (final IOException e) {
IJ.error(e.getMessage());
}
Copy link
Member

Choose a reason for hiding this comment

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

I am probably being silly but I don't understand how the changes make a difference.

The only thing I see changing when IJ.debugMode is false is that the reader variable gets constructed, and then goes out of scope at the end of the send() function?

Copy link
Member Author

@mdoube mdoube Feb 10, 2021

Choose a reason for hiding this comment

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

Right - no idea either. I knocked out some lines to see what is essential and it's this:

final BufferedReader reader = new BufferedReader(new InputStreamReader(uc.getInputStream()))

Which I interpret to mean that the request isn't actually sent until the BufferedReader tries to read from the URLConnection. Or something like that.

@alessandrofelder alessandrofelder self-requested a review February 10, 2021 09:53
Copy link
Member

@alessandrofelder alessandrofelder left a comment

Choose a reason for hiding this comment

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

Might be worth sticking a comment in there saying that the construction of the BufferedReader seems to be essential as that isn't clear from reading the code on its own. Otherwise happy with this.

@mdoube mdoube merged commit 0845d7f into master Feb 10, 2021
@mdoube mdoube deleted the usage-debug branch February 10, 2021 16:14
mdoube added a commit that referenced this pull request Apr 5, 2024
* Update scijava to 30.0.0

* Allow usage report to be sent for Legacy plugins

Previous design allowed usage report to be sent for Legacy
plugins only when debugMode was set to true.

* Comment to explain structure of send() method
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.

2 participants