Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8141956 | emb-9 | Kim Barrett | P4 | Resolved | Fixed | team |
There are presently several unchecked C-style downcasts to classes in the CollectorPolicy hierarchy. All of these appear to be unnecessary, and could be replaced using existing mechanisms that provide checkable conversions.
There are also a couple of explicit C-style upcasts to CollectorPolicy* that should be unnecessary. One of them can simply be removed. The other (in G1CollectedHeap::collector_policy) is problematic, as the source class (G1CollectorPolicy) is incomplete in this context. This could result in the explicit cast being treated as a reinterpret_cast, which would be wrong. Alternatively, we could end up with an ODR violation.
Note that there don't appear to be any explicit C++ style casts involving this hierarchy.
There are also a couple of explicit C-style upcasts to CollectorPolicy* that should be unnecessary. One of them can simply be removed. The other (in G1CollectedHeap::collector_policy) is problematic, as the source class (G1CollectorPolicy) is incomplete in this context. This could result in the explicit cast being treated as a reinterpret_cast, which would be wrong. Alternatively, we could end up with an ODR violation.
Note that there don't appear to be any explicit C++ style casts involving this hierarchy.
- backported by
-
JDK-8141956 Remove explicit casts in CollectorPolicy hierarchy
-
- Resolved
-
- relates to
-
JDK-8134738 Remove CollectorPolicy::Name
-
- Resolved
-