JPlag
JPlag copied to clipboard
Dynamic Loading of Language Frontends & Fixed behavior of JavaC
This PR resolves two issues:
Dynamic Loading of Language Frontends
In order to use new language frontends in JPlag easily, this PR creates introduces the ServiceLoader API to JPlag (#272 introduced some first idea. This PR realizes the mentioned alternative)
- Languages (entry points of the language frontends) have to be annotated with
@MetaInfServices
and need to have a default constructor. - By doing so we use the ServiceLoader API of Java to load all Language Frontends (in the classpath) to JPlag
- for the CLI, we use
getShortName()
as key - The dependencies between the core algorithm and the frontends has been relaxed
Fixed behavior of JavaC
This PR resolves Issue #467 by disabling the annotation processing of the Java Compiler. This workaround originates from the discussion on stackoverflow.
Its the same problem again as for log4j .. errors will not be generated anymore by Javac
Ok . now it's time for stackoverflow :) Let's wait for more information!
https://stackoverflow.com/questions/72737445/system-java-compiler-behaves-different-depending-on-dependencies-defined-in-mave
@tsaglam resolved issue regarding loading of invalid Java Files (first occurred in #250) See comments in https://github.com/jplag/JPlag/pull/463/commits/541a0e17637a2b5a6dfc50ef1e8e4ca2cfa1d33e and https://stackoverflow.com/questions/72737445/system-java-compiler-behaves-different-depending-on-dependencies-defined-in-mave#
@jplag/maintainer the duplication is only present due to the nature of the language interface :)
@jplag/maintainer in a followup PR we could also remove the direct deps to the front ends (only the CLI should point to them. Other libraries should include the front ends they need, nothing more)
@jplag/maintainer in a followup PR we could also remove the direct deps to the front ends (only the CLI should point to them. Other libraries should include the front ends they need, nothing more)
The core project needs a dependency on the Java frontend for the tests. But for the others, we should be able to do that.
@jplag/maintainer in a followup PR we could also remove the direct deps to the front ends (only the CLI should point to them. Other libraries should include the front ends they need, nothing more)
The core project needs a dependency on the Java frontend for the tests. But for the others, we should be able to do that.
For the tests, yes`.. but for more?
For the tests, yes`.. but for more?
Only for tests afaik.
@jplag/maintainer I've merged all changes of the main branch :)
So it's finally ready for review.
Should we rename any Language
to something like JavaLanguage
or LanguagJava
?
Should we rename any
Language
to something likeJavaLanguage
orLanguagJava
?
I would wait with that until the practicals are over and we rename/refactor the frontends.