Skip to content
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

[BUG] Kotlin: Cannot access '***': it is private in 'XXX' #3611

Open
Marblog opened this issue Feb 20, 2024 · 4 comments
Open

[BUG] Kotlin: Cannot access '***': it is private in 'XXX' #3611

Marblog opened this issue Feb 20, 2024 · 4 comments

Comments

@Marblog
Copy link

Marblog commented Feb 20, 2024

Describe the bug
When I have a Java class,Use @DaTa annotation,When kotlin calls a field,error Kotlin: Cannot access 'loginTime': it is private in 'SysUserOnline'

To Reproduce
new Java Class SysUserOnline
use @DaTa
kotlin val sysUserOnline = SysUserOnline()
sysUserOnline.tokenId = “*********”

Version info (please complete the following information):
1.18.24
image
image

@rspilker
Copy link
Collaborator

@Marblog Can you try sysUserOnline.setToken(user.getToken()) or something similar instead of using the names of the private fields?

@Marblog
Copy link
Author

Marblog commented Mar 19, 2024

@Marblog您可以sysUserOnline.setToken(user.getToken())或类似的方法不尝试使用修剪字段的名称吗?

I have no problem using Java.get/set method, but using lombok @Data seems to be no good.

@rspilker
Copy link
Collaborator

Uh, @Data generates the getters and setters for you.

@Marblog
Copy link
Author

Marblog commented Mar 20, 2024

I think there might be some issues with Lombok

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

No branches or pull requests

2 participants