ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. NeXeN it's good to have logging whether used or not, and you can simply replace slf4j with whatever you want
  2. NeXeN but yeah that does sound like something the IDE should pick up on
  3. DynamiteDan greetings. I have been trying to use apache juneau to serialize POJOs but I am never able to compile sucessfuly even with AI help. Can anyone point me to an alternative? thanks in advance,
  4. Para ~jackson
  5. javabot Jackson is a library that provides a streaming parser for many, many common dataformats (including ~XML, ~JSON, ~YAML, ~CSV, and others) and can map those formats into and from Java Objects as well. See https://github.com/FasterXML/jackson - it's probably the most common such library in use in Java today.
  6. Para Dunno what your use case specifically is, model mappers is also a category which might be relevant.
  7. DynamiteDan I want to convert a pojo to json
  8. Para Jackson it is then.
  9. DynamiteDan without having the source. I have used gson in the past but it doesn't work as well
  10. DynamiteDan thanks :) let me try.
  11. Para None of these libraries work from source.
  12. Para But gson is also a good option. Everyone uses Jackson though, either directly or indirectly.
  13. dreamreal Jackson.
  14. dreamreal Gson is not a good option.
  15. dreamreal org.json is a TERRIBLE option.
  16. dreamreal What I'm more interested in is what led you to JUNEAU.
  17. DynamiteDan a web search :)
  18. DynamiteDan but I am havin gproblems
  19. dreamreal yikes. Bad search responses. Jackson.
  20. dreamreal var mapper=new ObjectMapper(); var json=mapper.writeValueAsString(thing); // done
  21. DynamiteDan I am havin g problems with the mavem dependencies
  22. DynamiteDan https://www.irccloud.com/pastebin/TWE3klnv/
  23. nevet Snippet | IRCCloud
  24. Para Where's the problem?
  25. DynamiteDan package com.fasterxml.jackson.core does not exist
  26. DynamiteDan just invalidated the caches and it is working
  27. dreamreal what build system
  28. dreamreal and where
  29. dreamreal which jackson version
  30. Para the conflated Java, duh
  31. dreamreal are you doing straight copypasta or are you developing like a real person
  32. dreamreal What made you choose 2.17.2
  33. dreamreal (this is why I suspect copypasta)
  34. dreamreal 2.17.2 is fine, but the recent version is 2.22.1, which your tooling should have suggested to you
  35. dreamreal okay, it's working now, sorry, caught up, was doing errands
  36. Para Also while for testing it's fine as is, but for actual use I'd use <dependencyManagement>
  37. dreamreal most problems are problems for another day :D
  38. Para BTW I've been running claude for a bit now in a "Socratic teacher" mode and it's very neckbeardy and angry at times :D
  39. Para "No. You're wrong. Your code has bugs." is rather refreshing.
  40. Para I'm teaching myself frontend stuff and realized that it kinda works to have the LLM be the teacher. I just need to write a better agent prompt at some point first.
  41. Para I think this might be a path less traveled so the over appeasement filters are not being applied :)
  42. dreamreal That last thing is ALWAYS the case, para.
  43. DynamiteDan ok, it didn't like the class Event from pircbotx ehhe
  44. DynamiteDan the search depth was deeper than 1000
  45. Para 1) we have no idea what you're trying to do 2) it seems you're just slapping things together; you're breaking eggs hoping for an omelette
  46. Chronos I mean, if you break *enough* eggs...
  47. Para If Mythbusters was a thing, I'd want them to try this out.
  48. Para How many eggs does one need to break (and in what conditions) for an omelette to emerge.
  49. Chronos At $WORK, we're in a constant state of third party jar dependency hell. It sucks, to say the least.
  50. DynamiteDan I am jusy experiencing yes
  51. dreamreal worth noting: this has been done. By people in this channel.
  52. Chronos Especially with vulnerabilities flowing like great, mighty rivers.
  53. Chronos Constant update churn.
  54. dreamreal DynamiteDan: that's because of recursion in the data structures.
  55. Para pircbotx's Event also has direct reference to the bot object itself behind a getter, so that definitely will go nuts
  56. dreamreal DynamiteDan: speaking from... imputed experience *from this channel* I'd suggest doing a transformation from pircbotx structures into a persistable form, and using THAT.
  57. DynamiteDan yups, that is what I am doing now
  58. DynamiteDan i have a class named IRCEvent and it has a constructor with a PircBotX Event parameter
  59. DynamiteDan now I need to find out all data I need
  60. DynamiteDan now a OOP problem. Event is a base class and I am dealing with derivated classes for the events. SO I guess I need to parse every type and cast to the proper object
  61. DynamiteDan I haven't done OOP in a while
  62. * dreamreal scans for an ownable problem and fails to find one
  63. * DynamiteDan is almost sleeping
  64. * DynamiteDan is almost sleeping
  65. DynamiteDan hmmm
  66. DynamiteDan where is a action event when you need one hehe
  67. DynamiteDan :
  68. DynamiteDan hmm
  69. DynamiteDan on the event methods I create the proper object, it is the best way
  70. DynamiteDan how do I signal a field not to be serialized?
  71. sonOfRa transient fields are not serialized by java serialization. If you're using other libraries to serialize (jackson for example), you may have to be more careful
  72. sonOfRa iirc a transient field is not serialized, but if it has a public getter, it *will* be serialized through the getter, unless you configure your mapper not to do so
  73. DynamiteDan oh... so much to learn again