8250859: Address reliance on default constructors in the Accessibility APIs

Reviewed-by: prr
This commit is contained in:
Conor Cleary 2020-09-24 16:06:37 +00:00 committed by Phil Race
parent 89c5e49ba2
commit a9d04408b3
8 changed files with 47 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -79,6 +79,11 @@ import sun.awt.AppContext;
@JavaBean(description = "Minimal information that all accessible objects return") @JavaBean(description = "Minimal information that all accessible objects return")
public abstract class AccessibleContext { public abstract class AccessibleContext {
/**
* Constructor for subclasses to call.
*/
protected AccessibleContext() {}
/** /**
* The {@code AppContext} that should be used to dispatch events for this * The {@code AppContext} that should be used to dispatch events for this
* {@code AccessibleContext}. * {@code AccessibleContext}.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -38,6 +38,11 @@ package javax.accessibility;
*/ */
public abstract class AccessibleHyperlink implements AccessibleAction { public abstract class AccessibleHyperlink implements AccessibleAction {
/**
* Constructor for subclasses to call.
*/
protected AccessibleHyperlink() {}
/** /**
* Since the document a link is associated with may have changed, this * Since the document a link is associated with may have changed, this
* method returns whether or not this Link is still valid (with respect to * method returns whether or not this Link is still valid (with respect to

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -38,6 +38,11 @@ import java.util.ListResourceBundle;
@Deprecated @Deprecated
public class AccessibleResourceBundle extends ListResourceBundle { public class AccessibleResourceBundle extends ListResourceBundle {
/**
* Constructs an {@code AccessibleResourceBundle}.
*/
public AccessibleResourceBundle() {}
/** /**
* Returns the mapping between the programmatic keys and the localized * Returns the mapping between the programmatic keys and the localized
* display strings. * display strings.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -45,6 +45,11 @@ import sun.awt.AWTPermissions;
public class AWTEventMonitor { public class AWTEventMonitor {
/**
* Constructs an {@code AWTEventMonitor}.
*/
public AWTEventMonitor() {}
/** /**
* The current component with keyboard focus. * The current component with keyboard focus.
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -45,6 +45,11 @@ import javax.accessibility.*;
public class AccessibilityEventMonitor { public class AccessibilityEventMonitor {
/**
* Constructs an {@code AccessibilityEventMonitor}.
*/
public AccessibilityEventMonitor() {}
// listeners // listeners
/** /**
* The current list of registered {@link java.beans.PropertyChangeListener * The current list of registered {@link java.beans.PropertyChangeListener

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -46,6 +46,11 @@ public class AccessibilityListenerList {
*/ */
protected transient Object[] listenerList = NULL_ARRAY; protected transient Object[] listenerList = NULL_ARRAY;
/**
* Constructs an {@code AccessibilityListenerList}.
*/
public AccessibilityListenerList() {}
/** /**
* Passes back the event listener list as an array of listener type, listener pairs. * Passes back the event listener list as an array of listener type, listener pairs.
* Note that for performance reasons, this implementation passes back the actual * Note that for performance reasons, this implementation passes back the actual

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,6 +37,11 @@ package com.sun.java.accessibility.util;
*/ */
public class EventID { public class EventID {
/**
* Constructs an {@code EventID}.
*/
public EventID() {}
/** /**
* Maps to AWT Action support (i.e., ActionListener and ActionEvent) * Maps to AWT Action support (i.e., ActionListener and ActionEvent)
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -58,6 +58,10 @@ import javax.accessibility.*;
*/ */
public class SwingEventMonitor extends AWTEventMonitor { public class SwingEventMonitor extends AWTEventMonitor {
/**
* Constructs a {@code SwingEventMonitor}.
*/
/** /**
* The master list of all listeners registered by other classes. * The master list of all listeners registered by other classes.
* This can only be publicly modified by calling the add or * This can only be publicly modified by calling the add or