--- old/src/java.desktop/share/classes/java/awt/Toolkit.java 2019-02-12 14:26:57.979010400 +0530 +++ new/src/java.desktop/share/classes/java/awt/Toolkit.java 2019-02-12 14:26:56.175882400 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -503,15 +503,17 @@ * implementations of the AccessibilityProvider interface, not by the order * of provider names in the property list. When a provider is found its * accessibility implementation will be started by calling the provider's - * activate method. All errors are handled via an AWTError exception. + * activate method. If the list of assistive technology providers is empty string, + * or contains only white space characters or null then the method returns immediately. + * All other errors are handled via an AWTError exception. */ private static void loadAssistiveTechnologies() { // Load any assistive technologies - if (atNames != null) { + if (atNames != null && !atNames.trim().isEmpty()) { ClassLoader cl = ClassLoader.getSystemClassLoader(); Set names = Arrays.stream(atNames.split(",")) - .map(String::trim) - .collect(Collectors.toSet()); + .map(String::trim) + .collect(Collectors.toSet()); final Map providers = new HashMap<>(); AccessController.doPrivileged((PrivilegedAction) () -> { try { @@ -528,8 +530,8 @@ return null; }); names.stream() - .filter(n -> !providers.containsKey(n)) - .forEach(Toolkit::fallbackToLoadClassForAT); + .filter(n -> !providers.containsKey(n)) + .forEach(Toolkit::fallbackToLoadClassForAT); } } --- old/test/jdk/javax/accessibility/AccessibilityProvider/basic.sh 2019-02-12 14:27:07.383186300 +0530 +++ new/test/jdk/javax/accessibility/AccessibilityProvider/basic.sh 2019-02-12 14:27:05.886440900 +0530 @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ # # @test # @key headful -# @bug 8055160 +# @bug 8055160 8216008 # @summary Unit test for javax.accessibility.AccessibilitySPI # # @build Load FooProvider BarProvider UnusedProvider @@ -89,6 +89,13 @@ PROVIDER1="NoProvider" go fail $PROVIDER1 +# pass if none provider found +PROVIDER1= +go pass $PROVIDER1 + +PROVIDER1=" " +go pass $PROVIDER1 + # setup for two providers COMMA=","