-
Notifications
You must be signed in to change notification settings - Fork 161
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
Conversation
The OSGi detection seems impossible to fake from a test that doesn't have OSGi framework on the classpath, so no test for this.
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.
Reviewed 1 of 1 files at r1.
Reviewable status: complete! all discussions resolved, 1 of 1 LGTMs obtained
@@ -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) { |
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.
try { | ||
Bundle osgiBundle = org.osgi.framework.FrameworkUtil.getBundle(Bundle.class); | ||
return osgiBundle.getVersion().toString(); | ||
} catch (Throwable throwable) { |
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.
SonarQube analysis reported 5 issues Watch the comments in this conversation to review them. 2 extra issuesNote: 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:
|
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.
Dismissed @vaadin-bot from 2 discussions.
Reviewable status: complete! all discussions resolved, 1 of 1 LGTMs obtained
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.
Reviewable status: complete! all discussions resolved, 1 of 1 LGTMs obtained
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