eclipse-aspectj / eclipse.jdt.core

Aspectj JDT Core
Eclipse Public License 2.0
17 stars 6 forks source link

Make batch compiler FileSystem class backward compatible with Eclipse #7

Closed kriegaex closed 3 years ago

kriegaex commented 3 years ago

This commit is one of several steps, necessary to be able to compile JDT Core like Eclipse does it and also running the upstream test suite. Because it works independently of that goal, I think we should merge it separately.

In the past, we changed signatures for FileSystem constructors and also of the getClasspath methods in that class. I looked at a diff and retro-fitted the class to be compatible with upstream again, adding the old constructors back. They delegate to the new ones now, using dummy (mode=-1) or null parameters.

I also adjusted getClasspath, re-introducing 'boolean isSourceOnly' as a local variable, assigning it the value mode == ClasspathLocation.SOURCE. Before, we used (mode & ClasspathLocation.BINARY) == 0, which technically is not the same for the binary-only case we support for AspectJ compilation. That case obviously never occurred in our code, so it did not matter. I changed it anyway, it is cleaner that way. I also tested an artifact containing the change in AspectJ already, and all tests are passing.

BTW, I also removed some cruft from the source code, making it easier to merge in upstream again in the future.