jPOS
jPOS copied to clipboard
Standalone BItMap - for LIS5, but perhaps portable?
I need to consider the potential moveable nature of this BitMap field and form a method of keeping track of it/them in the ISOBasePacker processing, since field 65 (for LIS) is currently hardcoded.
Looking at test failures
Added check for fld[65] existence, but this is tied into:-
Issues:
- Backward compatibility and performance of pack operations
- variable fld location for 'Standalone' BitMap, tracking and processing.
I have issues running the tests on windows, so please consider this pull request held and take care in using any part of it!
FYI, I've ran the tests locally, not all, but some of the problems happen in ISOBasePackager line 103 where you check for fld[65] without checking that fld.length > 65, it gives an ArrayIndexOutOfBounds exceptions.
On 30/09/2014 02:34, Alejandro Revilla wrote:
FYI, I've ran the tests locally, not all, but some of the problems happen in ISOBasePackager line 103 where you check for fld[65] without checking that fld.length > 65, it gives an ArrayIndexOutOfBounds exceptions. Ok, I did patch that, but will check again.
It is this specific addition to the BasePackager I dislike immensely and will (I think) restrict the pull request making it in the master.
again, time prevents me making progress...
.. should I withdraw the pull request, is Jarvis repeating the build or is that on a commit/revision basis only?
Mark
Travis should pick your commits toward this PR
I tried out this change but is was not working completely. The BitMap was not set into DE 65 automatically if I set a fields above 128 and in addition the bit in the primary bit map for DE 65 was not set.
I change the adjustBitMapForPack(..) method of the ISOBitMapStandalonePackager and afterwords it was working.
public void adjustBitMapForPack(Map fields, BitSet bitset) {
if (key == 0) {
/*
* we don't have a key, so we have nothing to add to this bitmap exchange.
*/
} else {
/*
* Loop though bitset, unsetting 'our' bits and setting our bits on (relative to base).
*/
int base = (key - 1) << 1 ;
BitSet myBmap = new BitSet();
// set bit for DE 65 in primary bitmap
bitset.set(65);
for (int set = bitset.nextSetBit(base); set >= 0; set = bitset.nextSetBit(set+1)) {
myBmap.set(set-base);
bitset.clear(set);
}
try {
if (bmap == null) {
bmap = new ISOBitMapStandalone(key);
}
bmap.setValue(myBmap);
// set the the 3rd bitmap into DE 65
fields.put(65, bmap);
} catch (ISOException ex) {
ex.printStackTrace();
}
On 02/10/2014 22:18, Manuel83 wrote:
The BitMap was not set into DE 65 automatically if I set a fields above 128 and in addition the bit in the primary bit map for DE 65 was not set. Thanks for the feedback.
I have not used this for messages with fields above 128, good to know it was a simple fix.
Mark