[ 
https://issues.apache.org/jira/browse/HADOOP-19243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17884345#comment-17884345
 ] 

ASF GitHub Bot commented on HADOOP-19243:
-----------------------------------------

sadanand48 commented on code in PR #6968:
URL: https://github.com/apache/hadoop/pull/6968#discussion_r1773635798


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java:
##########
@@ -253,9 +253,8 @@ static long toLong(long preferredBlockSize, long 
layoutRedundancy,
 
   private BlockInfo[] blocks;
 
-  INodeFile(long id, byte[] name, PermissionStatus permissions, long mtime,
-            long atime, BlockInfo[] blklist, short replication,
-            long preferredBlockSize) {
+  public INodeFile(long id, byte[] name, PermissionStatus permissions, long 
mtime, long atime,

Review Comment:
   This was done to fix the failing test at 
[TestFileWithSnapshotFeature.java](https://github.com/apache/hadoop/pull/6968/files#diff-1dc61f49252bdd57529e44092586fe9adaba7b1f3f9b8c55e88b21b3ff2aa63d)
 . The test was failing with the mockito-upgrade and in order to fix this, we 
made the change.
   There are a lot of differences b/w older mockito and newer and also b/w 
mockito-core and inline which we have used in  multiple places. So far we have 
iteratively worked on this PR to check what works and almost reached a single 
digit in terms of the failing unit tests for the mockito upgrade required to 
support JDK 17 runtime.
   Some differences I remember b/w mockito versions are : in older mockito 
versions/mockito-core , it is allowed to call a real method although in 
mockito-inline and later versions, every method call must be strictly stubbed 
and define doReturn/doAnswer etc. 





> Upgrade Mockito version to 4.11.0
> ---------------------------------
>
>                 Key: HADOOP-19243
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19243
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Muskan Mishra
>            Assignee: Muskan Mishra
>            Priority: Major
>              Labels: pull-request-available
>
> While Compiling test classes with JDK17, faced error related to Mockito:
> *Mockito cannot mock this class.*
> So to make it compatible with jdk17 we have to upgrade the version of 
> mockito-core as well as mockito-inline.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to