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

NPE in MergeYaml #4955

Open
Bananeweizen opened this issue Jan 27, 2025 · 0 comments
Open

NPE in MergeYaml #4955

Bananeweizen opened this issue Jan 27, 2025 · 0 comments
Labels
bug Something isn't working parser-yaml

Comments

@Bananeweizen
Copy link
Contributor

What is the smallest, simplest way to reproduce the problem?

Configure the org.openrewrite.yaml.MergeYaml without any of the required parameters (I just copied a list of recipes taken from the discover goal) and run OpenRewrite.

What is the full stack trace of any errors you encountered?

 java.lang.NullPointerException: Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "source" is null
	at org.openrewrite.Parser$Input.lambda$fromString$0(Parser.java:175)
	at org.openrewrite.Parser$Input.getSource(Parser.java:215)
	at org.openrewrite.tree.ParseError.build(ParseError.java:97)
	at org.openrewrite.yaml.YamlParser.lambda$parseInputs$0(YamlParser.java:77)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
	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)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at org.openrewrite.yaml.MergeYaml.lambda$validate$1(MergeYaml.java:66)
	at org.openrewrite.Validated.test(Validated.java:81)
	at org.openrewrite.yaml.MergeYaml.validate(MergeYaml.java:64)
	at org.openrewrite.Recipe.validate(Recipe.java:383)

Are you interested in contributing a fix to OpenRewrite?

@Bananeweizen Bananeweizen added the bug Something isn't working label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser-yaml
Projects
Status: No status
Development

No branches or pull requests

2 participants