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

StackOverflow running 'jbang info tools' if script contains //SOURCES **.java #1464

Closed
fbricon opened this issue Sep 22, 2022 · 2 comments · Fixed by #1467
Closed

StackOverflow running 'jbang info tools' if script contains //SOURCES **.java #1464

fbricon opened this issue Sep 22, 2022 · 2 comments · Fixed by #1467
Labels
bug Something isn't working

Comments

@fbricon
Copy link
Contributor

fbricon commented Sep 22, 2022

Describe the bug
Running jbang info tools on a script containing //SOURCES **.java fails with a StackOverflow:

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://gist.github.com/maxandersen/9ccf3e0a5ad6d3a60e4aec433e41be08
  2. cd 9ccf3e0a5ad6d3a60e4aec433e41be08
  3. jbang info tools Jfx2.java
  4. See error
Exception in thread "main" java.lang.StackOverflowError
	at java.base/sun.nio.fs.UnixPath.getNameCount(UnixPath.java:295)
	at java.base/sun.nio.fs.UnixPath.normalize(UnixPath.java:480)
	at java.base/sun.nio.fs.UnixPath.normalize(UnixPath.java:43)
	at dev.jbang.source.resolvers.FileResourceResolver.resolve(FileResourceResolver.java:29)
	at dev.jbang.source.ResourceResolver.resolve(ResourceResolver.java:32)
	at dev.jbang.source.resolvers.CombinedResourceResolver.lambda$resolve$0(CombinedResourceResolver.java:27)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1016)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
... // REPEAT AD NAUSEAM
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at dev.jbang.cli.BaseInfoCommand$ScriptInfo.init(Info.java:138)
	at dev.jbang.cli.BaseInfoCommand$ScriptInfo.<init>(Info.java:114)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

Expected behavior
Command should not fail and return results

JBang version

❯ jbang version --verbose
[jbang] jbang version 0.98.0
Cache: /Users/fbricon/.jbang/cache
Config: /Users/fbricon/.jbang
Repository:/Users/fbricon/.m2/repository
0.98.0

Additional context
'jbang info tools' working is a requirement for jbang-eclipse / jbang-vscode

@fbricon fbricon added the bug Something isn't working label Sep 22, 2022
@maxandersen
Copy link
Collaborator

can confirm .... thats weird..

quintesse added a commit to maxandersen/jbang that referenced this issue Sep 26, 2022
quintesse added a commit to maxandersen/jbang that referenced this issue Sep 26, 2022
quintesse added a commit that referenced this issue Sep 26, 2022
quintesse added a commit that referenced this issue Sep 26, 2022
@quintesse
Copy link
Contributor

@fbricon this should now be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants