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

Convert SyncService into Kotlin #623

Merged
merged 1 commit into from
Nov 3, 2019
Merged

Conversation

bemyak
Copy link
Contributor

@bemyak bemyak commented Oct 22, 2019

+Increase heap size for gradle

This PR does nothing with logic and functionality, just conversion.

Motivation is that I'd like to improve SyncService in the future and I thought it might be a good idea to convert this class into kotlin first to make things fancier :)

Also, I had to increase Heap size for gradle, because it started to fail with OutOfMemory error.

@bemyak
Copy link
Contributor Author

bemyak commented Oct 24, 2019

This also closes #625 even without latest commit since I'm able to trigger sync with a command that issue's author mentioned

@nevenz
Copy link
Member

nevenz commented Oct 27, 2019

Increase heap size for gradle

I've recently removed this (77373a9) from project's ./gradle.properties and moved it to my ~/.gradle/gradle.properties, thinking it depends on user's machine. But perhaps it depends more on the project size and needs to be included after all?

This PR does nothing with logic and functionality, just conversion.
This also closes #625 even without latest commit since I'm able to trigger sync with a command that issue's author mentioned

I'm not sure I understand how are these two issues connected?

@nevenz
Copy link
Member

nevenz commented Oct 27, 2019

I've added few comments, there are more cases of !! which could be removed for example, there's one TODO() etc.

I usually take the opportunity when converting Java code to Kotlin to go through it and cleanup some stuff, we shouldn't be just relying on automatic conversion 100%.

Thanks!

@bemyak
Copy link
Contributor Author

bemyak commented Oct 28, 2019

Yes, sure. The point of this PR is to make further changes more clear, so they can be reviewed properly and not get lost in a complete file rewrite. I fixed some of the most nasty examples of not-so-good code generation, but obviously also missed some places.

I'm not sure I understand how are these two issues connected?

My guess on the reason why the sync failed with issue author's command is NullPointer somewhere, because of missing function parameters. Kotlin is much better in null handling so probably that auto-generated code makes additions checks somewhere. The point is that now the sync can be triggered from CLI, or least That Works On My Machine :)

@nevenz
Copy link
Member

nevenz commented Oct 29, 2019

My guess on the reason why the sync failed with issue author's command is NullPointer somewhere, because of missing function parameters. Kotlin is much better in null handling so probably that auto-generated code makes additions checks somewhere. The point is that now the sync can be triggered from CLI, or least That Works On My Machine :)

But it didn't work for you before?

@bemyak
Copy link
Contributor Author

bemyak commented Oct 29, 2019

I haven't try it, but obviously it didn't work for #625 's author

@nevenz
Copy link
Member

nevenz commented Oct 31, 2019

Have you ran tests? I'm getting few of them failing, such as:

  • testLoadRook
  • testRepoAndShelfSetup
  • testGetBooksFromAllRepos
  • testRetrievingBook

BTW, if you can avoid merging back master to the working branch that would be great, to keep git log cleaner. Thanks!

@bemyak bemyak force-pushed the sync-service-2-kt branch 2 times, most recently from 68815bc to 61963c7 Compare November 3, 2019 10:07
@bemyak
Copy link
Contributor Author

bemyak commented Nov 3, 2019

Thank you for addressing this issues.

I fixed the problem that caused test failures (null handling in getBooksFromAllRepos), squashed all commits and rebased on top of current master.

@nevenz nevenz merged commit f0c6bd8 into orgzly:master Nov 3, 2019
@nevenz
Copy link
Member

nevenz commented Nov 3, 2019

I fixed the problem that caused test failures (null handling in getBooksFromAllRepos), squashed all commits and rebased on top of current master.

Great, thank you. I just had to update it for 784290f I did for v1.8.1.

@bemyak bemyak deleted the sync-service-2-kt branch November 3, 2019 18:10
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