0234878c4b
Motivation: - A `hashCode` of the SmtpCommand is recalculated on each call of `hashCode()`. Cached hash code value can be just replaced with call of `name.hashCode()`. - The commands cache don't work for strings: `SmtpCommand.valueOf("HELO")` returns a new instance. - Field `contentExpected` is redundant and can be replaced with `equals(DATA)`. Modifications: - Use the `name.hashCode()` as hash code result. - Fix a command cache: use strings as map keys. - Replace field `contentExpected` to using `this.equals(DATA)`. - Add unit tests. Result: More correct and clean code. |
||
---|---|---|
.. | ||
DefaultLastSmtpContent.java | ||
DefaultSmtpContent.java | ||
DefaultSmtpRequest.java | ||
DefaultSmtpResponse.java | ||
LastSmtpContent.java | ||
package-info.java | ||
SmtpCommand.java | ||
SmtpContent.java | ||
SmtpRequest.java | ||
SmtpRequestEncoder.java | ||
SmtpRequests.java | ||
SmtpResponse.java | ||
SmtpResponseDecoder.java | ||
SmtpUtils.java |