ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. klf List <Integer> numList =Arrays.asList("2383".split("")).stream().map(Integer::parseInt).toList()
  2. klf parseInt returns a (primitive) int, and not an Integer instance.
  3. klf why does the above java code works without first turning the returned int into an Integer instance?
  4. jreicher klf: What makes you think it's not doing that?
  5. klf if it does, then it is not apparent to me from that line of code, which is why I come to ask about it.
  6. jreicher https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html
  7. javabot jreicher's title: "Autoboxing and Unboxing (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)"
  8. nevet Autoboxing and Unboxing (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)
  9. jreicher Maybe you are unaware of this?
  10. klf I see.
  11. jreicher klf: It's a good question, by the way, because autoboxing in a situation like this is a performance hit.
  12. Swayze peformance is only a concern if you're doing millions of requests per second or have some kind of reason to care?
  13. dreamreal Swayze: what?
  14. jbosmans if the main performance concern is the impact of autoboxing, someone's either doing a very good or a very bad job :-)
  15. Para AutoboxingFactory
  16. jbosmans loll
  17. Para Here's something that's kinda insane, Clojure REPL which hooks into a running Spring Boot app, allowing live rewrites of functionality. And it's being driven through Claude, so check the video/terminal recording. https://brdloush.github.io/livewire/
  18. javabot Para's title: "Livewire — Live nREPL wire into your Spring Boot app"
  19. nevet Livewire — Live nREPL wire into your Spring Boot app
  20. Para Mentioning Clojure here feels a bit silly, as it's entirely LLM prompting, but anyhoos.
  21. Para You can still run Clojure REPL stuff with it of course, but I guess the future is now and I'm the old man.
  22. jbosmans agree, impressive
  23. jbosmans don't see myself using it yet on any main projects yet tho, so I'm the old man :)
  24. jbosmans could be nice to try on a small hobby project in a sandboxed env
  25. Para FWIW nREPL protocol does support ssh keys and all, so figure out how to enable that over the socket well before deploying... :)
  26. jbosmans i guess i would only use it in a dev setting anyway
  27. jbosmans hah it's at the bottom of the page: "Dev only. Not for production. You've been warned."
  28. jreicher jbosmans: I think I understand why you say that, but I'm not sure it's completely true. I can imagine someone making a mistake with a very large generic list of integers, iterating over them all and modifying them. They might be confused why it takes longer than they expect.
  29. jbosmans hopefully if it's down to that (or all about that), same someone might look into some dedicated libs for dealing with large primitive collections etc
  30. jbosmans and i guess value classes might soonish help out too