/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4985020
* @summary Tests passing of null as property name
* @author Brent Christian
*/
private static boolean failed;
//PropertyChangeSupport.addPropertyChangeListener(null, listener)
try {
}
}
//PropertyChangeSupport.removePropertyChangeListener(null, listener)
try {
}
}
//PropertyChangeSupport.getPropertyChangeListeners(null)
try {
throw new Error("getPropertyChangeListener() returned null");
}
throw new Error("getPropertyChangeListener() did not return an empty array");
}
}
}
//PropertyChangeSupport.hasListeners(null)
try {
}
}
//PropertyChangeSupport.hasListeners(null): with a generic listener
try {
throw new Error("hasListeners(null) returned false, but there was a generic listener");
}
}
}
//PropertyChangeSupport.hasListeners(null): with a specific listener
try {
throw new Error("hasListeners(null) returned true, but there were no generic listeners - only a specific listener");
}
}
}
//VetoableChangeSupport.addVetoableChangeListener(null, listener)
try {
}
}
//VetoableChangeSupport.removeVetoableChangeListener(null, listener)
try {
}
}
//VetoableChangeSupport.getVetoableChangeListeners(null)
try {
throw new Error("getVetoableChangeListener() returned null");
}
throw new Error("getVetoableChangeListener() did not return an empty array");
}
}
}
//VetoableChangeSupport.hasListeners(null)
try {
}
}
//VetoableChangeSupport.hasListeners(null): with a generic listener
try {
throw new Error("hasListeners(null) returned false, but there was a generic listener");
}
}
}
//VetoableChangeSupport.hasListeners(null): with a specific listener
try {
throw new Error("hasListeners(null) returned true, but there were no generic listeners - only a specific listener");
}
}
}
if (failed) {
throw new Error("TEST FAILED");
}
}
failed = true;
}
throw new Error("shouldn't be any listeners");
}
throw new Error("shouldn't be any listeners");
}
}