-
Notifications
You must be signed in to change notification settings - Fork 75
src: drop NullaryFunction in favor or java.util.Supplier #2179
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
Conversation
The NullaryFunction has an equivalent in standard java API. So, lets use it.
@kofemann Is this change backwards compatible? |
@mnriem maybe we can just build it, and test it? E.g. by adding it to GlassFish and running all tests that we have? |
@mnriem I am pretty sure this is not a drop-in replacement. However, I have no idea which external applications use grizzly internals. So, I agree with @arjantijms, we just have to build packages, document the change and let depending applications to test. |
* | ||
* @return Attribute<T> | ||
*/ | ||
<T> Attribute<T> createAttribute(String name, org.glassfish.grizzly.utils.NullaryFunction<T> initializer); |
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.
With this removed, after switching client code to Supplier, the method left below is used, which is still marked as deprecated. This causes:
[WARNING] .../mq/main/mq-broker/broker-core/src/main/java/com/sun/messaging/jmq/jmsserver/service/imq/grizzly/GrizzlyMQPacketFilter.java:[42,13] <T>createAttribute(java.lang.String,org.glassfish.grizzly.attributes.NullaryFunction<T>) in org.glassfish.grizzly.attributes.AttributeBuilder has been deprecated
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] .../mq/main/mq-broker/broker-core/src/main/java/com/sun/messaging/jmq/jmsserver/service/imq/grizzly/GrizzlyMQPacketFilter.java: warnings found and -Werror specified
[INFO] 1 error
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.
Looks like the depreciation
left in place unintendedly
- Changed the minimum java version to 11 or higher. - Replaced the use of NullaryFunction, which has been removed since Grizzly framework 4.0.1, with Supplier (related issue eclipse-ee4j/glassfish-grizzly#2179). - Updated the minor version of grizzly-memcached (1.3.x -> 1.4.x).
The NullaryFunction has an equivalent in standard java API. So, lets use it.