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

NullPointerException in org.openrewrite.java.spring.security6.UpdateRequestCache.isContinueParameterStatement(UpdateRequestCache.java:146) #507

Closed
xtermi2 opened this issue Mar 5, 2024 · 6 comments
Labels
bug Something isn't working question Further information is requested

Comments

@xtermi2
Copy link

xtermi2 commented Mar 5, 2024

What version of OpenRewrite are you using?

org.openrewrite.rewrite gradle plugin version 6.8.4

I am using

  • Gradle plugin v6.8.4
  • org.openrewrite.recipe:rewrite-spring:5.5.0

How are you running OpenRewrite?

I am using the Gradle plugin, and my project is a multi module project (./gradlew rewriteRun --stacktrace --no-daemon). It's not public and I can't share it, because it contains of several hundred gradle modules.

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

don't know, it's a complicated configuration class with nested/inner configurations which I can't share. There are multiple SecurityFilterChain's as nested configuration class within this class.

What did you expect to see?

no Exception

What did you see instead?

a NullPointerException

Caused by: java.lang.RuntimeException: Error while visiting modules/masterdata/src/main/java/com/something/masterdata/config/security/MasterdataSecurityConfiguration.java: java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.openrewrite.java.tree.J$Literal.getValue()" is null
  org.openrewrite.java.spring.security6.UpdateRequestCache.isContinueParameterStatement(UpdateRequestCache.java:146)

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

All sources parsed, running active recipes: org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_2
The recipe produced an error. Please report this to the recipe author.

> Task :rewriteRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rewriteRun'.
> java.lang.RuntimeException: Error while visiting modules/masterdata/src/main/java/com/something/masterdata/config/security/MasterdataSecurityConfiguration.java: java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.openrewrite.java.tree.J$Literal.getValue()" is null
    org.openrewrite.java.spring.security6.UpdateRequestCache.isContinueParameterStatement(UpdateRequestCache.java:146)
    java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
    java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
    java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
    java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
    java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
    java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
    java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
    java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632)
    org.openrewrite.java.spring.security6.UpdateRequestCache.findContinueParameterStatement(UpdateRequestCache.java:154)
    org.openrewrite.java.spring.security6.UpdateRequestCache.access$000(UpdateRequestCache.java:33)
    org.openrewrite.java.spring.security6.UpdateRequestCache$1.visitBlock(UpdateRequestCache.java:67)
    org.openrewrite.java.spring.security6.UpdateRequestCache$1.visitBlock(UpdateRequestCache.java:60)
    org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
    ...

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':rewriteRun'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:148)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
        at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error while visiting modules/masterdata/src/main/java/com/something/masterdata/config/security/MasterdataSecurityConfiguration.java: java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.openrewrite.java.tree.J$Literal.getValue()" is null
  org.openrewrite.java.spring.security6.UpdateRequestCache.isContinueParameterStatement(UpdateRequestCache.java:146)
  java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
  java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
  java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
  java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
  java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
  java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
  java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
  java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
  java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632)
  org.openrewrite.java.spring.security6.UpdateRequestCache.findContinueParameterStatement(UpdateRequestCache.java:154)
  org.openrewrite.java.spring.security6.UpdateRequestCache.access$000(UpdateRequestCache.java:33)
  org.openrewrite.java.spring.security6.UpdateRequestCache$1.visitBlock(UpdateRequestCache.java:67)
  org.openrewrite.java.spring.security6.UpdateRequestCache$1.visitBlock(UpdateRequestCache.java:60)
  org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
  ...
        at org.openrewrite.gradle.DelegatingProjectParser.unwrapInvocationException(DelegatingProjectParser.java:155)
        at org.openrewrite.gradle.DelegatingProjectParser.run(DelegatingProjectParser.java:99)
        at org.openrewrite.gradle.RewriteRunTask.run(RewriteRunTask.java:36)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
        at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:247)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:232)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:215)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:198)
        at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:165)
        at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
        at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
        at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:50)
        at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:28)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:61)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26)
        at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:64)
        at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:42)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:189)
        at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75)
        at org.gradle.internal.Either$Right.fold(Either.java:175)
        at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:76)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:76)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:37)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55)
        at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:64)
        at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:43)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:125)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:56)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
        at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75)
        at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35)
        at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:292)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22)
        at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40)
        at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:66)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:66)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:38)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:36)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:26)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
        at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: java.lang.RuntimeException: Error while visiting modules/masterdata/src/main/java/com/something/masterdata/config/security/MasterdataSecurityConfiguration.java: java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.openrewrite.java.tree.J$Literal.getValue()" is null
  org.openrewrite.java.spring.security6.UpdateRequestCache.isContinueParameterStatement(UpdateRequestCache.java:146)
  java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
  java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
  java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
  java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
  java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
  java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
  java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
  java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
  java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632)
  org.openrewrite.java.spring.security6.UpdateRequestCache.findContinueParameterStatement(UpdateRequestCache.java:154)
  org.openrewrite.java.spring.security6.UpdateRequestCache.access$000(UpdateRequestCache.java:33)
  org.openrewrite.java.spring.security6.UpdateRequestCache$1.visitBlock(UpdateRequestCache.java:67)
  org.openrewrite.java.spring.security6.UpdateRequestCache$1.visitBlock(UpdateRequestCache.java:60)
  org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
  ...
        at org.openrewrite.gradle.isolated.ResultsContainer$1.lambda$preVisit$0(ResultsContainer.java:115)
        at org.openrewrite.gradle.isolated.ResultsContainer$1.preVisit(ResultsContainer.java:112)
        at org.openrewrite.gradle.isolated.ResultsContainer$1.preVisit(ResultsContainer.java:108)
        at org.openrewrite.gradle.isolated.ResultsContainer_1_JavaVisitor.preVisit(ResultsContainer_1_JavaVisitor.zig:81)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:280)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitMethodDeclaration(JavaVisitor.java:883)
        at org.openrewrite.java.tree.J$MethodDeclaration.acceptJava(J.java:3672)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1375)
        at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:401)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
        at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:400)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitClassDeclaration(JavaVisitor.java:488)
        at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1290)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1375)
        at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:401)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
        at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:400)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitClassDeclaration(JavaVisitor.java:488)
        at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1290)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.lambda$visitCompilationUnit$10(JavaVisitor.java:501)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
        at org.openrewrite.java.JavaVisitor.visitCompilationUnit(JavaVisitor.java:501)
        at org.openrewrite.java.tree.J$CompilationUnit.acceptJava(J.java:1592)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.gradle.isolated.ResultsContainer.getRecipeErrors(ResultsContainer.java:119)
        at org.openrewrite.gradle.isolated.ResultsContainer.getFirstException(ResultsContainer.java:99)
        at org.openrewrite.gradle.isolated.DefaultProjectParser.run(DefaultProjectParser.java:408)
        at org.openrewrite.gradle.isolated.DefaultProjectParser.run(DefaultProjectParser.java:402)
        at org.openrewrite.gradle.DelegatingProjectParser.lambda$run$2(DelegatingProjectParser.java:100)
        at org.openrewrite.gradle.DelegatingProjectParser.unwrapInvocationException(DelegatingProjectParser.java:147)
        ... 123 more

Are you interested in contributing a fix to OpenRewrite?

no

@xtermi2 xtermi2 added the bug Something isn't working label Mar 5, 2024
@timtebeek timtebeek changed the title NullPointerException in org.openrewrite.java.spring.security6.UpdateRequestCache.isContinueParameterStatement(UpdateRequestCache.java:146) NullPointerException in org.openrewrite.java.spring.security6.UpdateRequestCache.isContinueParameterStatement(UpdateRequestCache.java:146) Mar 5, 2024
timtebeek added a commit that referenced this issue Mar 5, 2024
To followup with a more thorough fix if we learn more about the usage there.
@timtebeek
Copy link
Contributor

Hi @xtermi2 ; thanks for the report; It's hard to say what exactly is going on without more details, but I did add this one small change already to get rid of the immediate NPE 8f1f7b9

Since the recipe looks at the use of HttpSessionRequestCache setMatchingRequestParameterName(java.lang.String), are you able to share anything about such lines in your config? That would help us narrow this down even further perhaps.

@timtebeek timtebeek added the question Further information is requested label Mar 5, 2024
@timtebeek
Copy link
Contributor

And note that you can already try out the above change through rewrite-spring:5.6.0-SNAPSHOT (after this run completes) as per our snapshot versions.

@xtermi2
Copy link
Author

xtermi2 commented Mar 5, 2024

Thanks @timtebeek for the fast reply. I'll test the snapshot build later.
I've reduced the class with the requestCache part, but I think the setMatchingRequestParameterName(null) is the problem:

@Configuration
public class MasterdataSecurityConfiguration {

    @Configuration
    static class BaseSecurityConfiguration {

        RequestCache requestCache() {
            // configure Spring Security 5 behavior for request cache checking
            HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
            requestCache.setMatchingRequestParameterName(null);
            return requestCache;
        }

        @Bean
        SecurityFilterChain baseSecurityConfigurationSecurityFilterChainMasterdata(HttpSecurity http) throws Exception {
            http.requestCache(cache -> cache.requestCache(requestCache()));
            return http.build();
        }
    }
}

@timtebeek
Copy link
Contributor

Thanks for the reduced example! Yes that'll not have worked previously, but I hope that's covered now by switching around that equals; thanks! I'll be optimistic and already close this issue, but monitor any replies if there's more to do still.

@xtermi2
Copy link
Author

xtermi2 commented Mar 5, 2024

OK, this issue is gone with the 5.6.0-SNAPSHOT, but I got something else:

All sources parsed, running active recipes: org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_2
The recipe produced an error. Please report this to the recipe author.

> Task :rewriteRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rewriteRun'.
> java.lang.RuntimeException: Error while visiting modules/masterdata/src/main/java/com/something/masterdata/config/security/MasterdataSecurityConfiguration.java: java.lang.IllegalStateException: Unable to construct Java17Parser.
    org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:96)
    org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:63)
    org.openrewrite.java.internal.template.JavaTemplateParser.compileTemplate(JavaTemplateParser.java:257)
    org.openrewrite.java.internal.template.JavaTemplateParser.lambda$parseBlockStatements$9(JavaTemplateParser.java:176)
    org.openrewrite.java.internal.template.JavaTemplateParser.cacheIfContextFree(JavaTemplateParser.java:290)
    org.openrewrite.java.internal.template.JavaTemplateParser.parseBlockStatements(JavaTemplateParser.java:171)
    org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.maybeReplaceStatement(JavaTemplateJavaExtension.java:469)
    org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitStatement(JavaTemplateJavaExtension.java:463)
    org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitStatement(JavaTemplateJavaExtension.java:56)
    org.openrewrite.java.JavaVisitor.visitVariableDeclarations(JavaVisitor.java:940)
    org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitVariableDeclarations(JavaTemplateJavaExtension.java:519)
    org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitVariableDeclarations(JavaTemplateJavaExtension.java:56)
    org.openrewrite.java.tree.J$VariableDeclarations.acceptJava(J.java:5824)
    org.openrewrite.java.tree.J.accept(J.java:59)
    org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
    org.openrewrite.TreeVisitor.visit(TreeVisitor.java:184)
    ...

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':rewriteRun'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:148)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
        at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error while visiting modules/masterdata/src/main/java/com/something/masterdata/config/security/MasterdataSecurityConfiguration.java: java.lang.IllegalStateException: Unable to construct Java17Parser.
  org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:96)
  org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:63)
  org.openrewrite.java.internal.template.JavaTemplateParser.compileTemplate(JavaTemplateParser.java:257)
  org.openrewrite.java.internal.template.JavaTemplateParser.lambda$parseBlockStatements$9(JavaTemplateParser.java:176)
  org.openrewrite.java.internal.template.JavaTemplateParser.cacheIfContextFree(JavaTemplateParser.java:290)
  org.openrewrite.java.internal.template.JavaTemplateParser.parseBlockStatements(JavaTemplateParser.java:171)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.maybeReplaceStatement(JavaTemplateJavaExtension.java:469)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitStatement(JavaTemplateJavaExtension.java:463)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitStatement(JavaTemplateJavaExtension.java:56)
  org.openrewrite.java.JavaVisitor.visitVariableDeclarations(JavaVisitor.java:940)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitVariableDeclarations(JavaTemplateJavaExtension.java:519)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitVariableDeclarations(JavaTemplateJavaExtension.java:56)
  org.openrewrite.java.tree.J$VariableDeclarations.acceptJava(J.java:5824)
  org.openrewrite.java.tree.J.accept(J.java:59)
  org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
  org.openrewrite.TreeVisitor.visit(TreeVisitor.java:184)
  ...
        at org.openrewrite.gradle.DelegatingProjectParser.unwrapInvocationException(DelegatingProjectParser.java:155)
        at org.openrewrite.gradle.DelegatingProjectParser.run(DelegatingProjectParser.java:99)
        at org.openrewrite.gradle.RewriteRunTask.run(RewriteRunTask.java:36)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
        at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:247)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:232)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:215)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:198)
        at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:165)
        at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
        at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
        at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:50)
        at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:28)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:61)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26)
        at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:64)
        at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:42)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:189)
        at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75)
        at org.gradle.internal.Either$Right.fold(Either.java:175)
        at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:76)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:76)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:37)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55)
        at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:64)
        at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:43)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:125)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:56)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
        at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75)
        at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35)
        at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:292)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22)
        at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40)
        at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:66)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:66)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:38)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:36)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:26)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
        at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: java.lang.RuntimeException: Error while visiting modules/masterdata/src/main/java/com/something/masterdata/config/security/MasterdataSecurityConfiguration.java: java.lang.IllegalStateException: Unable to construct Java17Parser.
  org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:96)
  org.openrewrite.java.Java17Parser$Builder.build(Java17Parser.java:63)
  org.openrewrite.java.internal.template.JavaTemplateParser.compileTemplate(JavaTemplateParser.java:257)
  org.openrewrite.java.internal.template.JavaTemplateParser.lambda$parseBlockStatements$9(JavaTemplateParser.java:176)
  org.openrewrite.java.internal.template.JavaTemplateParser.cacheIfContextFree(JavaTemplateParser.java:290)
  org.openrewrite.java.internal.template.JavaTemplateParser.parseBlockStatements(JavaTemplateParser.java:171)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.maybeReplaceStatement(JavaTemplateJavaExtension.java:469)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitStatement(JavaTemplateJavaExtension.java:463)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitStatement(JavaTemplateJavaExtension.java:56)
  org.openrewrite.java.JavaVisitor.visitVariableDeclarations(JavaVisitor.java:940)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitVariableDeclarations(JavaTemplateJavaExtension.java:519)
  org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1.visitVariableDeclarations(JavaTemplateJavaExtension.java:56)
  org.openrewrite.java.tree.J$VariableDeclarations.acceptJava(J.java:5824)
  org.openrewrite.java.tree.J.accept(J.java:59)
  org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
  org.openrewrite.TreeVisitor.visit(TreeVisitor.java:184)
  ...
        at org.openrewrite.gradle.isolated.ResultsContainer$1.lambda$preVisit$0(ResultsContainer.java:115)
        at org.openrewrite.gradle.isolated.ResultsContainer$1.preVisit(ResultsContainer.java:112)
        at org.openrewrite.gradle.isolated.ResultsContainer$1.preVisit(ResultsContainer.java:108)
        at org.openrewrite.gradle.isolated.ResultsContainer_1_JavaVisitor.preVisit(ResultsContainer_1_JavaVisitor.zig:81)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:280)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1375)
        at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:401)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
        at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:400)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitMethodDeclaration(JavaVisitor.java:883)
        at org.openrewrite.java.tree.J$MethodDeclaration.acceptJava(J.java:3672)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1375)
        at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:401)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
        at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:400)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitClassDeclaration(JavaVisitor.java:488)
        at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1290)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1375)
        at org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:401)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
        at org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:400)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:838)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.visitClassDeclaration(JavaVisitor.java:488)
        at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1290)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
        at org.openrewrite.java.JavaVisitor.lambda$visitCompilationUnit$10(JavaVisitor.java:501)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
        at org.openrewrite.java.JavaVisitor.visitCompilationUnit(JavaVisitor.java:501)
        at org.openrewrite.java.tree.J$CompilationUnit.acceptJava(J.java:1592)
        at org.openrewrite.java.tree.J.accept(J.java:59)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
        at org.openrewrite.gradle.isolated.ResultsContainer.getRecipeErrors(ResultsContainer.java:119)
        at org.openrewrite.gradle.isolated.ResultsContainer.getFirstException(ResultsContainer.java:99)
        at org.openrewrite.gradle.isolated.DefaultProjectParser.run(DefaultProjectParser.java:408)
        at org.openrewrite.gradle.isolated.DefaultProjectParser.run(DefaultProjectParser.java:402)
        at org.openrewrite.gradle.DelegatingProjectParser.lambda$run$2(DelegatingProjectParser.java:100)
        at org.openrewrite.gradle.DelegatingProjectParser.unwrapInvocationException(DelegatingProjectParser.java:147)
        ... 123 more

@timtebeek
Copy link
Contributor

Hmm that's odd; we seem to throw here, but the details from the nested exception are somehow now visible above. Perhaps we'd need a new release of openrewrite/rewrite to go along with the new rewrite-spring snapshot. 🤔

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

No branches or pull requests

2 participants