Yet another question from yours truly.
I see a lot of class fields with “protected” visibility. I have not counted but it feels like the majority of the fields are protected. This is very uncommon for me, I have learned long ago that composition is preferable to inheritance, and that fields should be marked protected if and only if the class has been designed with inheritance in mind. In todays corporate Java world I would say 99% of the fields are private, the methods are either public, private, or sometimes with package visibility so they can be accessed by unit tests, and even if there is inheritance, the subclasses often access the private fields of the superclass using the public getters/setters. Might seem like an overhead but the JVM can optimize this away at runtime by inlining these accessor methods, modern JVMs can even turn often used code hotspots into native code. The general idea is to hide as much as possible from the outside world and from subclasses, and to only allow access to fields through accessor methods, never directly.
Are all these protected fields in Vassal a kind of public API for the modules, to allow them to inherit from Vassal’s core classes and add/overwrite behaviour?
Or is this a legacy of the C++ developers and the 80ies/90ies style of OOP where inheritance was always a good thing and let’s make everything protected by default in case we want to inherit from it later on?