Closed z2z2qp closed 4 years ago
Hi @z2z2qp - can you provide a unit test with decoding of an NMEA-armored AIS messages that fails? Then I will look into it.
我发现不止这一处会报空指针(I've also found that other places may be NPE.)
like this
NMEAMessageHandler.java
line 66
int numberOfFragments = nmeaMessage.getNumberOfFragments();
“nmeaMessage.getNumberOfFragments()” may be retrun null
line 76
int fragmentNumber = nmeaMessage.getFragmentNumber();
“nmeaMessage.getFragmentNumber()” may be retrun null
我给你邮箱 tbsalling@tbsalling.dk 发了个邮件,有测试的 TCP service
I seemed to have hit this one pretty quickly as well. I believe it has to do with serialisation/deserialisation of bitString
value in AISMessage which is transient
. In our case, we are evaluating the use of this library ontop of Flink/Hadoop etc. And because of the transient
member variables, any time an AISMessage is serialised (e.g. when being passed between nodes), it will fail -- because the transient variable will be null upon deserialisation.
A show stopper if you want to use this library in any system that implements distributed processing.
@michaeljfazio (or @z2z2qp) is it possible that you could provide me with a unit test that demonstrates the exact problem? It makes it a lot easier for me to find a way to support you.
Closed due to lack of activity.
在 AISMessage.java 方法 decodePayloadToBitString 会调用 NMEAMessage.java 内的 方法getFillBits可能出现空指针异常
` protected static String decodePayloadToBitString(NMEAMessage... nmeaMessages) { StringBuilder sixBitEncodedPayload = new StringBuilder(); int fillBits = -1; for (int i = 0; i < nmeaMessages.length; i++) { NMEAMessage m = nmeaMessages[i]; sixBitEncodedPayload.append(m.getEncodedPayload()); if (i == nmeaMessages.length - 1) { fillBits = m.getFillBits();//may be throw NPE } }
`