NoFinal.java revision 553:9d9f26857129
1227745Slstewart/* 2227745Slstewart * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. 3227745Slstewart * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4227745Slstewart * 5227745Slstewart * This code is free software; you can redistribute it and/or modify it 6227745Slstewart * under the terms of the GNU General Public License version 2 only, as 7227745Slstewart * published by the Free Software Foundation. 8227745Slstewart * 9227745Slstewart * This code is distributed in the hope that it will be useful, but WITHOUT 10227745Slstewart * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11227745Slstewart * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12227745Slstewart * version 2 for more details (a copy is included in the LICENSE file that 13227745Slstewart * accompanied this code). 14227745Slstewart * 15227745Slstewart * You should have received a copy of the GNU General Public License version 16227745Slstewart * 2 along with this work; if not, write to the Free Software Foundation, 17227745Slstewart * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18227745Slstewart * 19227745Slstewart * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20227745Slstewart * or visit www.oracle.com if you need additional information or have any 21227745Slstewart * questions. 22227745Slstewart */ 23227745Slstewart 24227745Slstewart/* 25227745Slstewart * @test 26227745Slstewart * @bug 5097250 5087624 27227745Slstewart * @summary Finalize methods on enums must be compile time error 28227745Slstewart * @author Peter von der Ah\u00e9 29227745Slstewart * @compile/fail NoFinal.java 30227745Slstewart */ 31227745Slstewart 32227745Slstewartenum NoFinal { 33227776Slstewart A { 34227776Slstewart protected void finalize() { 35227745Slstewart System.err.println("FISK"); 36227776Slstewart } 37227776Slstewart }; 38227776Slstewart} 39227776Slstewart