2710N/A/*
2710N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2710N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2710N/A *
2710N/A * This code is free software; you can redistribute it and/or modify it
2710N/A * under the terms of the GNU General Public License version 2 only, as
2710N/A * published by the Free Software Foundation. Oracle designates this
2710N/A * particular file as subject to the "Classpath" exception as provided
2710N/A * by Oracle in the LICENSE file that accompanied this code.
2710N/A *
2710N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2710N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2710N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2710N/A * version 2 for more details (a copy is included in the LICENSE file that
2710N/A * accompanied this code).
2710N/A *
2710N/A * You should have received a copy of the GNU General Public License version
2710N/A * 2 along with this work; if not, write to the Free Software Foundation,
2710N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2710N/A *
2710N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2710N/A * or visit www.oracle.com if you need additional information or have any
2710N/A * questions.
2710N/A */
2710N/A
2710N/A/*
2710N/A * @test
2710N/A * @bug 6912560
2710N/A * @run main/othervm Bug6912560
2710N/A * @summary Make sure that file path canonicalization in
2710N/A * sun.util.calendar.ZoneInfoFile works with the default security
2710N/A * manager.
2710N/A */
2710N/A
2710N/Aimport java.io.File;
2710N/Aimport java.util.*;
2710N/A
2710N/Apublic class Bug6912560 {
2710N/A public static void main(String[] args) {
2710N/A // set the user.timezone property
2710N/A String tzname = "Asia/Tokyo";
2710N/A System.setProperty("user.timezone", tzname);
5534N/A // make sure the timezone will be initialized by
5534N/A // the next call to TimeZone.getDefault()
5534N/A TimeZone.setDefault(null);
2710N/A
2710N/A System.setSecurityManager(new SecurityManager());
2710N/A TimeZone tz = TimeZone.getDefault();
2710N/A if (!tzname.equals(tz.getID())) {
2710N/A throw new RuntimeException("got " + tz.getID()
2710N/A + ", expected " + tzname);
2710N/A }
2710N/A }
2710N/A}