Handle invalid JavaDoc references in parser and printer#5535
Conversation
| qualifier == null ? Space.EMPTY : qualifier.getPrefix(), | ||
| Markers.EMPTY, | ||
| qualifier == null ? null : JRightPadded.build(qualifier.withPrefix(Space.EMPTY)), | ||
| JRightPadded.build(qualifier == null ? null : qualifier.withPrefix(Space.EMPTY)), |
There was a problem hiding this comment.
This mimics what we do for the Java parser: there we also unconditionally create a JRightPadded with a nullable containing element.
| visitLeftPadded("#", memberRef.getPadding().getReference(), JLeftPadded.Location.MEMBER_REFERENCE_NAME, p); | ||
| } else { | ||
| visitLeftPadded(null, memberRef.getPadding().getReference(), JLeftPadded.Location.MEMBER_REFERENCE_NAME, p); |
There was a problem hiding this comment.
These visitLeftPadded might be a little too hyper focused on the failing test that was provided, but still I think it's common enough to keep this as is here. If we were to unconditionally use a # prefix, then that would be another print idempotency issue.
There was a problem hiding this comment.
I think I see what you mean here. But I see no better option.
|
|
Thanks! Weird how those only show on Java 11 and 17; they are true, and expected, so I've updated the recipe spec to allow for those, as indeed we're using an invalid reference; we're aiming for print idempotency, not type fixes. |
Uh oh!
There was an error while loading. Please reload this page.