Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade JavaParser dependency #86

Open
matozoid opened this issue Apr 13, 2017 · 21 comments
Open

Upgrade JavaParser dependency #86

matozoid opened this issue Apr 13, 2017 · 21 comments

Comments

@matozoid
Copy link

matozoid commented Apr 13, 2017

The latest version is much more stable and has support for Java 9.

https://github.com/javaparser/javaparser/

@hoijui
Copy link

hoijui commented Jan 2, 2018

@matozoid could you give some hints for updating from current javaparser 2.5.1 to the latest? it looks like the API changed a lot (i got something like 100+ compile errors for scalagen).
.. or would i just have to dig through the docs until i understand it, if i were to update this?

@hoijui
Copy link

hoijui commented Jan 2, 2018

@matozoid
Copy link
Author

matozoid commented Jan 2, 2018

Cool :-) I'll help out if it gets too complex.

@hoijui
Copy link

hoijui commented Jan 3, 2018

aehm... i tried, but there are over 600 errors, and while i know my way around in java well, i am a complete beginner in scala, and.. fixing one error might easily take me 5 to 30min, and i probably get to fix it in a very ugly way ... it really makes no sense, as someone else would have to go over it anyway, and it would take me at least a month full time to get it compiling again.

@matozoid
Copy link
Author

matozoid commented Jan 4, 2018

Most of these will probably be because of Optional - so that should be quickfixable by adding .get() there.

@hoijui
Copy link

hoijui commented Jan 4, 2018

i only looked at the first two files with errors, and there nearly everything was about NodeList

@matozoid
Copy link
Author

matozoid commented Jan 4, 2018

What about #84 by the way?

@hoijui
Copy link

hoijui commented Jan 7, 2018

that is actually what i look at/work on. i made some patches on top of that, which nightscape already accepted, here: https://github.com/nightscape/scalagen/tree/functional_visitor
but they are not related to the java parser update.
.. yeah, i consider this branch of him to be latest scalagen development version.

@matozoid
Copy link
Author

matozoid commented Jan 7, 2018

I'm going through the errors. Most are simple name changes (getStmts -> getStatements). Some are annoying errors because we move to a specific list type (ArrayList -> NodeList). A few are because of Optional usage. A bunch are because we no longer have a bit field for modifiers, but an EnumSet.

I haven't done anything with Scala for a few years now, so I'll just try to reduce the error count as much as possible.

@matozoid
Copy link
Author

matozoid commented Jan 7, 2018

I'm over here: https://github.com/matozoid/scalagen/tree/jp_3

@hoijui
Copy link

hoijui commented Jan 7, 2018

ohh nice! :-)
yeah.. if it is too much work, and you know you will take a break.. maybe i will have a try, now that you gave good examples in your wipwip commit for how to do many of the changes.
did you also consider writing a simple script, for at least the name-only changes, which could be run over all the sources at once... or did you already do that?

@matozoid
Copy link
Author

matozoid commented Jan 7, 2018

Name changes are the most satisfying to refactor by hand, so easy ;-) But yeah, just a global search/replace in the IDE would help.

I'm having a break now!

@hoijui
Copy link

hoijui commented Jan 7, 2018 via email

@hoijui
Copy link

hoijui commented Jan 7, 2018 via email

@matozoid
Copy link
Author

matozoid commented Jan 8, 2018

It is very much alive. What I hear from rumours in the consultancy company I work for seems to be that a few percent of software in The Netherlands is built with it. I could easily be off a magnitude though ;-)

@hoijui
Copy link

hoijui commented Jan 8, 2018 via email

@matozoid
Copy link
Author

matozoid commented Jan 9, 2018

So will you work on this more then? :-)

@hoijui
Copy link

hoijui commented Jan 13, 2018 via email

@matozoid
Copy link
Author

Yeah, too much detail, but good luck anyway ;-) Let me know if you have trouble figuring some things out.

@hoijui
Copy link

hoijui commented Jan 13, 2018 via email

@nightscape
Copy link

Hi @matozoid and @hoijui , I've forked this project to https://github.com/scalagen/scalagen
@matozoid I saw that you already made some changes on top of my fork.
Would you mind opening a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants