Skip to content

Conversation

@wescande
Copy link
Contributor

While mocking native interface, it will fail with error such as:

Caused by: java.lang.ClassNotFoundException: Invalid name: [Lbyte[];
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:597)
at java.lang.Class.forName(Class.java:502)
at com.android.dx.mockito.inline.MockMethodAdvice.getOrigin(MockMethodAdvice.java:166)

Indeed "[Lbyte[]" is not correct as the class is a "[[B". Adding entries in MockMethodAdvice to do the conversion with a non specified number of dimension for primitive and qualified type


FYI: Opening request here as I initially made the contribution within android AOSP: https://r.android.com/3470136

@wescande wescande force-pushed the main branch 2 times, most recently from ef27311 to 616a53d Compare January 30, 2025 22:44
Copy link
Contributor

@drewhannay drewhannay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing, just one question!

While mocking native interface, it will fail with error such as:

```
Caused by: java.lang.ClassNotFoundException: Invalid name: [Lbyte[];
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:597)
at java.lang.Class.forName(Class.java:502)
at com.android.dx.mockito.inline.MockMethodAdvice.getOrigin(MockMethodAdvice.java:166)
```

Indeed "[Lbyte[]" is not correct as the class is a "[[B".
Adding entries in MockMethodAdvice to do the conversion with a non
specified number of dimension for primitive and qualified type
@drewhannay drewhannay merged commit b821c5a into linkedin:main Mar 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants