JuliaInterop / JavaCall.jl

Call Java from Julia
http://juliainterop.github.io/JavaCall.jl
Other
118 stars 53 forks source link

Updates for 0.7 #73

Closed ExpandingMan closed 6 years ago

ExpandingMan commented 6 years ago

Ok, this is a complete overhaul for 0.7. I have maintained compatibility with 0.6, but dropped compatibility with 0.5. I've also modernized "runtests.jl".

There were quite a few changes here, so I took the opportunity to clean up some code that I found messy or hard to read. Of course this is very subjective, so hopefully I didn't go overboard on that account. The only real change in functionality here is that @jlimport now also filters out ( and ) characters from its arguments, since in 0.7 Julia will insert those automatically to getproperty calls, and Java really doesn't like that. I took the opportunity to rewrite @jlimport slightly to utilize proper multiple dispatch which as been availble on macros since at least 0.6.

On a side note, with this update JDBC should be good-to-go on 0.7.

ExpandingMan commented 6 years ago

DataStructures.jl has been fixed, so I've removed my hack to work-around what was broken.

I think the nightly failure is due to work being done on Pkg.

aviks commented 6 years ago

So I think the nightly failure is due to the use of Pkg.dir somewhere. That function is no longer present in Pkg3, I believe

ExpandingMan commented 6 years ago

Note that the new iterator protocol still hasn't been added to Compat, I was hoping to update that before we merge this, but it's up to you. Any other changes you'd like to see?

ExpandingMan commented 6 years ago

Any requests for changes on this?

aviks commented 6 years ago

We still seem to be doing a Pkg.dir() somewhere that is failing tests.

ExpandingMan commented 6 years ago

Ok, fixed!

(Passing for Windows on AppVeyor still seems somehow miraculous to me... I feel like I never see it happen lol)

aviks commented 5 years ago

So in this PR, the search replace for Void -> Nothing has caused methods like CallStaticVoidMethod to change to CallStaticNothingMethod in jnienv.jl

Unfortunately, there wasnt a test for this. But this fails dependency tests.

ExpandingMan commented 5 years ago

Sorry, I was somewhat careful when doing the global search and replace but I obviously missed these. Will fix.

aviks commented 5 years ago

So changing error to @error changes behaviour, in that the macro version does not throw an exception. Is that intended?

ExpandingMan commented 5 years ago

No, in fact I specifically thought that was not the case. Either way, the behavior is not idea anyway. It really ought to be doing throw(ProperErrorType("message here")). Perhaps we should create a JavaCallError type?

aviks commented 5 years ago

Yeah, possibly. That might allow us to display the Java stack and julia stack properly.