RFR: 8293984: Unnecessary Vector usage in PropertyEditorSupport
Sergey Bylokhov
serb at openjdk.org
Fri Oct 7 00:11:24 UTC 2022
On Mon, 19 Sep 2022 06:55:50 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
> Field PropertyEditorSupport.listeners is accessed only under `synchronized(this)`.
> It means extra synchronization by Vector is not needed.
src/java.desktop/share/classes/java/beans/PropertyEditorSupport.java line 301:
> 299: @SuppressWarnings("unchecked")
> 300: private <T> ArrayList<T> unsafeClone(ArrayList<T> v) {
> 301: return (ArrayList<T>)v.clone();
I think this can be simplified by using the new list in place of "unsafeClone".
-------------
PR: https://git.openjdk.org/jdk/pull/10331
More information about the client-libs-dev
mailing list