~/talk

Idiomatic Interop

Talkat KotlinConf 2017 · 2017-11-02..11-03· [kotlin, java]
slides:none on file

Explains concrete interop fixes: use @JvmOverloads instead of piling telescoping constructors, add @JvmStatic or use file-level @file:JvmName to expose clean Java APIs, and annotate Kotlin interfaces with @Throws so Java can implement methods that throw checked exceptions. Notes nullability pain: hundreds of Java annotations in one codebase, about 475 annotated so far, and recommends JSR‑305-style defaults via package-info.java to eliminate platform types. Gives workarounds for inline reified generics (add a Class<T> overload) and suggests builders for data classes to make Java callers sane.

AI-written summary · about

  1. 0:00Intro
  2. 0:43Doesnt Kotlin already have 100% interop?
  3. 1:15Who should be thinking about this?
  4. 2:16Your interop story should be
  5. 3:16@Jvm Annotations
  6. 4:32Don't get too carried away
  7. 6:29A less nested way?
  8. 8:35@Throws
  9. 11:46Extension functions
  10. 13:37Inline functions
  11. 14:46Reified generics workaround
  12. 15:41Visibility
  13. 16:04internal
  14. 17:26Package-local
  15. 18:04private
  16. 19:11Nullability Annotations!
  17. 24:46Annotating a package
  18. 25:27DIY Default Nullability Annotations
  19. 27:39Living the dream
  20. 27:56Nulls in libraries
  21. 29:30Lambdas and SAMS
  22. 32:08Lambda signatures
  23. 33:12Unit
  24. 34:18Nothing
  25. 36:12Wildcards
  26. 39:34Data classes
  27. 41:40Overall Interop Thoughts
  28. 42:12Quick Tip
  29. 42:55Resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.