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

Add OSGi to usage statistics (#4895) #4899

Merged
merged 1 commit into from
Dec 21, 2018
Merged

Conversation

pleku
Copy link
Contributor

@pleku pleku commented Dec 21, 2018

The OSGi detection seems impossible to fake from a test that doesn't
have OSGi framework on the classpath, so no test for this.


This change is Reviewable

The OSGi detection seems impossible to fake from a test that doesn't
have OSGi framework on the classpath, so no test for this.
Copy link
Contributor

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

@denis-anisimov denis-anisimov added this to the 1.2.4 milestone Dec 21, 2018
@@ -263,10 +265,30 @@ private ServletContext createOSGiServletContext() {
private static boolean isInOSGi() {
try {
Class.forName("org.osgi.framework.FrameworkUtil");

UsageStatistics.markAsUsed("flow/osgi", getOSGiVersion());

return true;
} catch (ClassNotFoundException exception) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

CRITICAL Either log or rethrow this exception. rule

try {
Bundle osgiBundle = org.osgi.framework.FrameworkUtil.getBundle(Bundle.class);
return osgiBundle.getVersion().toString();
} catch (Throwable throwable) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

CRITICAL Either log or rethrow this exception. rule
MAJOR Catch Exception instead of Throwable. rule

@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 5 issues

  • CRITICAL 2 critical
  • MAJOR 3 major

Watch the comments in this conversation to review them.

2 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MAJOR OSGiAccess.java#L209: Define and throw a dedicated exception instead of using a generic one. rule
  2. MAJOR OSGiAccess.java#L262: Add a private constructor to hide the implicit public one. rule

Copy link
Contributor

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Dismissed @vaadin-bot from 2 discussions.
Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

Copy link
Contributor

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

@denis-anisimov denis-anisimov merged commit bd8b78f into 1.2 Dec 21, 2018
@denis-anisimov denis-anisimov deleted the cherry_pick_osgi_usage branch December 21, 2018 10:09
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