This method (and class) is copied from java2dart translated code in the analysis engine; it will hopefully be removed soon, when we can reference the analysis engine class directly.