Chat Logs

  1. * taylan joined #java
  2. taylanQuestion: If a class A contains code switching over enum E and the values of E are reordered and E recompiled, but A not recompiled, will the switch statement in A still switch over the names of the values, or were the names in the case labels just a stand-in for their ordinal position at the time A was compiled and the cases now apply to different names based on their new ordinal position?
  3. taylan(It was difficult to formulate that question even though it's a simple concept... Not sure I could have formulated it better.)
  4. dreamrealtaylan: I think it'll match based on the actual values and not the ordinals. But javap should tell you that pretty clearly.
  5. taylanI'm looking at the bytecode but don't have any experience reading JVM bytecode. Apparently it creates a SwitchMap populated at class init, and I guess that maps the actual enum value objects to integers, so should be fine I guess. It still calls .ordinal() on them which confused me a bit.
  6. taylanhttps://godbolt.org/z/4qcrWcGnT
  7. nevetCompiler Explorer - Java (jdk 25.0.1)
  8. dreamrealokay, I just ran a test
  9. taylanI'm not sure I understand what 'getstatic #13' and 'getstatic #23' do
  10. dreamrealbuilt two directories, one with enum A, B, C, the other using that in a switch
  11. dreamrealran the class, got the expected output
  12. dreamrealthen I changed the enum to be C, A, B, recompiled it
  13. dreamrealso then I ran the original main() (which was compiled with the other order in the enum) and got the same output
  14. dreamrealso it's working as expected for me, I think
  15. taylanApparently the operand of getstatic is an index into the runtime constant pool which in turn contains *symbolic* references to fields, and that's how it calls ordinal() on the correct enum objects at init.
  16. * sweatiest joined #java
  17. taylanthanks for testing btw 🙏
  18. pingvenoSo, eventually answering my own question... the maven-dependency-plugin's copy-dependencies did the trick for me.
  19. pingvenoNow time to get my dependencies upgraded for 2015
  20. pingvenofrom*
  21. * Ragnor joined #java
  22. * B_fd joined #java
  23. * pioto joined #java
  24. * OmniRadix joined #java
  25. DoofusCanadensisyay!
  26. * pioto joined #java
  27. * Cyp joined #java
  28. * ChaiTRex joined #java
  29. * Aedil joined #java
  30. * marcel joined #java
  31. * roesyyu joined #java
  32. * five618480339176 joined #java
  33. * ForeverDreaming joined #java
  34. * ForeverDreaming joined #java
  35. * Square3 joined #java
  36. * roesyyu joined #java
  37. * B_fd joined #java
  38. * agnivn joined #java
  39. * roesyyu joined #java
  40. * roesyyu joined #java
  41. * pr070cal joined #java
  42. * acidjnk joined #java
  43. * skum joined #java
  44. * SJrX joined #java
  45. * roesyyu joined #java
  46. * agnivn joined #java
  47. * vobar joined #java
  48. * bfindlay joined #java
  49. * MikeBux joined #java
  50. * roesyyu joined #java
  51. * roesyyu joined #java
  52. * agnivn joined #java
  53. * agnivn joined #java
  54. * roesyyu joined #java
  55. * tmm88 joined #java
  56. * agnivn joined #java
  57. * Successus joined #java
  58. dreamrealpingveno: so you're using maven?
  59. dreamrealI thought you were using ant and stuff
  60. * Candle joined #java
  61. * overholts00 joined #java
  62. * roesyyu joined #java
  63. * roesyyu joined #java
  64. * stfstfm joined #java
  65. * mwnaylor joined #java
  66. * metalmaniac joined #java
  67. * B_fd_ joined #java
  68. * stfstfm_ joined #java
  69. * roesyyu joined #java
  70. * agnivn joined #java
  71. * GreenResponse joined #java
  72. * ForeverDreaming joined #java
  73. * roesyyu joined #java
  74. * waznot joined #java
  75. * jreicher joined #java
  76. * roesyyu joined #java
  77. * Maxdamantus joined #java
  78. * x1bncwn joined #java
  79. * jamezp joined #java
  80. * B_fd joined #java
  81. * stewi joined #java
  82. * leppard joined #java
  83. * stfstfm joined #java
  84. * vobar joined #java
  85. * roesyyu joined #java
  86. * roesyyu joined #java
  87. * stfstfm_ joined #java
  88. * stfstfm joined #java
  89. * roesyyu joined #java
  90. * roesyyu joined #java
  91. * roesyyu joined #java
  92. * agnivn joined #java
  93. * polarian_ joined #java
  94. * roesyyu joined #java
  95. * stfstfm_ joined #java
  96. * nevet joined #java
  97. * CodeGeek!~codegeek@about/java/CodeGeek changed the topic to: Welcome! || Read Channel Rules at https://javachannel.org/ before participating. || Paste limit is two lines; ~pastebin lists options. || No applets, please. || Minecraft, Android, and Javascript all have their own channel. || You are being logged.
  98. * agnivn joined #java
  99. * five618480339176 joined #java
  100. * roesyyu joined #java
  101. * leppard joined #java
  102. pingvenodreamreal: I am using ant. This is my pom.xml: https://gist.github.com/adevore/78b33f9ce306d801b267c64335b92bb3
  103. nevetpom.xml for management of a set of jar files
  104. pingvenoIt won't be run as part of the regular build. Just as part of updating that set of jars. At least for now, I might figure out how to integrate maven into the build system.
  105. * roesyyu joined #java
  106. dreamrealyou're ... using ant... with a pom.xml? Oh, a dual structure. Why not use ivy to do the same thing in ant?
  107. pingvenoOh, I'm just not familiar with ivy.
  108. pingvenoAnd the Ant is maintained upstream, so I'm avoiding modifications as much as possible.
  109. * roesyyu joined #java
  110. pingvenoIt's all a bit of a mess :(
  111. Parayou can probably use YourFavoriteAI to ask it to give you the Ant script in some Maven executor plugin garble and then ditch the Ant part.
  112. Para(or somesuch, there's several possible options)
  113. dreamreal~ivy
  114. javabotivy is a dependency manager for ant (but can run stand-alone). It has transitive dependencies and multiple configurations per module. See http://ant.apache.org/ivy/ to get started
  115. ParaIvy is probably one of my favorite small build tools ever.
  116. * roesyyu joined #java
  117. * roesyyu joined #java
  118. * Cyp joined #java
  119. pingvenoHuh, okay, I'll have to look into it. Thanks for the **ptrs.
  120. dreamrealhttps://bytecode.news/posts/2026/04/securing-claude-code-guardrails-for-ai-assisted-development-by-jim-manico
  121. * Afterglow joined #java
  122. * roesyyu joined #java
  123. * roesyyu joined #java
  124. * roesyyu joined #java
  125. * roesyyu joined #java
  126. * Munnu joined #java
  127. * Aedil joined #java
  128. * roesyyu joined #java
  129. * roesyyu joined #java
  130. * roesyyu joined #java
  131. * roesyyu joined #java
  132. * roesyyu joined #java
  133. * kathadris joined #java
  134. * jwisbell35 joined #java
  135. * jwisbell35 joined #java
  136. jbosmanswhen choosing between ant and maven I'd at least make choice, and not try to keep/make both working. Do, or do not. There is no try. (except version control rollback i guess) Lame SW ref included for free
  137. * kathadris joined #java
  138. * jwisbell35 joined #java
  139. dreamrealthey may not have a choice to migrate to something sensible, though
  140. jbosmansyeah understand. Old enough to've been there done that, i've had the luck to be able to create deliverables (jar/war/ear files) using maven while rational app dev/arch was the assumed route
  141. jbosmansdepending on how long/short of a commitment, i'd always go for maven, and then make ant work again if/when needed
  142. ParaThere's an Ant executor plugin for Maven, I think. Just to really lay down that concrete.
  143. dreamrealI would push for maven at all possible costs too
  144. jbosmans:D
  145. jbosmansyeah, for me it was always about project/dependency sanity
  146. dreamrealand predictability
  147. jbosmanstotally
  148. dreamrealwith ant, you can do whatever you want. With maven, the phases are deterministic.
  149. dreamreal"you WILL have this execution. Whether it does what you want... well, you CAN screw that up if you like."
  150. jbosmansyeah and project structure etc
  151. jbosmansmodules
  152. ParaBack in school I did get some extra credit for using Ant to create a simple JSP website which also contained a link to a download which had the whole project embedded as ZIP because we were supposed to return it as part of the assignment.
  153. jbosmansPara, ~which year?
  154. Para2006 or -07, I think.
  155. jbosmansi remember hearing a teacher saying "you can use spring but that's too hard"
  156. jbosmanshah yeah
  157. jbosmansJSP was the name of the game back then
  158. dreamrealspring's too hard compared to WHAT
  159. ParaI think that was also my first case of somewhat malicious compliance.
  160. dreamrealOMG, do people just not remember j2ee?
  161. ParaThe intent was to 1) deploy the website to school's server and 2) copy the file to shared disk :P
  162. dreamreal"look, all you have to do is run ejbc, then put on a deployer hat and figure out your specific app server's JNDI configuration, then deploy and set up resources that JNDI points to..."
  163. ParaI remember being absurdly lost when I saw uhhh what was it even called the first time, the whole j2ee service thing.
  164. jbosmansyeah it was all part of the times, and i didn't know better
  165. jbosmansJNDI :')
  166. jbosmans"magically just works"
  167. dreamrealI had no problems with JNDI BUT expecting every developer to understand all the roles was dumb
  168. dreamrealespecially when it was obvious they didn't
  169. jbosmansyeah, it really was early days in ways
  170. ParaI have to take a moment to jog the poor ol' brain cell, I want to see if I arrive at the right name on my own :)
  171. jbosmansEJB?
  172. ParaEJB local/remote thing
  173. dreamrealremote and local interfaces. And those were LATE EJB.
  174. dreamrealand even those were a sop to IBM and BEA for being incompetent at server design.
  175. jbosmansthose were the days
  176. ParaBack when engineers had to engineer!
  177. jbosmansone eyed king in the land of the blind
  178. dreamrealI have both pity and understanding but no forgiveness
  179. jbosmansbtw <dreamreal> spring's too hard compared to WHAT -> plain servlet + jsp iirc
  180. jbosmans"just the servlet container"
  181. dreamrealjbosmans: so, uh, how does the servlet get JDBC connections? What about looking up other services?
  182. jbosmansdatasources work iirc ?
  183. jbosmansmy teacher said that right? not me
  184. jbosmansit was real early days for spring
  185. dreamrealJNDI data sources?
  186. dreamrealI mean, JNDI is how the app is SUPPOSED to get things from the container
  187. jbosmansand i figure he couldn't tackle spring himself those days
  188. jbosmansiirc datasources can work in a servlet container context "iirc"
  189. dreamrealjbosmans: so they manage the drivers themselves?
  190. dreamrealthere's no "IIRC" here, I know the answers.
  191. dreamrealI don't know what your teachers were saying, of course, but I was there myself.
  192. jbosmansiirc the servlet container yes ?
  193. dreamrealjbosmans: no, the war
  194. jbosmansgiven right declarations in servlet.xml or whatever
  195. jbosmansit's been too long :)
  196. dreamrealdid you deploy a driver in the .war? Or did you get the connection from JNDI?
  197. jbosmansi "think" latter
  198. jbosmansbut it was tomcat for sure
  199. jbosmansearly days tomcat
  200. ParaWell, jogged Claude to get a simple example of that local/remote interface and fuck, no wonder I was confused as a youngling.
  201. jbosmansmm maybe it wasn't tomcat
  202. dreamrealsure. Getting the connection from JNDI: did you set to the tomcat JNDI connection or access the JDBC connection directly? (java:comp/env/jdbc/foo, or "java:/foo"?)
  203. dreamrealtomcat had a JNDI container, because it had to
  204. dreamreallike I said, I was there, I remember
  205. dreamrealI don't know what YOU did but I know what you SHOULD have done and I know what most people ACTUALLY DID and they were not the same things
  206. ParaIt was also fun to deploy on customer's Tomcat.
  207. jbosmansi only remember the early servlet + jsp days where i had a teacher who said spring's too complicated
  208. Para"Yeah so we have these JARs shared by all apps so make sure they don't conflict"
  209. dreamreal think your teacher was a fool
  210. jbosmansit was about passing
  211. jbosmanshe was okay, i learned a lot
  212. dreamrealsure
  213. jbosmanshe wasn't all knowing obv
  214. Para(that's actually part of the reason why we found Ivy so convenient back then, one could make a negation profile of these deployment targets easily and basically tell to compile with all, package with those excluded)
  215. jbosmansiirc spring used ivy for a while
  216. ParaI want to claim a false memory of Ivy stabilizing the idea of provided scope.
  217. jbosmanscould very well be, i couldn't comment
  218. jbosmansjakarta EE still going strong seems like
  219. jbosmansafaik a different kind of spring where capabilities are delegated to the runtime
  220. jbosmansnumber of compliant runtimes seem to be slowly decreasing
  221. jbosmansalas i still have a bunch of velocity templates for one project, may intellij's support never go away
  222. ParaI wish the startup I worked for somehow would've been able to give us the source codes of things before it went totally bust.
  223. ParaWe did fun things for Velocity, for example slurp XML and manipulate it with Velocity as if it was actually easy to work data structure :)
  224. jbosmanshaha yeah
  225. jbosmansit all pivoted more and more towards best IDE support for me
  226. jbosmansthymeleaf is pretty nice, but it'd probably still be velocity (or something extremely dumb & low tech) if the IDE support wasn't up to par
  227. jbosmansi recently did get the thymeleaf layout dialect out of all projects that used it
  228. jbosmansno more groovy runtime ^
  229. dreamrealjakarta EE is never going to go away
  230. dreamrealspring never tried to get rid of j2ee/javaee/jakarta ee
  231. jbosmansi think that'd be good if it never went away
  232. jbosmansyeah i know
  233. dreamrealjust made the low hanging fruit *truly* low hanging fruit and made testing much more easy like it always should have been
  234. jbosmansit's a nice back and forth between jakarta EE and other frameworks, a symbiosis
  235. dreamrealI guess. It's really more that most developers didn't need j2ee, didn't want j2ee, just had no other tools to work with, so when all they had was a hammer, everything looked like a nail
  236. jbosmansyeah i see what you mean && can sympathize
  237. dreamrealsrticle Spring and J2EE
  238. dreamreallogs 75m
  239. dreamrealincludeai
  240. dreamrealdone
  241. dreamrealdang it, I wish I felt good unmuting nevet in here
  242. dreamrealit's just that javabot's sort of the channel pet project, and nevet and javabot would overlap
  243. jbosmansi'd clear that out
  244. jbosmansand set goals, last of which for MVP == unmuted
  245. jbosmansafterwards, it's just a matter of ticking boxes
  246. * jbosmans && full blown getting things done mode in ways
  247. dreamrealwhat do you mean?
  248. dreamrealI don't have a goal of deprecating javabot
  249. dreamrealjavabot's used as a dev platform for a lot of useful projects
  250. javabotdreamreal, what does that even *mean*?
  251. jbosmansit's not about javabot, it's about nevet, you want to unmute it?
  252. jbosmansso what's needed to get that done etc
  253. jbosmans"it can't conflict with javabot" "so make sure it doesn't" etc
  254. dreamrealFor nevet to be unmuted HERE it'd have to be replacing javabot, as some of their feature sets overlap
  255. jbosmanssetting goals && ticking boxes
  256. dreamrealand I do not have a goal of unmuting nevet here
  257. jbosmans<dreamreal> dang it, I wish I felt good unmuting nevet in here
  258. jbosmansi misunderstood you
  259. jbosmanss/you/what you meant
  260. dreamrealI can see value in it being unmuted without a specific goal of unmuting it
  261. dreamrealit would be trivial to actually unmute it, it's a flag in the system
  262. jbosmansyeah i understand irc
  263. dreamreal"don't mute irc for channel #java on libera"
  264. dreamrealand it's not muted on the server level, it's a flag inside nevet itself
  265. dreamrealand it's specifically a flag on THIS channel
  266. jbosmansright, understand, many roads to rome
  267. jbosmansif commands/triggers don't conflict ..
  268. dreamrealbecause I didn't want nevet's url title operation clashing with javabot's, or karma, or factoids, or anything else
  269. dreamrealwell, there are things that are not triggered specifically
  270. dreamreallike url titles, etc
  271. dreamrealthey're both infobots: you really don't want multiple infobots in a single channel. So nevet watches for information it can use (karma, channel logs) and has a flag to never emit content here
  272. jbosmansyeah i understand
  273. dreamrealI can set factoids in nevet here, but it won't emit them here
  274. dreamrealand I don't see it as a competition, because nevet's not "a better javabot," it's a different infobot
  275. jbosmansjust wanted to say, depending on what you want i'd guess you can make it happen :)
  276. dreamrealI could make it happen pretty easily, although I'd want cheeser's permission in any event
  277. dreamreal(it'd be a one-line command to nevet, actually)
  278. jbosmansso there's a checkbox right there :)
  279. jbosmans"an actionable action" (iirc)
  280. dreamreal69
  281. nevet69 is the Java classfile format number for Java 25. Nice! ... and being the product of two primes is neat, too.
  282. dreamrealsee?
  283. Para67
  284. nevet67 is the Java classfile format number for Java 23.
  285. Paraaww
  286. dreamrealI turned it back off :D
  287. dreamrealLike I said, it's a competiton between infobots where I choose specifically to have nevet lose
  288. jbosmansi just meant identify the hills to climb, and climb them
  289. jbosmansnah
  290. dreamrealjbosmans: in general, already done
  291. Para~nevet++
  292. nevet~nevet now has karma of 1.
  293. javabotnevet has a karma level of 1, Para
  294. jbosmanschoose a different trigger char or whatever
  295. dreamrealjbosmans: sure, again, already done
  296. dreamrealsee the ! as opposed to javabot's ~ (and you can set that per network/medium, too)
  297. jbosmansfrom my end, these are trivial challenges given (i'm guessing) all the work that went into nevet
  298. dreamrealbut then you run into url titles
  299. jbosmansso disable that
  300. jbosmansand provide a custom trigger for nevet
  301. dreamrealdisable... the triggerless options?
  302. jbosmansurl www.google.com
  303. jbosmanswhatever
  304. dreamrealew
  305. jbosmanswell if nothing is better .. :)
  306. dreamrealSo there's this project, https://telaproject.org/ and it's very cool
  307. nevetTela
  308. javabotdreamreal's title: "Tela: encrypted remote access from a single binary"
  309. dreamrealhrmm. Wonder what happened THERE?
  310. dreamrealoh, I know
  311. dreamrealBut anyway, THAT's the problem: the utilities between nevet and javabot clash in a lot of ways, and disabling the utilities on a provenance level gets expensive and kinda painful
  312. dreamrealgenerally not worth it
  313. jbosmanswell, you know best in any case
  314. jbosmansi was just trying to point out a complementary approach instead of exclusive
  315. dreamrealI dunno about "best" but I had to make choices and made them the best I could
  316. jbosmansfrankly i'd settle for ! or !! or $ or $$ or ... to trigger
  317. jbosmansif you don't expose functionality, nobody will ever use it, you solved that yourself
  318. dreamrealnevet uses !, javabot uses ~, but there are triggerless functions
  319. jbosmansyeah i understand, so start of with disabling the triggerless functions instead of disabling everything?
  320. jbosmansanyhow, just a suggestion
  321. dreamrealYeah, that's definitely an option, but having a breaker based on *provenances* is something I'm trying to resist, since it's limited so much to specific channels like this one
  322. dreamrealOh, I didn't type "!article" - I typoed it!
  323. dreamrealNo wonder!
  324. dreamrealarticle Spring vs J2EE: not a competition
  325. nevetIdea session started: "Spring vs J2EE: not a competition". Use 'content <text>' to add body paragraphs, 'includeai' to enable AI summary/tags, 'done' to save, or 'cancel' to discard.
  326. dreamreallogs 90m
  327. nevetAdded 100 log messages (last 1h) as content block #1.
  328. dreamrealincludeai
  329. nevetAI summary enabled for "Spring vs J2EE: not a competition". On 'done', a generated summary and suggested tags will be appended to the draft.
  330. dreamrealdone
  331. nevetIdea saved as draft: "Spring vs J2EE: not a competition" (1 content block). AI summary appended for admin review.
  332. dreamrealsince nevet was muted, I figured its silence was a natural outcome :D
  333. dreamrealI figured something was up to swallow the output on the server, turns out I never gave it the START trigger
  334. * stfstfm joined #java
  335. jbosmansyeah, typo'd the trigger :)
  336. dreamrealI just got back from the eye doctor, getting a new prescription, primarily for my work computers :/
  337. jbosmans:/ i can relate
  338. jbosmanscan't read properly late in the evening
  339. dreamrealhuh, that actually worked out pretty well
  340. jbosmansfor me it's fatigue
  341. jbosmansi'm hoping !
  342. dreamrealIt included the entire log, so it noted that there were ancillary topics (velocity, ivy, thymeleaf) but actually got the core of the concept down pretty well as a draft summary
  343. dreamreal(and has a note: "this is not publishable: please edit into shape")
  344. jbosmansnice, llm's being leveraged :)
  345. jbosmansone doesn't belong tho: velocity, ivy, thymeleaf
  346. dreamrealwell, the "!includeai" is releant there
  347. jbosmansor another is missing
  348. dreamrealoh, none of them belong, but the "!logs" goes back and includes ALL OF THE LOGS
  349. dreamrealso ifthere're more than one thing being discussed, it's including them all
  350. jbosmansyeah makes sense
  351. jbosmansit's often mostly about input
  352. dreamrealyeah, the whole goal of nevet was to make discovery easy, and that means trimming things out
  353. dreamrealBTW, *everyone*, I'd appreciate it greatly IF you think bytecode.news is worth reading and IF you'd then propagate the URL about as much as you're willing to. If you don't think it's worth reading, acknowledged (what would change that?) and if you think it's not worth sharing, I understand that too (and what would change THAT?) But if you think it's good and worth sharing... do a brother a solid,
  354. dreamrealwould you?
  355. dreamrealthe site's not monetized and I have no plans to monetize it yet - the backend server is the valuable tech, to me. (content's too easy to fake and find, anyway.) but I'd still like it to be read.
  356. dreamrealIf I could FIND a way to monetize the site after it has decent readership that it deserves, I'm willing to consider it, but... right now, no plans
  357. * roesyyu joined #java
  358. * lockdown joined #java
  359. * agnivn joined #java
  360. * bdkl joined #java
  361. * agnivn joined #java
  362. * Betal joined #java
  363. * BytesAndCoffee joined #java
  364. * bfindlay joined #java
  365. * lockdown joined #java
  366. * roesyyu joined #java