JDK-8058561.js revision 1034:c3339a31daad
142421Syokota/*
242421Syokota * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
342421Syokota * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
442421Syokota *
542421Syokota * This code is free software; you can redistribute it and/or modify it
642421Syokota * under the terms of the GNU General Public License version 2 only, as
742421Syokota * published by the Free Software Foundation.
842421Syokota *
942421Syokota * This code is distributed in the hope that it will be useful, but WITHOUT
1042421Syokota * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1142421Syokota * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1242421Syokota * version 2 for more details (a copy is included in the LICENSE file that
1342421Syokota * accompanied this code).
1442421Syokota *
1542421Syokota * You should have received a copy of the GNU General Public License version
1642421Syokota * 2 along with this work; if not, write to the Free Software Foundation,
1742421Syokota * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1842421Syokota *
1942421Syokota * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2042421Syokota * or visit www.oracle.com if you need additional information or have any
2142421Syokota * questions.
2242421Syokota */
2342421Syokota
2442421Syokota/**
2542421Syokota * JDK-8058561: NPE in LocalVariableTypesCalculator
2642421Syokota *
2742421Syokota * @test
28119418Sobrien * @run
29119418Sobrien * @option --lazy-compilation=false
30119418Sobrien */
3142421Syokota
3242421Syokota// Just attempting to compile this caused the NPE
3342421Syokotafunction func(x, y) {
3442421Syokota  while(true) {
3542421Syokota     switch (y[0]) {
3642421Syokota       case "bar":
3742421Syokota           x = 'xxx';
38139193Sphk           break;
3942421Syokota     }
4042421Syokota  }
41112050Sdwmalone  return x;
42112050Sdwmalone}
4342421Syokota