1 /******************************************************************************* 2 * Copyright (c) 2012 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 15 /** 16 * test case for https://bugs.eclipse.org/bugs/show_bug.cgi?id=384458 17 */ 18 public class LocalVariableTests2 { 19 static String[] a = new String[] { "0", "1", "2" }; 20 public static String att = "something"; 21 m1()22 public void m1() { 23 int[] a = new int[] { 101, 102 }; 24 System.err.println(a[1]); 25 } 26 m2(String att)27 public void m2(String att) { 28 if (att == null) { 29 System.out.println("att is null"); 30 } 31 else { 32 System.out.println("att is not null"); 33 } 34 } 35 main(String[] args)36 public static void main(String[] args) { 37 LocalVariableTests2 t2 = new LocalVariableTests2(); 38 t2.m1(); 39 t2.m2(null); 40 } 41 } 42