-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8355065: ConcurrentModificationException in RichDiagnosticFormatter #24769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back cushon! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
Seems |
Hmm, now by stripping, now the metadata is no longer processed and the missing enum problem is no longer reported - this seems to just make the root CME more latent and eliminates one location where it can surface. |
Thanks @liach for taking a look. I agree
I think that's consistent with other errors missing classes, symbols are completed lazily and the errors only get reported if a missing symbol is noticed. The only place this annotation was being completed was unnecessarily during diagnostic formatting, by the call to
The assumption in RichDiagnosticFormatter seems to be that it isn't reentrant, and it only process one diagnostic at a time. If It might also be worthwhile to either update RichDiagnosticFormatter to detect if |
This got me wondering whether we even need |
The class is not designed to be re-entered, and will produce incorrect results if that happens.
I added a draft of the first approach, which causes it to detect if RichDiagnosticFormatter is used recursively and throws an exception. |
private final Map<WhereClauseKind, Map<Type, JCDiagnostic>> whereClauses; | ||
|
||
WhereClauses() { | ||
Map<WhereClauseKind, Map<Type, JCDiagnostic>> whereClauses = new LinkedHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great candidate for EnumMap
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed. (The outer map was an EnumMap before, this was an oversight.)
Hi, please consider this fix for JDK-8355065. RichDiagnosticFormatter is comparing type variables by their
toString
representation, and in this example the comparison fails due to type annotations. Replacing a call tostripMetadataIfNeeded
withstripMetadata
allows the comparison to succeed, and is consistent with the approach used in other parts of RichDiagnosticFormatter (e.g. for the fix for JDK-8144580).Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24769/head:pull/24769
$ git checkout pull/24769
Update a local copy of the PR:
$ git checkout pull/24769
$ git pull https://git.openjdk.org/jdk.git pull/24769/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24769
View PR using the GUI difftool:
$ git pr show -t 24769
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24769.diff
Using Webrev
Link to Webrev Comment