-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-2602: Fix x-delay
header to Long
#2603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fast turn around!
Please, consider to add you name to the @author
list of all the affected classes.
spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java
Show resolved
Hide resolved
spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java
Show resolved
Hide resolved
spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java
Outdated
Show resolved
Hide resolved
spring-amqp/src/main/java/org/springframework/amqp/support/SimpleAmqpHeaderMapper.java
Outdated
Show resolved
Hide resolved
@@ -95,6 +95,26 @@ public void fromHeaders() { | |||
assertThat(amqpProperties.getDelay()).isEqualTo(Integer.valueOf(1234)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, consider to not use a deprecated API any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe in supporting deprecated API.
Plus after fixing it with a delegating to a new API, there is no need in double coverage.
spring-amqp/src/test/java/org/springframework/amqp/support/SimpleAmqpHeaderMapperTests.java
Outdated
Show resolved
Hide resolved
Thanks for the review. Is it okay if I change it like this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have not fixed all the usage of the deprecated API yet:
/home/runner/work/spring-amqp/spring-amqp/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitAdminIntegrationTests.java:400: warning: [removal] setDelay(Integer) in MessageProperties has been deprecated and marked for removal
message.getMessageProperties().setDelay(1000);
^
/home/runner/work/spring-amqp/spring-amqp/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitAdminIntegrationTests.java:404: warning: [removal] setDelay(Integer) in MessageProperties has been deprecated and marked for removal
properties.setDelay(500);
^
/home/runner/work/spring-amqp/spring-amqp/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitAdminIntegrationTests.java:410: warning: [removal] getReceivedDelay() in MessageProperties has been deprecated and marked for removal
assertThat(received.getMessageProperties().getReceivedDelay()).isEqualTo(Integer.valueOf(500));
^
/home/runner/work/spring-amqp/spring-amqp/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitAdminIntegrationTests.java:413: warning: [removal] getReceivedDelay() in MessageProperties has been deprecated and marked for removal
assertThat(received.getMessageProperties().getReceivedDelay()).isEqualTo(Integer.valueOf(1000));
spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see more deprecated API usage:
/home/runner/work/spring-amqp/spring-amqp/spring-amqp/src/test/java/org/springframework/amqp/support/SimpleAmqpHeaderMapperTests.java:97: warning: [removal] getDelay() in MessageProperties has been deprecated and marked for removal
assertThat(amqpProperties.getDelay()).isEqualTo(Integer.valueOf(1234));
^
> Task :spring-amqp:compileTestJava
/home/runner/work/spring-amqp/spring-amqp/spring-amqp/src/test/java/org/springframework/amqp/support/SimpleAmqpHeaderMapperTests.java:157: warning: [removal] setReceivedDelay(Integer) in MessageProperties has been deprecated and marked for removal
amqpProperties.setReceivedDelay(1234);
^
/home/runner/work/spring-amqp/spring-amqp/spring-amqp/src/test/java/org/springframework/amqp/core/MessagePropertiesTests.java:58: warning: [removal] setDelay(Integer) in MessageProperties has been deprecated and marked for removal
> Task :checkstyleNohttp
> Task :check
properties.setDelay(delay);
^
/home/runner/work/spring-amqp/spring-amqp/spring-amqp/src/test/java/org/springframework/amqp/core/MessagePropertiesTests.java:60: warning: [removal] setDelay(Integer) in MessageProperties has been deprecated and marked for removal
properties.setDelay(null);
Please, consider to run ./gradlew check
locally before pushing changes.
@@ -66,6 +69,8 @@ public class MessageProperties implements Serializable { | |||
|
|||
public static final Integer DEFAULT_PRIORITY = 0; | |||
|
|||
public static final long X_DELAY_MAX = 0xffffffffL; // (2 ^ 32) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this has to be public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add Javadoc for this new public
API then.
Including @since
Remaining deprecated API usage is to ensure that the old
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update, but I still insist in removing usage of a deprecated API.
Thanks
@@ -66,6 +69,8 @@ public class MessageProperties implements Serializable { | |||
|
|||
public static final Integer DEFAULT_PRIORITY = 0; | |||
|
|||
public static final long X_DELAY_MAX = 0xffffffffL; // (2 ^ 32) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add Javadoc for this new public
API then.
Including @since
@@ -95,6 +95,26 @@ public void fromHeaders() { | |||
assertThat(amqpProperties.getDelay()).isEqualTo(Integer.valueOf(1234)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe in supporting deprecated API.
Plus after fixing it with a delegating to a new API, there is no need in double coverage.
All problems have been fixed, and I have run the Thanks for your help. |
#2602