tkalkirill commented on code in PR #1239:
URL: https://github.com/apache/ignite-3/pull/1239#discussion_r1005697640
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -49,20 +47,49 @@
* @see CompletableFuture
*/
public class OrderingFuture<T> {
- @SuppressWarnings("rawtypes")
- private static final AtomicReferenceFieldUpdater<OrderingFuture, State>
STATE = newUpdater(OrderingFuture.class, State.class, "state");
+ /**
+ * Integer representation of {@code false}.
+ */
+ private static final int INT_FALSE = 0;
+
+ /**
+ * Integer representation of {@code true}.
+ */
+ private static final int INT_TRUE = 1;
Review Comment:
```suggestion
/** Integer representation of {@code true}. */
private static final int INT_TRUE = 1;
```
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -49,20 +47,49 @@
* @see CompletableFuture
*/
public class OrderingFuture<T> {
- @SuppressWarnings("rawtypes")
- private static final AtomicReferenceFieldUpdater<OrderingFuture, State>
STATE = newUpdater(OrderingFuture.class, State.class, "state");
+ /**
+ * Integer representation of {@code false}.
+ */
+ private static final int INT_FALSE = 0;
Review Comment:
```suggestion
/** Integer representation of {@code false}. */
private static final int INT_FALSE = 0;
```
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -529,12 +537,14 @@ public void notifyHeadToTail(T result, Throwable
exception, ListNode<T> lastNoti
stack.addFirst(node);
}
+ NotificationContext context = new NotificationContext();
Review Comment:
In a local variable, the exception will also be calculated lazily, I think a
class is not needed for this.
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -49,20 +47,49 @@
* @see CompletableFuture
*/
public class OrderingFuture<T> {
- @SuppressWarnings("rawtypes")
- private static final AtomicReferenceFieldUpdater<OrderingFuture, State>
STATE = newUpdater(OrderingFuture.class, State.class, "state");
+ /**
+ * Integer representation of {@code false}.
+ */
+ private static final int INT_FALSE = 0;
+
+ /**
+ * Integer representation of {@code true}.
+ */
+ private static final int INT_TRUE = 1;
+
+ private static final VarHandle STATE;
Review Comment:
I think it is possible to place all `VarHandle` side by side and make
registration in one static block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]