netty5/codec-smtp/src/main/java/io/netty/handler/codec/smtp
Nikolay Fedorovskikh 0234878c4b Fix the commands cache and hashCode() in SmtpCommand
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.
2017-08-18 09:46:53 +02:00
..
DefaultLastSmtpContent.java Make retained derived buffers recyclable 2016-05-17 11:16:13 +02:00
DefaultSmtpContent.java Make retained derived buffers recyclable 2016-05-17 11:16:13 +02:00
DefaultSmtpRequest.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
DefaultSmtpResponse.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
LastSmtpContent.java Make retained derived buffers recyclable 2016-05-17 11:16:13 +02:00
package-info.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
SmtpCommand.java Fix the commands cache and hashCode() in SmtpCommand 2017-08-18 09:46:53 +02:00
SmtpContent.java Make retained derived buffers recyclable 2016-05-17 11:16:13 +02:00
SmtpRequest.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
SmtpRequestEncoder.java Use ByteBuf#writeShort/writeMedium instead of writeBytes 2017-07-10 14:37:41 +02:00
SmtpRequests.java Immediate caching the strings wrapped to AsciiString 2017-08-15 06:22:14 +02:00
SmtpResponse.java [#5088] Add annotation which marks packages/interfaces/classes as unstable 2016-05-09 15:16:35 +02:00
SmtpResponseDecoder.java Don't add null to SmtpResponse.details() 2017-05-23 19:17:59 +02:00
SmtpUtils.java Add smtp codec (client side only). 2016-04-07 18:42:17 +02:00