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
In the provided code, if the type name of "oneof" is capitalized (which is technically not recommended and may be considered illegal), the "krotoDC" fails to generate the code correctly. However, if we compare it with the code generated by the Protoc Java plugin for the "oneof" type, we observe that making the first character lowercase produces the same result as the Java plugin.
special field name like xx_2nd
In the provided code, if the field name follows the pattern "_{digit}{first_alphabet}{other_alphabets}", the "protoc" Java plugin converts the first alphabet of "xx_2nd" to uppercase, resulting in "xx2Nd". However, in the current implementation of the "krotoDC" code, the field name is converted to "xx2nd", which is not compatible with the original Java code.
The draft PR serves as a reference, and it's important to note that the implementation is subject to change.
The text was updated successfully, but these errors were encountered:
oneof names
I'm aware with issues that can arise from oneof names, which was also reported in Problem when the name of a 'oneof' field matches the name of the message. #4. However, I'm still considering whether these cases should be handled. As you mentioned, this kind of proto definitions are against the basic conventions and will not likely be used. If we decide to take care of this, I think the solution will be to change the oneof sealed class names to ~Oneof (although it is breaking change)
special field name like xx_2nd -> I was not aware of this issue. I'll look into your PR soon!
Regarding point 1, while it is certainly a significant matter, I cannot recall any instances where the oneof field name generated by protobuf-java was directly referenced in actual code. From what I understand, the existence of the 'tagCode' field (as seen in the example above) is primarily intended to ensure successful compilation. Since my knowledge of protobuf is limited, I cannot say for certain whether this implementation would disrupt existing code.
There were some cases I encountered in wild, I will illustrate using the following code as an example.
oneof type
In the provided code, if the type name of "oneof" is capitalized (which is technically not recommended and may be considered illegal), the "krotoDC" fails to generate the code correctly. However, if we compare it with the code generated by the Protoc Java plugin for the "oneof" type, we observe that making the first character lowercase produces the same result as the Java plugin.
special field name like xx_2nd
In the provided code, if the field name follows the pattern "_{digit}{first_alphabet}{other_alphabets}", the "protoc" Java plugin converts the first alphabet of "xx_2nd" to uppercase, resulting in "xx2Nd". However, in the current implementation of the "krotoDC" code, the field name is converted to "xx2nd", which is not compatible with the original Java code.
The draft PR serves as a reference, and it's important to note that the implementation is subject to change.
The text was updated successfully, but these errors were encountered: