esa / CCSDS_MO_StubGenerator

Generates technology bindings for CCSDS MAL service specifications
Other
4 stars 9 forks source link

Sorting of errors in the document #6

Closed CesarCoelho closed 8 years ago

CesarCoelho commented 9 years ago

If there are more than 9 errors in a certain operation, these won't be displayed correctly.

Example: If an operation can return 13 errors, this is how they are currently being sorted: 1, 10, 11, 12, 13, 2, 3, 4, 5, 6, ...

My guess is that the generator might be sorting the errors, digit-based from a string and not as a complete number.

CesarCoelho commented 9 years ago

After further analysis, the error seems to be in the following file: https://github.com/esa/CCSDS_MO_StubGenerator/blob/master/GEN_DOCS/src/main/java/esa/mo/tools/stubgen/GeneratorDocx.java

From line 856 until 970. Your tree map is defined to be a String in line 856:

TreeMap<String, List<Object[]>> m = new TreeMap<String, List<Object[]>>();

In line 884:

m.put(String.valueOf(err.getNumber()), v);

This makes the error numbers to be considered as strings and so, the sorting becomes incorrect in the for loop in line: 947

SamCooper commented 8 years ago

Fixed by pull request above