Community
Participate
Working Groups
It appears that the normal control flow on resolving any reference is to create an unresolved message diagnostic in order to remove that diagnostic from the prevailing resource error/warning lists. This is undesirable since construction of the message may involve many internationalised string concatenation and property lookups; not enormously expensive but hardly lightweight as is necessary for an _every_ reference overhead. Particularly inefficient seems to be protected void removeDiagnostic(Triple<EObject, EReference, INode> triple) { DiagnosticMessage message = createDiagnosticMessage(triple); List<Diagnostic> list = getDiagnosticList(message); if (!list.isEmpty()) { Diagnostic diagnostic = createDiagnostic(triple, message); list.remove(diagnostic); } } where createDiagnosticMessage preceeds the list.isEmpty() test. In practice an outer guard on errors or warnings will often find that there are no errors or warnings anyway so no need to construct a message template for a removal. Shouldn't the messages be indexed by some kind of hash wrt the triple so that the messages can be located directly from the triple? indeed this might allow faster incremental update by supporting an old-triple / new-triple correlation.
pushed check for no diagnostics to master
Requested via bug 522520. -M.