/*
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/*
 * $Id: RuntimeExceptionPreDestroyBean.java 62525 2011-04-15 12:14:31Z dougd $
 */

package com.sun.ts.tests.jsf.spec.el.managedbean.common;

import javax.annotation.PreDestroy;
import java.io.Serializable;

public class RuntimeExceptionPreDestroyBean implements Serializable {

    // intentionally generate an unchecked exception
    public @PreDestroy void onPreDestroy() {
	PreDestroyProp.setPreDestroyProperty("RuntimeExceptionPreDestroyBean.onPreDestroy invoked");
	String[] list = {"only", "three", "items"};
	for (int i = 0; i <= 3; ++i)
	    System.out.println(list[i]);
    }

    public RuntimeExceptionPreDestroyBean() {
        System.out.println("RuntimeExceptionPreDestroyBean created.");
    }
}
