<headius> Not sure but I thought so, enebo will know
subbu has joined #jruby
subbu has quit [Ping timeout: 272 seconds]
dangerousdave has joined #jruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dangerousdave has joined #jruby
dangerousdave has quit [Quit: Textual IRC Client: www.textualapp.com]
<enebo[m]> byteit101: do you mean parse or once it is parsed we will define an annotation?
<byteit101[m]> ruby/stdlib/jruby/compiler/java_signature.rb:135)... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/5ab36d231c6ef75a59e8d628737a95f8939dea1c)
<enebo[m]> byteit101: I can see we parser @Something( .lots of complicated parsing) into an Annotation in the signature parser so we definitely make something we can then use to see whatever is using an annotation
subbu has joined #jruby
<byteit101[m]> class AnnotatedClass; java_signature '@com.fasterxml.jackson.annotation.JsonSetter("phantom") void setPhantom(boolean)'; def setPhantom(p); puts "phantom set: #{p}"; end; end
<byteit101[m]> but add a value= and it works
<byteit101[m]> (adjust to a loaded annotation as necessary)
<enebo[m]> ok I would think that would generate the AST in the signature but it is possible we do not use it? It has been like a decade so I will have to look
<byteit101[m]> I can file an issue if you'd like once you have a look
<enebo[m]> yeah I can spend a few minutes this morning for sure make an issue. we should not be throwing
<enebo[m]> byteit101: what is the actual error at 135?
<enebo[m]> lol this is a backawards backtrace
<enebo[m]> err I am never used to this
<byteit101[m]> NPE
<byteit101[m]> full trace coming up in a moment, about to submit issue
<enebo[m]> How hard will this be to repro on my env?
<byteit101[m]> 1. find an annotation that's loaded
<byteit101[m]> 2. replace name
<byteit101[m]> 3. profit
<byteit101[m]> I always forget the included annotations and end up searching
<byteit101[m]> Oh, the annotation attachment? no, that's only class?
<byteit101[m]> I often use resource I think
<byteit101[m]> look at, oh. there is an all-annotation class in the tests somewhere
<byteit101[m]> "everyannotation"
<enebo[m]> oh so the name = version works?
<byteit101[m]> import javax.annotation.Resource;
<byteit101[m]> may be loaded
<enebo[m]> err value
<byteit101[m]> correct, this is just the non-named syntax
<enebo[m]> byteit101: whew...this should be simpler to fix since I will not need to know more than how to massage the annotation AST in this file
<enebo[m]> Since I have not looked at this or really done anything more than consume annotations in a long time...are all bare values inside the parens just implicitly "value = "
<byteit101[m]> umm...
<enebo[m]> LOL...this is really simple
<enebo[m]> byteit101: can you quickly try this?
<enebo[m]> Change line 7 of DefaultAnnotationParameter super(null, expr) to super("value", expr)
<byteit101[m]> "If there is just one element named value, then the name can be omitted"
<enebo[m]> It is pretty clear our code calls getName() and default anno parm will return null which is why we are crashing (without actually looking)
<enebo[m]> If this is wrong then we need to do something wherever we call getName
<enebo[m]> but your sentence you quoted implies this is the solution
<headius> Good morning!
<byteit101[m]> which file?
<enebo[m]> org.jruby.ast.java_signature.DefaultAnnotationParameter
<byteit101[m]> Ah java code.. not really quickly
<byteit101[m]> (recompiling)
<byteit101[m]> headius: oh while I have jruby on the brain, did you get a chance to review the direction of the post so far as per the email?
<byteit101[m]> no rush, planning oh finishing it this weekend
<byteit101[m]> compiled. let me find how I made this irb session
<byteit101[m]> maven_require 'com.fasterxml.jackson.core:jackson-databind:RELEASE'
<byteit101[m]> oops, wrong spot to paste :-)
<byteit101[m]> No detonation!
<enebo[m]> well that's something
<enebo[m]> but when it is a plain value we make this java object and default anno extends anno in the tree
<enebo[m]> So "value" is right based on the definition you pasted above
<enebo[m]> If it still is not right it likely is no longer the signature parser but our JI internals but if you say the explicit value = works then this should too
<byteit101[m]> => :setPhantom
<byteit101[m]> jruby-9.3.0.0 :006 >
<byteit101[m]> Yup works fine now
<byteit101[m]> a test may be ideal, but you can't use the ./spec/java_integration/fixtures/EveryTypeAnnotations.java
<byteit101[m]> as much as I love that annotation
<enebo[m]> cool. I will commit to jruby-9.3 and I will see if I can easily use one of them and just make a default version
<byteit101[m]> Wait, is it possible to create an annotation class from ruby code now?
subbu has quit [Quit: Leaving]
<enebo[m]> byteit101: I think so but it is mostly just annotating a class.
<byteit101[m]> well annotation are implemented as interfaces, I don't think there is a way to generate interfaces, only reified classes, no?
<enebo[m]> err yeah @interface
<headius> byteit101: I did read through the post and it looks good so far
<headius> decompiled output might be nice using javap, just dump the class to a file and use the basic javap output (maybe -private) to show the generated structure
<byteit101[m]> That's the direction you were hoping for?
<byteit101[m]> Ah yes, I can do that
<headius> yeah I will reply and copy enebo so he can have a look too
<byteit101[m]> cool, any thoughts on the maven_require gem I made for the samples? I talked here this past weekend about maybe including it in jar-dependencies, but that sounded tricker than a quick gem at least for onw
<byteit101[m]> *now
<byteit101[m]> (I've wanted something like it for AGES...)
<byteit101[m]> I'll finish it up this weekend
<byteit101[m]> (the post I'll finish this weekend, that is)
<headius> right, I also like the idea of just getting it into jar-dependencies
<headius> quick gem for trying it out would be good but we can consider merging it in later
<byteit101[m]> It seems very nice, but not quite core-jruby functionality, with maven deps and all
<byteit101[m]> yes, that was my plan
<headius> ok cool
katafrakt[m] has quit [Quit: You have been kicked for being idle]
<headius> enebo: gonna pivot to issues and default gems today
<headius> the frame thing seems to be working but we need to be able to do it even for methods that have gone to full or jit
<enebo[m]> ok
<enebo[m]> I am trying to figure out the Dir.glob thing
<headius> ok
subbu has joined #jruby
<headius> another brick in the wall
<headius> still a few failures in the CRuby tests I am working through
<headius> securerandom gem's rake test goes down to 1 failure with this though
subbu has quit [Ping timeout: 260 seconds]
subbu has joined #jruby