Instead of considering things from jars to be reloadable if
they are in the same package as subtypes that are also reloadable
it is better to just make the test (isTopmostReloadable()) smarter.
This test determines which reloadable type is the highest in
the hierarchy and gets extra state added to it. With a 'dumb test'
it was assuming further parents were reloadable because they
were in the same package as the subtype. Now it does a more
costly, more precise check.
The original solution had problems because if you made some classes
from a jar reloadable, that confused handled of other subclasses
of those types in other jars (that did not share the same package
name so would not have been made reloadable).
This area of the code to do with a bit of a smack with a
refactoring hammer to streamline it.
- if you force an inclusion via 'inclusions=foo..*' then
allow for everything in that package to be made reloadable
regardless of it coming from jar or disk.
- when inclusion patterns don't match fall back on regular
acceptance mechanisms (like package cache, etc) rather
than just dismissing it.
- the results of decision making around making things
reloadable are now enums/objects rather than plain booleans
so that later we can do further analysis on those
decisions.
Issue: https://github.com/grails/grails-core/issues/8817
New options watchJars takes a colon separated list of jars
(just the jar names, not paths). For example:
-Dspringloaded=watchJars=foo.jar:bar.jar
Committed some very basic tests that are passing, they are in
the SpringLoadedTestsInSeparateJVM test class, see the
tests with 'jar' in the name.
Made rewriting all system classes optional, to enable easy testing
of whether a given problem is simply that some system classes
are currently being ignored.
1. types now keep track of their subtypes, enabling smarters checks
after reloading: "has anything in my hierarchy been reloaded?"
instead of "has anything at all been reloaded?"
2. Building on that, caches related to info built during reflective
calls like 'getDeclaredMethods()' and 'getMethods()' is cleared
from types (and subtypes) during reload. The caches will
subsequently be rebuilt/reused on the next request for that
info.
3. New guards in ivicheck/etc: 'have things in my
hierarchy been reloaded?'
This ASM has a different visitMethodInsn() instruction so
there are big changes throughout the code. The tests are running
fine but as new testcases are added related to Java8 we may need
further fixes to take account of the extra isInterface parameter
on visitMethodInsn()