453008e488
Originally reportFromPlugin method was introduced to address the problem with loading of DefaultErrorMessages.Extension vis ServiceLoader. For some cases this extension was not loaded by ServiceLoader because classes was loaded via different class loader, common scenario here is compiler plugins. Ideally we should load such extension point via getService approach, but unfortunately to do that we need project and DefaultErrorMessages.render is static method for now. Also with reportFromPlugin approach is a problem -- all diagnostics reported via this method has the same id: PLUGIN_[WARNING|ERROR|INFO] and it isn't possible to suppress only one particular diagnostic. To bypass this problem the new method initializeFactoryNamesAndDefaultErrorMessages was introduced. It basically store DiagnosticRenderer inside DiagnosticFactory. It is not ideal, because one DiagnosticFactory could have different renderers for different scenarios -- for compiler and for IDE, but I think that it is better than reportByPlugin approach.