twitter-archive / cloudhopper-smpp

Efficient, scalable, and flexible Java implementation of the Short Messaging Peer to Peer Protocol (SMPP)
Other
382 stars 356 forks source link

Fix-up comments on the SMPP error code constants #116

Closed pcolby closed 8 years ago

pcolby commented 8 years ago

It looks like these were extracted from Table 5-2 of the SMPP Protocol Specification v3.4 using some sort of script / automation, and that extraction got messed up from the STATUS_INVCMDID constant onwards, such that thereafter the constants' comments were placed after the constant, not before.

This change simply moves the relevant constants to their correct location, before their relevant constants, consistent with the class' other constants. The diff is a bit messy, which can't be helped, but the constants themselves (names and values) are not changed.

For interest, the broken layout existed in the very first commit of the SmppConstants.java file (e6965ae0c7c30bd30431de487b9d23e047d9748b) which was an "initial export of svn repo for public release".

To show that the constants were not touched, here's a diff of the change ignoring comment:

git show a4fb64024698d48bfae77db772be14c6560441e7 | sed -nre 's:^-(    [^/]):\1:p' > a.txt 
git show a4fb64024698d48bfae77db772be14c6560441e7 | sed -nre 's:^\+(    [^/]):\1:p' > b.txt 
diff a.txt b.txt
6c6
<     public static final int STATUS_SYSERR = 0x00000008; // System Error

---
>     public static final int STATUS_SYSERR = 0x00000008;
10,11c10,11
<     public static final int STATUS_BINDFAIL = 0x0000000D; // Bind Failed
<     public static final int STATUS_INVPASWD = 0x0000000E; // Invalid Password

---
>     public static final int STATUS_BINDFAIL = 0x0000000D;
>     public static final int STATUS_INVPASWD = 0x0000000E;
37c37
<     public static final int STATUS_UNKNOWNERR = 0x000000FF; // Unknown Error

---
>     public static final int STATUS_UNKNOWNERR = 0x000000FF;

Those lines only changed because their code comments had been moved from the end of the line to the preceding line to be consistent with all the others.

Cheers.