CDM xml file values truncated at reading

Hello everyone,

I am still struggling with the use of ccsds/cdm reading. The new issue I am encountering is that some values are randomly truncated, while reading som XML CDM files.

In my junit tests, I have values truncated such as :

  • COVARIANCE_METHOD: ULATED is read instead of CALCULATED (exception is thrown)
  • some covariance matrix values : only the last digits are kept (7.51250536593634 becomes 6593634 :scream: ). No exception thrown, but my test is false.

Note that it occurs sometimes :fearful:

I have investigate a lot with debugger to find the root cause, I have verified that the content coming in Orekit is complete and safe. On the other side, I have seen that the values are truncated while XML library is invoking the method org.orekit.files.ccsds.utils.lexical.XmlLexicalAnalyzer.XMLHandler#characters.

The char array is the file itself but truncated :thinking:. The length is consistent with the char array: the read value is only the first digits, then the method is called again with the last digits.
I have a debug trace on that method call (currentElementName + "=" + new String(ch, start, length), showing this strange behavior :


At this moment, I was pretty convinced that the XML was truncating the file content.

I did not succeed to demonstrate the problem in Orekit, with a Junit test, even with the exact same content.

After some Googling, I found this post 164465 – Field value truncated. Guess what? It worked :relieved: !

I still not understading why I cannot reproduce the problem with an Orekit test.
May it be that my application is Java 17 ?

I would like to contribute this fix (I am checking that there is no regressions at the moment) : do you think it could be added in the next release ?

Best regards,


Good catch!

Yes, this should definitely be fixed as soon as possible.

1 Like