Skip to content

About Reloadable Infection

rrowlands edited this page Oct 29, 2019 · 1 revision

In our code you'll notice all of our classes implement the Reloadable interface. This is a requirement of our runtime classloader. If you create a new class, and it does not implement Reloadable, you will run into a ClassCastException error at runtime where it tries to cast a class to itself. For example:

GeoEntity cannot be cast to GeoEntity

You can use this regex:

^.*(?:class|interface).implements((?!Reloadable).)$

and search through the codebase to find all classes that are not reloadable. One limitation of this regex is that if the class definition spans multiple lines it will not work, so its not perfect, but if you're scratching your head trying to find out what class doesn't implement Reloadable this can be helpful.