Skip to content

Conversation

@vp-elitnet
Copy link
Contributor

Trying to decode an enum with a @HasExtensionMarker annotation fails with the following error.

java.lang.UnsupportedOperationException: choice extension is not implemented yet
	at net.gcdc.asn1.uper.EnumCoder.decode(EnumCoder.java:71)
	at net.gcdc.asn1.uper.UperEncoder.decode2(UperEncoder.java:86)
	at net.gcdc.asn1.uper.UperEncoder.decode(UperEncoder.java:61)
	at net.gcdc.asn1.uper.EnumCoderTest.extensibleExtSmall(EnumCoderTest.java:30)

A couple caveats apply to the proposed change:

  • only decoding is supported, but not encoding;
  • an extended enum is returned as null.

Due to the second point above, if a protocol used an extensible optional enum, it would be impossible to tell whether an extended value was encoded or the optional enum was not encoded at all. Anyway, that is in my opinion better than not being able to decode such messages at all. And for protocols that do not use extensible enums there is no impact.

Another point to take care of is version change. If the project followed semver and used Maven Release Plugin (snapshot versions), I would change the version to 1.2.0-SNAPSHOT, but I don't know what the versioning policy is.

@alexvoronov
Copy link
Owner

At least the error message was correct: "not implemented yet" :-) Thanks for adding the implementation!

We can simply bump version to 1.2.0, as a release of this new feature.

@alexvoronov alexvoronov merged commit cfc207f into alexvoronov:master Nov 11, 2025
alexvoronov added a commit that referenced this pull request Nov 11, 2025
Increment Minor version number (x.Y.z) to release the feature added in #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants