Closed Lehonti closed 1 day ago
@cameronwhite I just suppressed the warnings :)
As for the changes that don't directly relate to what's being addressed in the PR: as you've seen, for quite some time now, along with the main changes in the PR in question I've been incorporating changes that are too small to have their own pull request (most commonly in the same files where I'm performing the main changes), in order to save space (because Git stores entire files). If I don't do it that way, how could it be done?
Thanks! I don't know if there's a perfect answer, but it is more time-consuming to review large PRs when there are other formatting / style changes mixed in. I'd limit that to small PRs, or style-only PRs (but those shouldn't be a high priority to work on IMO)
This is a follow-up to #870
A couple remarks, in order to help navigate these changes:
As @cameronwhite mentioned, the constructor of the base class
ShapeTool
was calling a virtual method inside its constructor, which meant that theservices
field in each derived class was not initialized when the method was called, which resulted in an exception being thrown. This was (temporarily) solved by making the call to the methodLazy
. See the constructor ofShapeTool
and the fields above to see what this change entails.Additional to what we saw in that previous pull request, I removed
PintaCore
references from all core services. This involved changing some constructors so that they are passed specific services that the instances depend on, but emphatically not aServiceManager
, because we want to ensure that the services are initialized in the right order (see the static constructor ofPintaCore
to see how the constructors are called), and also some method signatures in some services, such that the services that could not be passed to the respective constructors would be passed as arguments instead. This should be fine in the sense that it should not cause any crashes / throw any exceptions, because all services exposed byPintaCore
are initialized by the time its static constructor returns.There is still a lot of refactoring to be done, but my focus here was on removing
PintaCore
references from a certain key places while keeping the application functioning, otherwise the amount of changes would be extremely large. I plan to refactor further in future pull requests.