Repository: netty/netty
File: codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java (Java)

Code before:
    static final int PUBLICATION_EXPIRY_INTERVAL = 0x02;
    static final int SESSION_EXPIRY_INTERVAL = 0x11;
    static final int WILL_DELAY_INTERVAL = 0x18;
    static final int MAXIMUM_PACKET_SIZE = 0x27;

    // Variable Byte Integer
    static final int SUBSCRIPTION_IDENTIFIER = 0x0B;

    // UTF-8 Encoded String properties
    static final int CONTENT_TYPE = 0x03;
    static final int RESPONSE_TOPIC = 0x08;
    static final int ASSIGNED_CLIENT_IDENTIFIER = 0x12;
    static final int AUTHENTICATION_METHOD = 0x15;
    static final int RESPONSE_INFORMATION = 0x1A;
    static final int SERVER_REFERENCE = 0x1C;
    static final int REASON_STRING = 0x1F;
    static final int USER_PROPERTY = 0x26;

    // Binary Data
    static final int CORRELATION_DATA = 0x09;
    static final int AUTHENTICATION_DATA = 0x16;

    @Deprecated
    public enum MqttPropertyType {
        // single byte properties
        PAYLOAD_FORMAT_INDICATOR(0x01),
        REQUEST_PROBLEM_INFORMATION(0x17),
        REQUEST_RESPONSE_INFORMATION(0x19),
        MAXIMUM_QOS(0x24),
        RETAIN_AVAILABLE(0x25),
        WILDCARD_SUBSCRIPTION_AVAILABLE(0x28),
        SUBSCRIPTION_IDENTIFIER_AVAILABLE(0x29),
        SHARED_SUBSCRIPTION_AVAILABLE(0x2A),

        // two bytes properties
        SERVER_KEEP_ALIVE(0x13),
        RECEIVE_MAXIMUM(0x21),
        TOPIC_ALIAS_MAXIMUM(0x22),
        TOPIC_ALIAS(0x23),

        // four bytes properties
        PUBLICATION_EXPIRY_INTERVAL(0x02),
        SESSION_EXPIRY_INTERVAL(0x11),
        WILL_DELAY_INTERVAL(0x18),
        MAXIMUM_PACKET_SIZE(0x27),

        // Variable Byte Integer
        SUBSCRIPTION_IDENTIFIER(0x0B),

        // UTF-8 Encoded String properties
        CONTENT_TYPE(0x03),

Review comment (suggestion):
We could make the values refer to the constants we define above, instead of giving them as literals. (Easy with some multi-cursor editing-fu)

Code after:
    static final int PUBLICATION_EXPIRY_INTERVAL = 0x02;
    static final int SESSION_EXPIRY_INTERVAL = 0x11;
    static final int WILL_DELAY_INTERVAL = 0x18;
    static final int MAXIMUM_PACKET_SIZE = 0x27;

    // Variable Byte Integer
    static final int SUBSCRIPTION_IDENTIFIER = 0x0B;

    // UTF-8 Encoded String properties
    static final int CONTENT_TYPE = 0x03;
    static final int RESPONSE_TOPIC = 0x08;
    static final int ASSIGNED_CLIENT_IDENTIFIER = 0x12;
    static final int AUTHENTICATION_METHOD = 0x15;
    static final int RESPONSE_INFORMATION = 0x1A;
    static final int SERVER_REFERENCE = 0x1C;
    static final int REASON_STRING = 0x1F;
    static final int USER_PROPERTY = 0x26;

    // Binary Data
    static final int CORRELATION_DATA = 0x09;
    static final int AUTHENTICATION_DATA = 0x16;

    @Deprecated
    public enum MqttPropertyType {
        // single byte properties
        PAYLOAD_FORMAT_INDICATOR(MqttProperties.PAYLOAD_FORMAT_INDICATOR),
        REQUEST_PROBLEM_INFORMATION(MqttProperties.REQUEST_PROBLEM_INFORMATION),
        REQUEST_RESPONSE_INFORMATION(MqttProperties.REQUEST_RESPONSE_INFORMATION),
        MAXIMUM_QOS(MqttProperties.MAXIMUM_QOS),
        RETAIN_AVAILABLE(MqttProperties.RETAIN_AVAILABLE),
        WILDCARD_SUBSCRIPTION_AVAILABLE(MqttProperties.WILDCARD_SUBSCRIPTION_AVAILABLE),
        SUBSCRIPTION_IDENTIFIER_AVAILABLE(MqttProperties.SUBSCRIPTION_IDENTIFIER_AVAILABLE),
        SHARED_SUBSCRIPTION_AVAILABLE(MqttProperties.SHARED_SUBSCRIPTION_AVAILABLE),

        // two bytes properties
        SERVER_KEEP_ALIVE(MqttProperties.SERVER_KEEP_ALIVE),
        RECEIVE_MAXIMUM(MqttProperties.RECEIVE_MAXIMUM),
        TOPIC_ALIAS_MAXIMUM(MqttProperties.TOPIC_ALIAS_MAXIMUM),
        TOPIC_ALIAS(MqttProperties.TOPIC_ALIAS),

        // four bytes properties
        PUBLICATION_EXPIRY_INTERVAL(MqttProperties.PUBLICATION_EXPIRY_INTERVAL),
        SESSION_EXPIRY_INTERVAL(MqttProperties.SESSION_EXPIRY_INTERVAL),
        WILL_DELAY_INTERVAL(MqttProperties.WILL_DELAY_INTERVAL),
        MAXIMUM_PACKET_SIZE(MqttProperties.MAXIMUM_PACKET_SIZE),

        // Variable Byte Integer
        SUBSCRIPTION_IDENTIFIER(MqttProperties.SUBSCRIPTION_IDENTIFIER),

        // UTF-8 Encoded String properties
        CONTENT_TYPE(MqttProperties.CONTENT_TYPE),