You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PBJ treats document comments (/**...*/) as the start of a token (because it wants to make them Javadoc), and if the comment is not followed by a field or message, that next item (be it a keyword like reserved or the end of a block }) is treated as a field or message, so it would look for a message type reserved or hoist a oneof to a field (both of which will fail). In some cases that will even cause a message to be processed completely incorrectly, but still appear to compile, so it's another subtly concerning bug.
How to Reproduce
Compile the following protobuf:
messageDocumentCommentTest {
/** * This will fail "cannot find type [reserved]". */reserved5;
/** * This is fine. */uint32number=1;
/** * oneof with a commented field; this will fail compilation * "OneofFieldContext.fieldNumber is null" */oneofsample {
/** * A text field */stringtext=2;
/** * A flag indicating FCOJ futures bids are enabled. */// removed for now. // bool futures_enabled = 3;
}
}
The text was updated successfully, but these errors were encountered:
Description
PBJ treats document comments (/**...*/) as the start of a token (because it wants to make them Javadoc), and if the comment is not followed by a field or message, that next item (be it a keyword like reserved or the end of a block }) is treated as a field or message, so it would look for a message type reserved or hoist a oneof to a field (both of which will fail). In some cases that will even cause a message to be processed completely incorrectly, but still appear to compile, so it's another subtly concerning bug.
How to Reproduce
Compile the following protobuf:
The text was updated successfully, but these errors were encountered: