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

FXSampler: Scan Class path as well as Module Path #1314

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eugener
Copy link
Collaborator

@eugener eugener commented Oct 10, 2020

Fixes #1310
@dlemmermann Please confirm that this works for you.

@eugener eugener added enhancement New feature or request 9.0.0 labels Oct 10, 2020
@eugener eugener self-assigned this Oct 10, 2020
@lgtm-com
Copy link

lgtm-com bot commented Oct 10, 2020

This pull request fixes 1 alert when merging 962f0ca into acd5efa - view on LGTM.com

fixed alerts:

  • 1 for Container contents are never accessed

@dlemmermann
Copy link
Collaborator

dlemmermann commented Oct 13, 2020

It seems to work ok when run within my IDE, but when packaged up I am seeing this error, which is might be related to MacOS Privacy settings.

java.nio.file.FileSystemException: Library/Containers/com.apple.mail/Data/DataVaults: Operation not permitted Skipping...
java.nio.file.ProviderNotFoundException: Provider not found
	at java.base/java.nio.file.FileSystems.newFileSystem(Unknown Source)
	at java.base/java.nio.file.FileSystems.newFileSystem(Unknown Source)
	at fxsampler.util.SampleScanner.findClassesInJar(SampleScanner.java:294)
	at fxsampler.util.SampleScanner.loadFromClassPathScanning(SampleScanner.java:244)
	at fxsampler.util.SampleScanner.loadFromPathScanning(SampleScanner.java:134)
	at fxsampler.util.SampleScanner.discoverSamples(SampleScanner.java:88)
	at fxsampler.FXSampler.start(FXSampler.java:112)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

@eugener
Copy link
Collaborator Author

eugener commented Oct 14, 2020

@dlemmermann
Yes, looks like MacOS System Integrity Protection (SIP) is enabled.
What file(jar) is it trying to open and how is it related to Apple Mail Data?

@abhinayagarwal
Copy link
Member

Please target the PR to jfx-13 branch.

@dlemmermann dlemmermann changed the base branch from 9.0.0 to jfx-13 January 31, 2021 16:55
@dlemmermann
Copy link
Collaborator

Retargeted as requested by @abhinayagarwal

@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2021

This pull request fixes 1 alert when merging 962f0ca into ebd2f3a - view on LGTM.com

fixed alerts:

  • 1 for Container contents are never accessed

@abhinayagarwal
Copy link
Member

I have pushed a commit to license hear year. Once @dlemmermann confirms it works, we can merge this PR.

@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2021

This pull request fixes 1 alert when merging 83db801 into ebd2f3a - view on LGTM.com

fixed alerts:

  • 1 for Container contents are never accessed

@abhinayagarwal
Copy link
Member

Hi @eugener @dlemmermann

What is the status of this PR?

I am performing some clean up for #1345. It would be real nice to have this PR merged.

@dlemmermann
Copy link
Collaborator

I finally managed to build and run this inside IntelliJ, inside the ControlsFX project via the Gradle "run" task. I can now see that each sample appears twice.
Screen Shot 2021-03-09 at 11 44 19 AM

@dlemmermann
Copy link
Collaborator

The problem seems to be that the data structure is a list instead of a Set, hence allowing duplicates.

@lgtm-com
Copy link

lgtm-com bot commented Mar 9, 2021

This pull request fixes 1 alert when merging 9bfd906 into 405e9f1 - view on LGTM.com

fixed alerts:

  • 1 for Container contents are never accessed

@eugener
Copy link
Collaborator Author

eugener commented Mar 10, 2021

@dlemmermann This fix should mitigate the duplication issue.
The real reason is that the same samples are on both class path and module path. I wonder if this can be avoided.

@Siedlerchr
Copy link
Collaborator

Just an idea, for scanning/finding things on the module or claspath I can recommend this library https://github.com/classgraph/classgraph

@abhinayagarwal abhinayagarwal changed the base branch from jfx-13 to master December 8, 2021 14:30
@lgtm-com
Copy link

lgtm-com bot commented Dec 8, 2021

This pull request fixes 1 alert when merging 9bfd906 into e76c36d - view on LGTM.com

fixed alerts:

  • 1 for Container contents are never accessed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SampleScanner should load samples from classpath and module path.
4 participants