Using the asn1bean-compiler on this asn file generates a .java file that does not compile:
TEST
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
ContentInfo ::= SEQUENCE
{
extensionType [0] INTEGER,
length [1] INTEGER
}
END
It generates this (lines 118-128):
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
length = new BerInteger();
vByteCount += length.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
else {
throw new IOException("Tag does not match mandatory sequence component.");
}
And the problem is obviously that a BerInteger is assigned to the local length variable of type BerLength. A trivial fix could be adding this.-prefix to class variable assignments.
Using the asn1bean-compiler on this asn file generates a .java file that does not compile:
It generates this (lines 118-128):
And the problem is obviously that a
BerInteger
is assigned to the local length variable of typeBerLength
. A trivial fix could be addingthis.
-prefix to class variable assignments.