ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. * taylan joined #java
  2. taylan Question: 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. dreamreal taylan: I think it'll match based on the actual values and not the ordinals. But javap should tell you that pretty clearly.
  5. taylan I'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. taylan https://godbolt.org/z/4qcrWcGnT
  7. nevet Compiler Explorer - Java (jdk 25.0.1)
  8. dreamreal okay, I just ran a test
  9. taylan I'm not sure I understand what 'getstatic #13' and 'getstatic #23' do
  10. dreamreal built two directories, one with enum A, B, C, the other using that in a switch
  11. dreamreal ran the class, got the expected output
  12. dreamreal then I changed the enum to be C, A, B, recompiled it
  13. dreamreal so then I ran the original main() (which was compiled with the other order in the enum) and got the same output
  14. dreamreal so it's working as expected for me, I think
  15. taylan Apparently 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. taylan thanks for testing btw 🙏
  18. pingveno So, eventually answering my own question... the maven-dependency-plugin's copy-dependencies did the trick for me.
  19. pingveno Now time to get my dependencies upgraded for 2015
  20. pingveno from*
  21. * Ragnor joined #java
  22. * B_fd joined #java
  23. * pioto joined #java
  24. * OmniRadix joined #java
  25. DoofusCanadensis yay!
  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. dreamreal pingveno: so you're using maven?
  59. dreamreal I 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. pingveno dreamreal: I am using ant. This is my pom.xml: https://gist.github.com/adevore/78b33f9ce306d801b267c64335b92bb3
  103. nevet pom.xml for management of a set of jar files
  104. pingveno It 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. dreamreal you're ... using ant... with a pom.xml? Oh, a dual structure. Why not use ivy to do the same thing in ant?
  107. pingveno Oh, I'm just not familiar with ivy.
  108. pingveno And the Ant is maintained upstream, so I'm avoiding modifications as much as possible.
  109. * roesyyu joined #java
  110. pingveno It's all a bit of a mess :(
  111. Para you 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. javabot ivy 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. Para Ivy is probably one of my favorite small build tools ever.
  116. * roesyyu joined #java
  117. * roesyyu joined #java
  118. * Cyp joined #java
  119. pingveno Huh, okay, I'll have to look into it. Thanks for the **ptrs.
  120. dreamreal https://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. jbosmans when 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. dreamreal they may not have a choice to migrate to something sensible, though
  140. jbosmans yeah 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. jbosmans depending on how long/short of a commitment, i'd always go for maven, and then make ant work again if/when needed
  142. Para There's an Ant executor plugin for Maven, I think. Just to really lay down that concrete.
  143. dreamreal I would push for maven at all possible costs too
  144. jbosmans :D
  145. jbosmans yeah, for me it was always about project/dependency sanity
  146. dreamreal and predictability
  147. jbosmans totally
  148. dreamreal with 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. jbosmans yeah and project structure etc
  151. jbosmans modules
  152. Para Back 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. jbosmans Para, ~which year?
  154. Para 2006 or -07, I think.
  155. jbosmans i remember hearing a teacher saying "you can use spring but that's too hard"
  156. jbosmans hah yeah
  157. jbosmans JSP was the name of the game back then
  158. dreamreal spring's too hard compared to WHAT
  159. Para I think that was also my first case of somewhat malicious compliance.
  160. dreamreal OMG, do people just not remember j2ee?
  161. Para The 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. Para I remember being absurdly lost when I saw uhhh what was it even called the first time, the whole j2ee service thing.
  164. jbosmans yeah it was all part of the times, and i didn't know better
  165. jbosmans JNDI :')
  166. jbosmans "magically just works"
  167. dreamreal I had no problems with JNDI BUT expecting every developer to understand all the roles was dumb
  168. dreamreal especially when it was obvious they didn't
  169. jbosmans yeah, it really was early days in ways
  170. Para I 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. jbosmans EJB?
  172. Para EJB local/remote thing
  173. dreamreal remote and local interfaces. And those were LATE EJB.
  174. dreamreal and even those were a sop to IBM and BEA for being incompetent at server design.
  175. jbosmans those were the days
  176. Para Back when engineers had to engineer!
  177. jbosmans one eyed king in the land of the blind
  178. dreamreal I have both pity and understanding but no forgiveness
  179. jbosmans btw <dreamreal> spring's too hard compared to WHAT -> plain servlet + jsp iirc
  180. jbosmans "just the servlet container"
  181. dreamreal jbosmans: so, uh, how does the servlet get JDBC connections? What about looking up other services?
  182. jbosmans datasources work iirc ?
  183. jbosmans my teacher said that right? not me
  184. jbosmans it was real early days for spring
  185. dreamreal JNDI data sources?
  186. dreamreal I mean, JNDI is how the app is SUPPOSED to get things from the container
  187. jbosmans and i figure he couldn't tackle spring himself those days
  188. jbosmans iirc datasources can work in a servlet container context "iirc"
  189. dreamreal jbosmans: so they manage the drivers themselves?
  190. dreamreal there's no "IIRC" here, I know the answers.
  191. dreamreal I don't know what your teachers were saying, of course, but I was there myself.
  192. jbosmans iirc the servlet container yes ?
  193. dreamreal jbosmans: no, the war
  194. jbosmans given right declarations in servlet.xml or whatever
  195. jbosmans it's been too long :)
  196. dreamreal did you deploy a driver in the .war? Or did you get the connection from JNDI?
  197. jbosmans i "think" latter
  198. jbosmans but it was tomcat for sure
  199. jbosmans early days tomcat
  200. Para Well, jogged Claude to get a simple example of that local/remote interface and fuck, no wonder I was confused as a youngling.
  201. jbosmans mm maybe it wasn't tomcat
  202. dreamreal sure. 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. dreamreal tomcat had a JNDI container, because it had to
  204. dreamreal like I said, I was there, I remember
  205. dreamreal I 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. Para It was also fun to deploy on customer's Tomcat.
  207. jbosmans i 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. jbosmans it was about passing
  211. jbosmans he was okay, i learned a lot
  212. dreamreal sure
  213. jbosmans he 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. jbosmans iirc spring used ivy for a while
  216. Para I want to claim a false memory of Ivy stabilizing the idea of provided scope.
  217. jbosmans could very well be, i couldn't comment
  218. jbosmans jakarta EE still going strong seems like
  219. jbosmans afaik a different kind of spring where capabilities are delegated to the runtime
  220. jbosmans number of compliant runtimes seem to be slowly decreasing
  221. jbosmans alas i still have a bunch of velocity templates for one project, may intellij's support never go away
  222. Para I 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. Para We 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. jbosmans haha yeah
  225. jbosmans it all pivoted more and more towards best IDE support for me
  226. jbosmans thymeleaf 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. jbosmans i recently did get the thymeleaf layout dialect out of all projects that used it
  228. jbosmans no more groovy runtime ^
  229. dreamreal jakarta EE is never going to go away
  230. dreamreal spring never tried to get rid of j2ee/javaee/jakarta ee
  231. jbosmans i think that'd be good if it never went away
  232. jbosmans yeah i know
  233. dreamreal just made the low hanging fruit *truly* low hanging fruit and made testing much more easy like it always should have been
  234. jbosmans it's a nice back and forth between jakarta EE and other frameworks, a symbiosis
  235. dreamreal I 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. jbosmans yeah i see what you mean && can sympathize
  237. dreamreal srticle Spring and J2EE
  238. dreamreal logs 75m
  239. dreamreal includeai
  240. dreamreal done
  241. dreamreal dang it, I wish I felt good unmuting nevet in here
  242. dreamreal it's just that javabot's sort of the channel pet project, and nevet and javabot would overlap
  243. jbosmans i'd clear that out
  244. jbosmans and set goals, last of which for MVP == unmuted
  245. jbosmans afterwards, it's just a matter of ticking boxes
  246. * jbosmans && full blown getting things done mode in ways
  247. dreamreal what do you mean?
  248. dreamreal I don't have a goal of deprecating javabot
  249. dreamreal javabot's used as a dev platform for a lot of useful projects
  250. javabot dreamreal, what does that even *mean*?
  251. jbosmans it's not about javabot, it's about nevet, you want to unmute it?
  252. jbosmans so what's needed to get that done etc
  253. jbosmans "it can't conflict with javabot" "so make sure it doesn't" etc
  254. dreamreal For nevet to be unmuted HERE it'd have to be replacing javabot, as some of their feature sets overlap
  255. jbosmans setting goals && ticking boxes
  256. dreamreal and 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. jbosmans i misunderstood you
  259. jbosmans s/you/what you meant
  260. dreamreal I can see value in it being unmuted without a specific goal of unmuting it
  261. dreamreal it would be trivial to actually unmute it, it's a flag in the system
  262. jbosmans yeah i understand irc
  263. dreamreal "don't mute irc for channel #java on libera"
  264. dreamreal and it's not muted on the server level, it's a flag inside nevet itself
  265. dreamreal and it's specifically a flag on THIS channel
  266. jbosmans right, understand, many roads to rome
  267. jbosmans if commands/triggers don't conflict ..
  268. dreamreal because I didn't want nevet's url title operation clashing with javabot's, or karma, or factoids, or anything else
  269. dreamreal well, there are things that are not triggered specifically
  270. dreamreal like url titles, etc
  271. dreamreal they'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. jbosmans yeah i understand
  273. dreamreal I can set factoids in nevet here, but it won't emit them here
  274. dreamreal and I don't see it as a competition, because nevet's not "a better javabot," it's a different infobot
  275. jbosmans just wanted to say, depending on what you want i'd guess you can make it happen :)
  276. dreamreal I 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. jbosmans so there's a checkbox right there :)
  279. jbosmans "an actionable action" (iirc)
  280. dreamreal 69
  281. nevet 69 is the Java classfile format number for Java 25. Nice! ... and being the product of two primes is neat, too.
  282. dreamreal see?
  283. Para 67
  284. nevet 67 is the Java classfile format number for Java 23.
  285. Para aww
  286. dreamreal I turned it back off :D
  287. dreamreal Like I said, it's a competiton between infobots where I choose specifically to have nevet lose
  288. jbosmans i just meant identify the hills to climb, and climb them
  289. jbosmans nah
  290. dreamreal jbosmans: in general, already done
  291. Para ~nevet++
  292. nevet ~nevet now has karma of 1.
  293. javabot nevet has a karma level of 1, Para
  294. jbosmans choose a different trigger char or whatever
  295. dreamreal jbosmans: sure, again, already done
  296. dreamreal see the ! as opposed to javabot's ~ (and you can set that per network/medium, too)
  297. jbosmans from my end, these are trivial challenges given (i'm guessing) all the work that went into nevet
  298. dreamreal but then you run into url titles
  299. jbosmans so disable that
  300. jbosmans and provide a custom trigger for nevet
  301. dreamreal disable... the triggerless options?
  302. jbosmans url www.google.com
  303. jbosmans whatever
  304. dreamreal ew
  305. jbosmans well if nothing is better .. :)
  306. dreamreal So there's this project, https://telaproject.org/ and it's very cool
  307. nevet Tela
  308. javabot dreamreal's title: "Tela: encrypted remote access from a single binary"
  309. dreamreal hrmm. Wonder what happened THERE?
  310. dreamreal oh, I know
  311. dreamreal But 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. dreamreal generally not worth it
  313. jbosmans well, you know best in any case
  314. jbosmans i was just trying to point out a complementary approach instead of exclusive
  315. dreamreal I dunno about "best" but I had to make choices and made them the best I could
  316. jbosmans frankly i'd settle for ! or !! or $ or $$ or ... to trigger
  317. jbosmans if you don't expose functionality, nobody will ever use it, you solved that yourself
  318. dreamreal nevet uses !, javabot uses ~, but there are triggerless functions
  319. jbosmans yeah i understand, so start of with disabling the triggerless functions instead of disabling everything?
  320. jbosmans anyhow, just a suggestion
  321. dreamreal Yeah, 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. dreamreal Oh, I didn't type "!article" - I typoed it!
  323. dreamreal No wonder!
  324. dreamreal article Spring vs J2EE: not a competition
  325. nevet Idea 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. dreamreal logs 90m
  327. nevet Added 100 log messages (last 1h) as content block #1.
  328. dreamreal includeai
  329. nevet AI summary enabled for "Spring vs J2EE: not a competition". On 'done', a generated summary and suggested tags will be appended to the draft.
  330. dreamreal done
  331. nevet Idea saved as draft: "Spring vs J2EE: not a competition" (1 content block). AI summary appended for admin review.
  332. dreamreal since nevet was muted, I figured its silence was a natural outcome :D
  333. dreamreal I 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. jbosmans yeah, typo'd the trigger :)
  336. dreamreal I just got back from the eye doctor, getting a new prescription, primarily for my work computers :/
  337. jbosmans :/ i can relate
  338. jbosmans can't read properly late in the evening
  339. dreamreal huh, that actually worked out pretty well
  340. jbosmans for me it's fatigue
  341. jbosmans i'm hoping !
  342. dreamreal It 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. jbosmans nice, llm's being leveraged :)
  345. jbosmans one doesn't belong tho: velocity, ivy, thymeleaf
  346. dreamreal well, the "!includeai" is releant there
  347. jbosmans or another is missing
  348. dreamreal oh, none of them belong, but the "!logs" goes back and includes ALL OF THE LOGS
  349. dreamreal so ifthere're more than one thing being discussed, it's including them all
  350. jbosmans yeah makes sense
  351. jbosmans it's often mostly about input
  352. dreamreal yeah, the whole goal of nevet was to make discovery easy, and that means trimming things out
  353. dreamreal BTW, *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. dreamreal would you?
  355. dreamreal the 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. dreamreal If 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