tkalkirill commented on code in PR #1863:
URL: https://github.com/apache/ignite-3/pull/1863#discussion_r1153072861


##########
modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java:
##########
@@ -150,27 +149,39 @@ public static void setFieldValue(Object obj, Class cls, 
String fieldName, Object
     }
 
     /**
-     * Returns field value.
+     * Finds a field in the given {@code target} object of the {@code 
declaredClass} type.
      *
-     * @param target        target object from which to get field value 
({@code null} for static methods)
+     * @param target        target object from which to get field ({@code 
null} for static methods)
      * @param declaredClass class on which the field is declared
      * @param fieldName     name of the field
-     * @return field value
+     * @return field
      */
-    public static Object getFieldValue(Object target, Class<?> declaredClass, 
String fieldName) {
+    public static Field getField(Object target, Class<?> declaredClass, String 
fieldName) {
         Field field;
         try {
             field = declaredClass.getDeclaredField(fieldName);
         } catch (NoSuchFieldException e) {
             throw new IgniteInternalException("Did not find a field", e);
         }
 
-        if (!field.isAccessible()) {
+        if (!field.canAccess(target)) {
             field.setAccessible(true);
         }
 
+        return field;
+    }
+
+    /**
+     * Returns field value.
+     *
+     * @param target        target object from which to get field value 
({@code null} for static methods)
+     * @param declaredClass class on which the field is declared
+     * @param fieldName     name of the field
+     * @return field value
+     */
+    public static Object getFieldValue(Object target, Class<?> declaredClass, 
String fieldName) {

Review Comment:
   ```suggestion
       public static Object getFieldValue(@Nullable Object target, Class<?> 
declaredClass, String fieldName) {
   ```



##########
modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java:
##########
@@ -150,27 +149,39 @@ public static void setFieldValue(Object obj, Class cls, 
String fieldName, Object
     }
 
     /**
-     * Returns field value.
+     * Finds a field in the given {@code target} object of the {@code 
declaredClass} type.
      *
-     * @param target        target object from which to get field value 
({@code null} for static methods)
+     * @param target        target object from which to get field ({@code 
null} for static methods)
      * @param declaredClass class on which the field is declared
      * @param fieldName     name of the field
-     * @return field value
+     * @return field
      */
-    public static Object getFieldValue(Object target, Class<?> declaredClass, 
String fieldName) {
+    public static Field getField(Object target, Class<?> declaredClass, String 
fieldName) {

Review Comment:
   ```suggestion
       public static Field getField(@Nullable Object target, Class<?> 
declaredClass, String fieldName) {
   ```



##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##########
@@ -197,6 +202,12 @@ public void start() {
                 });
     }
 
+    private long readRevisionFromVault() {
+        VaultEntry entry = vaultMgr.get(APPLIED_REV_KEY).join();

Review Comment:
   Are you sure that we will not hang on the `join()` forever?



-- 
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]

Reply via email to