JDK-8216008 : -Djavax.accessibility.assistive_technologies empty list leads to exception
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 9,11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2018-12-30
  • Updated: 2019-05-20
  • Resolved: 2019-04-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b21Fixed
Related Reports
CSR :  
Description
ADDITIONAL SYSTEM INFORMATION :
Java 9 or higher, since revision c44bb2ab6ab7

A DESCRIPTION OF THE PROBLEM :
Using the command line flag -Djavax.accessibility.assistive_technologies with an empty list causes exception because it tries to load a class named empty string.

Revision http://hg.openjdk.java.net/jdk9/client/jdk/rev/c44bb2ab6ab7 changes the parsing of this argument so that no list provided is interpreted as one single class named "" (empty string) rather than an empty list.

REGRESSION : Last worked in version 8u191

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Add -Djavax.accessibility.assistive_technologies flag (empty list) to run any java program with a awt/swing component.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Load no assistive technologies classes.
ACTUAL -
java.awt.AWTError: Assistive Technology not found:
at java.desktop/java.awt.Toolkit.newAWTError(Toolkit.java:472)

Exception trying to load empty string "" assistive technology.

CUSTOMER SUBMITTED WORKAROUND :
Create an empty implementation subclassing javax.accessibility.AccessibilityProvider and provide that class as  -Djavax.accessibility.assistive_technologies so the list is not empty.

FREQUENCY : always



Comments
http://mail.openjdk.java.net/pipermail/swing-dev/2019-February/009377.html
15-02-2019

Additional Information from Submitter: ----------------------------------------------- Hoping to shed some light on the question in the comments: "The only question remains is that why we need to use this system variable in the first place if we don't have anything to load?" The scenario where this system variable is needed to specify "load nothing" is to deal with customer computers where other Java software has been installed, that has written a .accessibility.properties file in the user's home directory specifying to load some assistive technology classes. In the cases where you're packaging software with your own JRE, or if the .accessibility.properties specifies a custom class, those settings in .accessibility.properties in the home folder will crash your program. Clearing the property javax.accessibility.assistive_technologies using System.setProperty() doesn't help; the only way to clear the property was with the command line flag. -----------------------------------------------
30-01-2019

It does not crash like an VM crash but it dies with a java exception. As of now it is within the limits of the implemented functionality and is only an issue with passing the arguments wrongly. Alternatively the when passed with proper class and the same thing is considered for loading the assistive technologies. Hence the priority is reduced to P3.
18-01-2019

Possible inputs for the javax.accessibility.assistive_technologies could consist of valid classes to be loaded for it if the class exists else there will be 2 choices. One is the class name is wrong and in which case class not found error will be thrown and in another case passing empty can be considered as none of the assistive technologies needs to be loaded instead of throwing the error which is happening in the latest JDK12. Empty class name can be considered none of the assistive technologies needs to be loaded. By not trying to load an empty class(which will throw an error), I think it is better not to load anything at all. The only question remains is that why we need to use this system variable in the first place if we don't have anything to load? The only logical reason that I can find is that if there is a need to load the assistive technology list from a configuration file which can vary according to the base system it is running on, just by using this system variable while running, can cause the error to pop up in the case it is an empty list(as the configuaration file is forced to provide some value).
03-01-2019

There needs to be a way to NOT to load any assistive technologies and I think empty string is that way to express. Since the name of the class was not even given, there is no need for class not found exception to be thrown. The error "Assistive Technology not found:" occurs upon a class not found exception thrown for the empty string supplied for the system property "javax.accessibility.assistive_technologies". I think empty string is a good enough way to tell the system not to load any assistive technologies.
03-01-2019

Reported with JDK 9 and above, Using the command line flag -Djavax.accessibility.assistive_technologies with an empty list crashes because it tries to load a class named empty string. Checked this for reported version and could confirm the issue. Result: ========= 8u191: Ok 9: Fail 11.0.1: Fail 12 ea b25: Fail This is a regression in JDK 9 and above. To verify, run the attached test case with respective JDK versions. > java -Djavax.accessibility.assistive_technologies Main Exception in thread "main" java.awt.AWTError: Assistive Technology not found: at java.desktop/java.awt.Toolkit.newAWTError(Toolkit.java:472) at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:488) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ............... ........................ From the description the issue is tracked down to change set: http://hg.openjdk.java.net/jdk9/client/jdk/rev/c44bb2ab6ab7 src/java.desktop/share/classes/java/awt/Toolkit.java 2.93-2.99 StringTokenizer(atNames," ,"); will return no tokens for empty string, but atNames.split(",") will return an array with one string, empty string, in it.
02-01-2019