-
Notifications
You must be signed in to change notification settings - Fork 95
remove lateinit #396
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
remove lateinit #396
Conversation
|
|
||
| account.loadCredentials(context); | ||
| client.credentials = account.getCredentials().toOkHttpCredentials(); | ||
| val credentials = account.getCredentials().toOkHttpCredentials(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine adding val via lombok in java code but we should then decide to do so. What do you think @tobiasKaminsky @ezaquari? Just asking since this adds a kotlin language feature to java code. Not sure if we want to mix language concepts. I am not having a strong opinion on this. We should then just document such a rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this was just a mistake, as I thought I am writing Kotlin code.
I will change this.
|
Java equivalent of `val` would be `final String` in this case or `final var` (Java 10+).
@AndyScherzinger How can you use `val` in Java using Lombok? I think this feature is not part of Java. Why they even do this kind of stuff?
|
|
@ezaquarii see https://projectlombok.org/features/val - and I don't know why they introduced this feature |
|
You can discuss this, if you want ;-) |
|
It seems to me we are all on the same page, so all good 👍 |
31a41df to
78ec45a
Compare
| val client: OkHttpClient | ||
| class NextcloudClient(var baseUri: Uri, | ||
| var userId: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that by default, Kotlin members are public, contrary to Java, where default scope is package private.
We shall close the access as much as possible. If we need to keep them accessible insidde tests, internal scope can be used to limit access to library only.
78ec45a to
eb51e04
Compare
220afbb to
803df96
Compare
c827122 to
1b5ef4b
Compare
The base branch was changed.
do not use Lombok's val limit scope Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1b5ef4b to
37704c4
Compare
Lint
SpotBugs (new)
SpotBugs (master)
|
|
Unit test failed: https://www.kaminsky.me/nc-dev/library-integrationTests/1442 |
Lint
SpotBugs (new)
SpotBugs (master)
|
|
Test was successful, but codecov timed out, thus merging. |
Fix #395
Based on #394, so let us first merge #394, then I'll rebase this to master, for proper check, etc.
(I just did it this way to have it clean and review can start right away)
Signed-off-by: tobiasKaminsky tobias@kaminsky.me