repo
stringlengths
1
191
file
stringlengths
23
351
code
stringlengths
0
5.32M
file_length
int64
0
5.32M
avg_line_length
float64
0
2.9k
max_line_length
int64
0
288k
extension_type
stringclasses
1 value
WALA
WALA-master/core/src/testSubjects/java/demandpa/Iter.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; interface Iter { Object next(); }
1,974
43.886364
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestArrayList.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; import java.util.ArrayList; public class TestArrayList { public static void main(String[] args) { ArrayList<Object> l1 = new ArrayList<>(); ArrayList<Object> l2 = new ArrayList<>(); l1.add(new Object()); l2.add(new Object()); Object o1 = l1.get(0); Object o2 = l2.get(0); DemandPATestUtil.makeVarUsed(o1); DemandPATestUtil.testThisVar(o2); } }
2,319
41.181818
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestArraySet.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestArraySet { public static void main(String[] args) { ArraySet s1 = new ArraySet(); ArraySet s2 = new ArraySet(); s1.add(new A()); s2.add(new B()); A a = (A) s1.get(); B b = (B) s2.get(); DemandPATestUtil.makeVarUsed(b); DemandPATestUtil.testThisVar(a); } }
2,247
41.415094
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestArraySetIter.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; class TestArraySetIter { public static void main(String[] args) { ArraySet s1 = new ArraySet(); ArraySet s2 = new ArraySet(); s1.add(new A()); s2.add(new B()); A a = (A) s1.iterator().next(); B b = (B) s2.iterator().next(); DemandPATestUtil.makeVarUsed(b); DemandPATestUtil.testThisVar(a); } }
2,268
41.811321
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestArrays.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestArrays { public static void main(String[] args) { Object[] arr = new Object[10]; arr[0] = new Object(); arr[1] = new Object(); DemandPATestUtil.testThisVar(arr[1]); } }
2,144
42.77551
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestArraysCopyOf.java
/* * Copyright (c) 2008 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package demandpa; import java.util.Arrays; public class TestArraysCopyOf { public static void main(String[] args) { Object[] o1 = new Object[1]; Object[] o2 = new Object[1]; o1[0] = new A(); o2[0] = new B(); Object[] o3 = Arrays.copyOf(o1, 1, Object[].class); Arrays.copyOf(o2, 1, Object[].class); Object x = o3[0]; DemandPATestUtil.testThisVar(x); } }
760
26.178571
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestClone.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestClone { private static class A implements Cloneable { public A copy() { A ret = null; try { ret = (A) clone(); } catch (CloneNotSupportedException e) { e.printStackTrace(); } return ret; } } private static class B extends A {} // private static class C extends A { // Object g; // } public static void main(String[] args) { A a = new B(); A a2 = a.copy(); DemandPATestUtil.testThisVar(a2); } }
2,435
35.358209
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestCond.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestCond { public static void main(String[] args) { Object[] arr = new Object[2]; arr[0] = new B(); arr[1] = new A(); Object x = arr[0]; if (x instanceof B) { B b = (B) x; DemandPATestUtil.testThisVar(b); } } }
2,202
40.566038
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestException.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestException { public static void main(String[] args) { try { foo(null); } catch (Exception e) { DemandPATestUtil.testThisVar(e); } } public static void foo(Object o) throws IllegalAccessException { throw new IllegalAccessException(); } }
2,228
40.277778
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestFactory.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestFactory { static A makeA() { return new A(); } public static void main(String[] args) { A a1 = makeA(); A a2 = makeA(); DemandPATestUtil.makeVarUsed(a1); DemandPATestUtil.testThisVar(a2); } }
2,176
40.075472
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestFields.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestFields { public static void main(String[] args) { Object o1 = new Object(); Object o2 = new Object(); A a1 = new A(); A a2 = new A(); a1.f = o1; a2.f = o2; Object o3 = a1.f; Object o4 = a2.f; DemandPATestUtil.makeVarUsed(o3); DemandPATestUtil.testThisVar(o4); } }
2,263
40.163636
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestFieldsHarder.java
/* * Copyright (c) 2002 - 2014 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ /* * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the University of California * (Regents). Provided that this notice and the following two paragraphs are included in any * distribution of Refinement Analysis Tools or its derivative work, Regents agrees not to assert * any of Regents' copyright rights in Refinement Analysis Tools against recipient for recipient's * reproduction, preparation of derivative works, public display, public performance, distribution * or sublicensing of Refinement Analysis Tools and derivative works, in source code and object code * form. This agreement not to assert does not confer, by implication, estoppel, or otherwise any * license or rights in any intellectual property of Regents, including, but not limited to, any * patents of Regents or Regents' employees. * * <p>IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR * CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS * DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * <p>REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY * STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, * PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestFieldsHarder { public static void main(String[] args) { Object o1 = new Object(); A a1 = new A(); a1.f = o1; A a2 = new A(); a2.f = a1; A a3 = (A) a2.f; Object o2 = a3.f; DemandPATestUtil.testThisVar(o2); } }
2,215
45.166667
100
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestGetterSetter.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestGetterSetter { public static void main(String[] args) { Object o1 = new Object(); Object o2 = new Object(); A a1 = new A(); A a2 = new A(); a1.setF(o1); a2.f = o2; Object o3 = a1.getF(); Object o4 = a2.f; DemandPATestUtil.makeVarUsed(o4); DemandPATestUtil.testThisVar(o3); } }
2,276
40.4
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestGlobal.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestGlobal { static Object g = new Object(); static Object getGlobal() { return g; } public static void main(String[] args) { DemandPATestUtil.testThisVar(getGlobal()); } }
2,144
40.25
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestHashMapGet.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestHashMapGet { public static void main(String[] args) { DummyHashMap s1 = new DummyHashMap(); DummyHashMap s2 = new DummyHashMap(); Object key1 = new Object(); Object key2 = new Object(); s1.put(key1, new Object()); s2.put(key2, new Object()); Object o1 = s1.get(key1); Object o2 = s2.get(key2); DemandPATestUtil.makeVarUsed(o1); DemandPATestUtil.testThisVar(o2); } }
2,365
42.018182
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestHashSet.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestHashSet { public static void main(String[] args) { DummyHashSet s1 = new DummyHashSet(); DummyHashSet s2 = new DummyHashSet(); s1.add(new Object()); s2.add(new Object()); Object o1 = s1.iterator().next(); Object o2 = s2.iterator().next(); DemandPATestUtil.makeVarUsed(o1); DemandPATestUtil.testThisVar(o2); } }
2,302
42.45283
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestHashtableEnum.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestHashtableEnum { public static void main(String[] args) { DummyHashMap h1 = new DummyHashMap(); DummyHashMap h2 = new DummyHashMap(); Object key1 = new Object(); Object key2 = new Object(); h1.put(key1, new Object()); h2.put(key2, new Object()); Object o1 = h1.elements().next(); Object o2 = h2.elements().next(); DemandPATestUtil.makeVarUsed(o1); DemandPATestUtil.testThisVar(o2); } }
2,384
42.363636
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestId.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestId { static Object id(Object o) { return o; } public static void main(String[] args) { Object o1 = new Object(); Object o2 = new Object(); Object o3 = id(o1); Object o4 = id(o2); DemandPATestUtil.makeVarUsed(o3); DemandPATestUtil.testThisVar(o4); } }
2,243
39.8
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestLinkedList.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestLinkedList { public static void main(String[] args) { DummyLinkedList l1 = new DummyLinkedList(); DummyLinkedList l2 = new DummyLinkedList(); l1.add(new Object()); l2.add(new Object()); Object o1 = l1.get(0); Object o2 = l2.get(0); DemandPATestUtil.makeVarUsed(o1); DemandPATestUtil.testThisVar(o2); } }
2,295
42.320755
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestLinkedListIter.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestLinkedListIter { public static void main(String[] args) { DummyLinkedList l1 = new DummyLinkedList(); DummyLinkedList l2 = new DummyLinkedList(); l1.add(new Object()); l2.add(new Object()); Object o1 = l1.iterator().next(); Object o2 = l2.iterator().next(); DemandPATestUtil.makeVarUsed(o1); DemandPATestUtil.testThisVar(o2); } }
2,321
42.811321
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestLocals.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestLocals { public static void main(String[] args) { Object x = new Object(); DemandPATestUtil.testThisVar(x); } }
2,079
43.255319
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestMethodRecursion.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestMethodRecursion { static Object foo(Object p1, Object p2, boolean b) { if (b) { return p1; } else { return bar(id(p2), p1, !b); } } static Object choose(Object o1, Object o2, boolean b) { return foo(o1, o2, b); } static Object bar(Object p1, Object p2, boolean b) { return choose(p1, p2, b); } static Object id(Object x) { return x; } public static void main(String[] args) { Object o1 = new Object(); Object o2 = new Object(); Object o3 = foo(o1, o2, false); DemandPATestUtil.testThisVar(o3); } }
2,530
35.157143
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestMultiDim.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestMultiDim { public static void main(String[] args) { Object[][][] multi = new Object[10][10][10]; multi[0] = new Object[10][10]; Object[][] t = multi[0]; Object[] t2 = t[0]; DemandPATestUtil.testThisVar(t2); } }
2,190
42.82
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestNastyPtrs.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; class TestNastyPtrs { static class A { A next0; A next1; A next2; A next3; A next4; A next5; A next6; A next7; A next8; A next9; } public static void main(String[] args) { A a0 = new A(); A a1 = new A(); A a2 = new A(); A a3 = new A(); A a4 = new A(); A a5 = new A(); A a6 = new A(); A a7 = new A(); A a8 = new A(); A a9 = new A(); a0.next0 = a1; a1.next0 = a2; a2.next0 = a3; a3.next0 = a4; a4.next0 = a5; a5.next0 = a6; a6.next0 = a7; a7.next0 = a8; a8.next0 = a9; A x = a0; while (args[0] != null) { x = x.next0; } x.next0 = x; x.next1 = x; x.next2 = x; x.next3 = x; x.next4 = x; x.next5 = x; x.next6 = x; x.next7 = x; x.next8 = x; x.next9 = x; DemandPATestUtil.testThisVar(x); } }
2,823
25.895238
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestOnTheFlyCS.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestOnTheFlyCS { static class C1 { void doSomething(Object o) {} } static class C2 extends C1 { @Override void doSomething(Object o) { DemandPATestUtil.testThisVar(o); } } private static void callDoSomething(C1 c1, Object o) { c1.doSomething(o); } public static void main(String[] args) { callDoSomething(new C1(), new Object()); callDoSomething(new C2(), new Object()); } }
2,379
37.387097
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestOnTheFlySimple.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; /** @author manu */ public class TestOnTheFlySimple { static A makeA() { return new B(); } public static void main(String[] args) { A a2 = new A(); DemandPATestUtil.makeVarUsed(a2); A a = makeA(); Object o = a.foo(); DemandPATestUtil.testThisVar(o); } }
2,225
39.472727
72
java
WALA
WALA-master/core/src/testSubjects/java/demandpa/TestWithinMethodCall.java
/* * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. * * This file is a derivative of code released by the University of * California under the terms listed below. * * Refinement Analysis Tools is Copyright (c) 2007 The Regents of the * University of California (Regents). Provided that this notice and * the following two paragraphs are included in any distribution of * Refinement Analysis Tools or its derivative work, Regents agrees * not to assert any of Regents' copyright rights in Refinement * Analysis Tools against recipient for recipient's reproduction, * preparation of derivative works, public display, public * performance, distribution or sublicensing of Refinement Analysis * Tools and derivative works, in source code and object code form. * This agreement not to assert does not confer, by implication, * estoppel, or otherwise any license or rights in any intellectual * property of Regents, including, but not limited to, any patents * of Regents or Regents' employees. * * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, * INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE * AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY * WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING * DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS * IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ package demandpa; public class TestWithinMethodCall { public static void main(String[] args) { Object o = new Object(); testMethod(o); } private static void testMethod(Object o) { DemandPATestUtil.testThisVar(o); } }
2,158
41.333333
72
java
WALA
WALA-master/core/src/testSubjects/java/dynamicCG/CallbacksMainClass.java
package dynamicCG; import java.util.HashSet; import java.util.Set; public class CallbacksMainClass { private static CallbacksMainClass instance; public static class Junk { static { callSomethingStatic(); } } static { new Junk(); } public static void main(String[] args) { Set<CallbacksMainClass> junk = new HashSet<>(); junk.add(instance); System.err.println(junk.iterator().next().toString()); } public static void callSomethingStatic() { instance = new CallbacksMainClass(); } @Override public String toString() { return callSomething(); } public String callSomething() { return "string"; } }
675
15.9
58
java
WALA
WALA-master/core/src/testSubjects/java/dynamicCG/ExtraClass.java
/* * Copyright (c) 2002 - 2014 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package dynamicCG; public class ExtraClass { private final Object x; private final long l; public ExtraClass(Object x) { this.x = x; this.l = (x == null) ? 0 : x.hashCode(); } public ExtraClass() { this(null); } private static String printObject() { return " (object)"; } private static String getName(Object x) { return x.toString() + printObject(); } @Override public String toString() { String s = getName(x); long t = l; String s2 = getName(x); if (t < 0) { t = 0; } return s + ":" + t + ":" + s2; } }
964
19.978261
72
java
WALA
WALA-master/core/src/testSubjects/java/dynamicCG/MainClass.java
/* * Copyright (c) 2002 - 2014 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package dynamicCG; public class MainClass { private final Object x; private MainClass(Object x) { this.x = x; } private final String printNull() { return "*null*"; } private String callSomething(Object x) { return "mc:" + (x == null ? printNull() : x.toString()); } private String toStringImpl() { try { return "mc:" + x.toString(); } catch (NullPointerException e) { return callSomething(x); } } @Override public String toString() { return toStringImpl(); } public static void main(String[] args) { MainClass mc = new MainClass(new ExtraClass("ExtraClass")); System.err.println(mc); mc = new MainClass(null); System.err.println(mc); mc = new MainClass(new ExtraClass()); System.err.println(mc); } }
1,175
22.058824
72
java
WALA
WALA-master/core/src/testSubjects/java/exceptionpruning/OwnException.java
package exceptionpruning; public class OwnException extends RuntimeException {}
81
19.5
53
java
WALA
WALA-master/core/src/testSubjects/java/exceptionpruning/TestPruning.java
package exceptionpruning; public class TestPruning { public void testTryCatchOwnException(int i) { try { switch (i) { case 1: invokeSingleThrowOwnException(); break; case 2: throw new OwnException(); case 3: invokeSinglePassThrough(); break; case 5: invokeSingleRecursive(i); break; case 4: invokeSingleRecursive2(i); break; } } catch (OwnException e) { } } public int testTryCatchImplicitException(int i) { int res = 0; try { int[] a = new int[] {1, 3, 4}; switch (i) { case 3: invokeSingleImplicitException(a); break; case 4: res = a[5]; } } catch (ArrayIndexOutOfBoundsException e) { } return res; } public void testTryCatchSuper(int i) { try { switch (i) { case 5: invokeSingleThrowOwnException(); break; case 6: throw new OwnException(); case 7: invokeAllPassThrough(); break; } } catch (RuntimeException e) { } } public int testTryCatchMultipleExceptions(int i) { int res = 0; try { int[] a = new int[] {1, 3, 4}; switch (i) { case 7: invokeAll(); break; case 8: throw new OwnException(); case 10: res = a[5]; break; case 11: invokeSingleRecursive(i); break; case 12: invokeSingleRecursive2(i); break; case 13: invokeAllPassThrough(); break; } } catch (ArrayIndexOutOfBoundsException e) { } catch (OwnException e) { } return res; } public void invokeAll() { invokeSingleThrowOwnException(); invokeSingleImplicitException(null); } public void invokeAllPassThrough() { invokeAll(); } public void invokeSinglePassThrough() { invokeSingleThrowOwnException(); } public void invokeSingleThrowOwnException() { throw new OwnException(); } public int invokeSingleImplicitException(int[] a) { // may throw NullPointerException implicit return a[5]; } public void invokeSingleRecursive(int i) { if (i == 0) { throw new OwnException(); } else { invokeSingleRecursive(i - 1); } } public void invokeSingleRecursive2(int i) { if (i == 0) { throw new OwnException(); } else { invokeSingleRecursive2Helper(i - 1); } } public void invokeSingleRecursive2Helper(int i) { invokeSingleRecursive2(i); } public static void main(String[] args) { TestPruning test = new TestPruning(); for (int i = 0; i < 50; i++) { test.testTryCatchOwnException(i); test.testTryCatchMultipleExceptions(i); test.testTryCatchImplicitException(i); test.testTryCatchSuper(i); } } }
2,969
18.932886
53
java
WALA
WALA-master/core/src/testSubjects/java/finalizers/Finalizers.java
package finalizers; public class Finalizers { private void sillyMethod() {} @Override protected void finalize() { sillyMethod(); } public static void main(String[] args) { new Finalizers().sillyMethod(); } }
232
13.5625
42
java
WALA
WALA-master/core/src/testSubjects/java/hello/Hello.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package hello; public class Hello { public static void main(String[] args) { System.out.println("Hello world"); } }
494
25.052632
72
java
WALA
WALA-master/core/src/testSubjects/java/inner/TestInner.java
/* * Copyright (c) 2008 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package inner; public class TestInner { public class A {} }
432
24.470588
72
java
WALA
WALA-master/core/src/testSubjects/java/inner/TestStaticInner.java
/* * Copyright (c) 2008 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package inner; public class TestStaticInner { public static class A {} }
445
25.235294
72
java
WALA
WALA-master/core/src/testSubjects/java/lambda/CallMetaFactory.java
package lambda; import java.lang.invoke.LambdaConversionException; import java.lang.invoke.LambdaMetafactory; public class CallMetaFactory { public static void main(String[] args) throws IllegalAccessException, InstantiationException, LambdaConversionException { // shouldn't crash on this LambdaMetafactory m = LambdaMetafactory.class.newInstance(); // shouldn't crash on this either LambdaMetafactory.altMetafactory(null, null, null); } }
471
26.764706
88
java
WALA
WALA-master/core/src/testSubjects/java/lambda/MethodRefs.java
package lambda; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; public class MethodRefs { interface I { void target(); } static class C1 implements I { @Override public void target() {} } static class C2 implements I { @Override public void target() {} } static class C3 implements I { @Override public void target() {} } static class C4 implements I { @Override public void target() {} } static class C5 implements I { @Override public void target() {} } static class Dummy { Dummy(I i) { i.target(); } } static void fun1(I i) { i.target(); } static void fun1Ref() { Consumer<I> c = MethodRefs::fun1; I x = new C1(); c.accept(x); } void fun2(I i) { i.target(); } public static void main(String[] args) { fun1Ref(); MethodRefs r = new MethodRefs(); Consumer<I> c = r::fun2; c.accept(new C2()); BiConsumer<MethodRefs, I> bc = MethodRefs::fun2; bc.accept(r, new C3()); Function<I, Dummy> f = Dummy::new; f.apply(new C4()); } }
1,160
14.48
52
java
WALA
WALA-master/core/src/testSubjects/java/lambda/ParamsAndCapture.java
package lambda; public class ParamsAndCapture { interface A { void target(); } static class C1 implements A { @Override public void target() {} } static class C2 implements A { @Override public void target() {} } static class C3 implements A { @Override public void target() {} } static class C4 implements A { @Override public void target() {} } static class C5 implements A { @Override public void target() {} } interface Params { void m(A a1, A a2, A a3); } public static void main(String[] args) { A x = new C4(), y = new C5(); Params p = (p1, p2, p3) -> { x.target(); y.target(); p1.target(); p2.target(); p3.target(); }; p.m(new C1(), new C2(), new C3()); } }
840
13.5
42
java
WALA
WALA-master/core/src/testSubjects/java/lambda/SortingExample.java
package lambda; import java.util.Arrays; import java.util.Comparator; public class SortingExample { private final String[] strings; public SortingExample(int n) { this.strings = new String[n]; for (int i = 0; i < n; i++) { strings[i] = "str" + i; } } private String[] sort(Comparator<String> c) { String[] strs = strings.clone(); Arrays.sort(strs, c); return strs; } private static int id0(int x) { return x; } private static int id1(int x) { return id0(x); } public String[] sortForward() { return sort((String l, String r) -> id1(l.compareTo(r))); } private static int id2(int x) { return x; } public String[] sort(int v) { return sort((String l, String r) -> id2(l.compareTo(r) * v)); } private int id3(int x) { return x; } public String[] sort(String v) { return sort((String l, String r) -> id3(l.compareTo(v) + v.compareTo(r))); } private static int id4(int x) { return x; } public String[] sortBackward() { return sort((String l, String r) -> id4(r.compareTo(l))); } public static void main(String[] args) { SortingExample x = new SortingExample(10); System.err.println(Arrays.toString(x.sortForward())); System.err.println(Arrays.toString(x.sort(1))); System.err.println(Arrays.toString(x.sortBackward())); System.err.println(Arrays.toString(x.sort(-1))); System.err.println(Arrays.toString(x.sort("something"))); } }
1,480
21.104478
78
java
WALA
WALA-master/core/src/testSubjects/java/libmodels/LibModels.java
package libmodels; public class LibModels { public static void reachable1() {} public static void reachable2() {} static class Handler implements Thread.UncaughtExceptionHandler { @Override public void uncaughtException(Thread t, Throwable e) { reachable2(); } } public static void main(String[] argv) { Runtime.getRuntime() .addShutdownHook( new Thread() { @Override public void run() { reachable1(); } }); Thread.setDefaultUncaughtExceptionHandler(new Handler()); } }
604
19.862069
67
java
WALA
WALA-master/core/src/testSubjects/java/messageFormatTest/MessageFormatBench.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package messageFormatTest; import java.text.MessageFormat; public class MessageFormatBench { public static void main(String[] args) { Object[] testArgs = {3L, "MyDisk"}; MessageFormat form = new MessageFormat("The disk \"{1}\" contains {0} file(s)."); MessageFormat form2 = (MessageFormat) form.clone(); System.out.println(form2.format(testArgs)); } }
742
31.304348
85
java
WALA
WALA-master/core/src/testSubjects/java/methodLookup/MethodLookupStuff.java
package methodLookup; public class MethodLookupStuff { static class A { A(int foo) {} A() {} } static class B extends A {} }
143
10.076923
32
java
WALA
WALA-master/core/src/testSubjects/java/multiDim/TestMultiDim.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package multiDim; public class TestMultiDim { static void doNothing(Object o) {} public static void main(String[] args) { Object[][] multi = new Object[10][]; multi[0] = new Object[10]; testMulti(multi); } static void testMulti(Object[][] multi) { Object[] t = multi[0]; doNothing(t); } static void testNewMultiArray() { String[][][] x = new String[3][4][]; doNothing(x); } }
791
23
72
java
WALA
WALA-master/core/src/testSubjects/java/multiTypes/Foo.java
/* * Copyright (c) 2008 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package multiTypes; /** * Test designed to exercise SubtypesEntrypoint when there is more than one possible type for an * argument * * @author sjfink */ public class Foo { private static class A { public void bar() {} } private static class B extends A { @Override public void bar() {} } public static void foo(A a) { a.bar(); } }
736
20.676471
96
java
WALA
WALA-master/core/src/testSubjects/java/nestmates/Outer.java
package nestmates; public class Outer { private final int foo = 10; public class Inner { int triple() { return 3 * foo; } } }
148
11.416667
29
java
WALA
WALA-master/core/src/testSubjects/java/nestmates/TestNestmates.java
package nestmates; public class TestNestmates { public void main(String[] args) { Outer orig = new Outer(); Outer.Inner tester = orig.new Inner(); tester.triple(); } }
186
16
42
java
WALA
WALA-master/core/src/testSubjects/java/objSensitive/A.java
/* * Copyright (c) 2002 - 2020 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package objSensitive; public class A { private B b; public void set(B b) { doSet(b); } public void doSet(B b) { this.b = b; } public B getB() { return this.b; } public Object foo(Object v) { B b = new B(); return b.bar(v); } }
646
18.029412
72
java
WALA
WALA-master/core/src/testSubjects/java/objSensitive/B.java
/* * Copyright (c) 2002 - 2020 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package objSensitive; public class B { Object bar(Object v) { C c = new C(); return c.identity(v); } }
491
24.894737
72
java
WALA
WALA-master/core/src/testSubjects/java/objSensitive/C.java
/* * Copyright (c) 2002 - 2020 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package objSensitive; public class C { Object identity(Object v) { return v; } }
465
24.888889
72
java
WALA
WALA-master/core/src/testSubjects/java/objSensitive/TestObjSensitive1.java
/* * Copyright (c) 2002 - 2020 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package objSensitive; /** test case for nObjBuilder */ public class TestObjSensitive1 { public static void main(String[] args) { A a1 = new A(); A a2 = new A(); B b1 = new B(); // B/1 B b2 = new B(); // B/2 a1.set(b1); a2.set(b2); B b = a1.getB(); // pts(b) -> {B/1} , n = 1 doNothing(b); } static void doNothing(Object o) {} }
747
22.375
72
java
WALA
WALA-master/core/src/testSubjects/java/objSensitive/TestObjSensitive2.java
/* * Copyright (c) 2002 - 2020 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package objSensitive; /** test case for nObjBuilder */ public class TestObjSensitive2 { public static void main(String[] args) { A a1 = new A(); Object o1 = new Object(); // Object/1 Object result1 = a1.foo(o1); A a2 = new A(); Object o2 = new Object(); // Object/2 Object result2 = a2.foo(o2); // pts(result2) -> {Object/2} , n = 3 doNothing(result2); } static void doNothing(Object o) {} }
810
26.965517
72
java
WALA
WALA-master/core/src/testSubjects/java/pi/PiNodeCallGraphTestCase.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package pi; class PiNodeCallGraphTestCase { interface Whatever { void unary1(); void unary2(); void binary(Whatever arg); } static class This implements Whatever { @Override public void unary1() { unary2(); } @Override public void unary2() {} @Override public void binary(Whatever arg) { this.unary1(); arg.unary2(); } } static class That implements Whatever { @Override public void unary1() {} @Override public void unary2() { unary1(); } @Override public void binary(Whatever arg) { this.unary1(); arg.unary2(); } } public static native boolean choice(); public static void main(String[] args) { Whatever x = new This(); Whatever y = new That(); Whatever z = choice() ? x : y; if (z instanceof This) x.binary(z); else y.binary(z); localCast(); } private static void localCast() { Whatever y = new That(); if (y instanceof This) { y.binary(y); } } }
1,412
17.350649
72
java
WALA
WALA-master/core/src/testSubjects/java/privateInterfaceMethods/PrivateInterface.java
package privateInterfaceMethods; public interface PrivateInterface { default void RetT(Object input) { GetT(input); } private Object GetT(Object input) { return input; } }
190
14.916667
37
java
WALA
WALA-master/core/src/testSubjects/java/privateInterfaceMethods/testArrayReturn/ReturnArray.java
package privateInterfaceMethods.testArrayReturn; import privateInterfaceMethods.PrivateInterface; public class ReturnArray implements PrivateInterface {}
156
25.166667
55
java
WALA
WALA-master/core/src/testSubjects/java/privateInterfaceMethods/testArrayReturn/TestArrayReturn.java
package privateInterfaceMethods.testArrayReturn; public class TestArrayReturn { public void main(String[] args) { ReturnArray testee = new ReturnArray(); int[] arrayArg = {1, 2, 3, 4}; testee.RetT(arrayArg); } }
229
22
48
java
WALA
WALA-master/core/src/testSubjects/java/recurse/NList.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package recurse; import java.util.Collection; import java.util.Iterator; /** * @author sfink * <p>A simple exercise in recursive data structures. */ public class NList implements Collection<Object> { final int value; final NList next; public NList(int value) { this.value = value; if (value > 0) { this.next = new NList(value - 1); } else { this.next = null; } } public static void main(String[] args) { new NList(100); } /* (non-Javadoc) * @see java.util.Collection#size() */ @Override public int size() { // TODO Auto-generated method stub return 0; } /* (non-Javadoc) * @see java.util.Collection#isEmpty() */ @Override public boolean isEmpty() { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#contains(java.lang.Object) */ @Override public boolean contains(Object o) { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#iterator() */ @Override public Iterator<Object> iterator() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.util.Collection#toArray() */ @Override public Object[] toArray() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see java.util.Collection#add(java.lang.Object) */ @Override public boolean add(Object o) { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#remove(java.lang.Object) */ @Override public boolean remove(Object o) { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#containsAll(java.util.Collection) */ @Override public boolean containsAll(Collection<?> c) { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#addAll(java.util.Collection) */ @Override public boolean addAll(Collection<?> c) { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#removeAll(java.util.Collection) */ @Override public boolean removeAll(Collection<?> c) { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#retainAll(java.util.Collection) */ @Override public boolean retainAll(Collection<?> c) { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see java.util.Collection#clear() */ @Override public void clear() { // TODO Auto-generated method stub } @Override public Object[] toArray(Object[] a) { // TODO Auto-generated method stub return null; } }
3,179
19.921053
72
java
WALA
WALA-master/core/src/testSubjects/java/reflection/ForNameThrownExceptions.java
package reflection; public class ForNameThrownExceptions { static class MyClass { public String sayHello() { return "Hello from MyClass!"; } } public static void main(String[] args) { try { // This call to Class.forName() can be resolved by WALA's reflection handling. When // it is resolved, the resulting synthetic model of Class.forName() cannot throw // a ClassNotFoundException. Hence, no Exception values flow to e, and the call // to e.getMessage() in the catch block has no callees Class clazz = Class.forName("reflection.ForNameThrownExceptions$MyClass"); } catch (Exception e) { System.out.println(e.getMessage()); } } }
706
29.73913
90
java
WALA
WALA-master/core/src/testSubjects/java/reflection/GetMethodContext.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** * A test targeting the {@code com.ibm.wala.analysis.reflection.GetMethodContext}. * * @author Michael Heilmann */ public class GetMethodContext { public static class A { public void foo() {} public void bar() {} public void baz() {} } public static class B extends A { @Override public void foo() {} @Override public void bar() {} @Override public void baz() {} } public static class C extends B { @Override public void foo() {} @Override public void bar() {} } public static void main(String[] args) throws IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException { Method m; A a; a = new B(); // As a points to an instance of GetMethodContext$B: // Without GetMethodContext, Wala should return GetMethodContext$A#foo() and // GetMethodContext$B#foo(). // With GetMethodContext, Wala should return only GetMethodContext$B#foo(). m = a.getClass().getMethod("foo"); m.invoke(a, new Object[] {}); a = new C(); // As a points to an instance of GetMethodContext$C: // Without GetMethodContext, Wala should return GetMethodContext$C#bar(), // GetMethodContext$B#bar() and GetMethodContext$A#bar(). // With GetMethodContext, Wala should return only GetMethodContext$C#bar(). m = a.getClass().getDeclaredMethod("bar"); m.invoke(a, new Object[] {}); // To summarize: // // Without GetMethodContext, the call graph must contain // GetMethodContext$B#foo(), // GetMethodContext$A#foo(), // GetMethodContext$C#bar(), // GetMethodContext$B#bar(), and // GetMethodContext$A#bar(). // // With GetMethodContext, the call graph must contain // GetMethodContext$B#foo() and // GetMethodContext$C#bar() // and must not contain // GetMethodContext$A#foo(), // GetMethodContext$B#bar(), or // GetMethodContext$A#bar(). // // In either case it must not contain: // GetMethodContext$C#baz(), // GetMethodContext$C#baz(), // GetMethodContext$B#baz(), or // GetMethodContext$A#baz(). } }
2,651
26.625
85
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Helper.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; public class Helper { private final Object a, b; public Helper() { this.a = new Object(); this.b = new Object(); System.out.println("Helper constructor with no parameter invoked"); } public Helper(Integer x) { a = b = null; x.toString(); System.out.println(x); } public Helper(Object a) { this.a = a; this.b = new Object(); System.out.println("Helper constructor with one parameter invoked"); } public Helper(Object a, Object b) { this.a = a; this.b = b; System.out.println("Helper constructor with two parameters invoked"); } public void m(Object a, Object b, Object c) { System.out.println("m method invoked"); } public void n(Object a, Object b) { System.out.println("n method invoked"); } public void o(Object a, Object b) { System.out.println("o method invoked"); } public static void s(Object a, Object b) { System.out.println("s method invoked"); } public static void t(Integer x) { x.toString(); } public void u(Integer x) { x.toString(); System.out.println("u method invoked"); } }
1,508
22.215385
73
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect1.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; public class Reflect1 { public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { Class<?> c = Class.forName("java.lang.Integer"); Integer i = (Integer) c.newInstance(); System.err.println(i); } }
670
29.5
85
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect10.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect10 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("java.lang.Integer"); Method[] m = c.getMethods(); m[0].invoke(2, new Object[] {}); } }
900
32.37037
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect11.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect11 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("java.lang.Integer"); Method[] m = c.getMethods(); m[0].invoke(2, (Object[]) args); } }
900
32.37037
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect12.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect12 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("reflection.Helper"); Method[] m = c.getMethods(); m[0].invoke(new Helper(), new Object[3]); } }
909
32.703704
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect13.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect13 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("reflection.Helper"); Method[] m = c.getMethods(); int length = Integer.parseInt(args[0]); m[0].invoke(new Helper(), new Object[length]); } }
958
33.25
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect14.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; /** Test of Method.invoke */ public class Reflect14 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("reflection.Helper"); Method[] ms = c.getMethods(); for (Method m : ms) { int mods = m.getModifiers(); if (Modifier.isStatic(mods) && m.getParameterTypes().length == 2) { m.invoke(null, new Object[2]); } } } }
1,087
31.969697
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect15.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** Test of Class.getConstructors(). */ public class Reflect15 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Class<?> c = Class.forName("reflection.Helper"); Constructor<?>[] ctors = c.getConstructors(); Helper h = null; for (Constructor<?> ctor : ctors) { if (ctor.getParameterTypes().length == 2) { h = (Helper) ctor.newInstance(new Object[] {new Object(), new Object()}); } } h.n(new Object(), new Object()); } }
1,088
33.03125
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect16.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect16 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("reflection.Helper"); Method m = c.getDeclaredMethod("t", new Class[] {Integer.class, Integer.class}); Integer i = 0; m.invoke(null, new Object[] {i}); } }
972
33.75
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect17.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect17 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("reflection.Helper"); Method m = c.getDeclaredMethod("t", new Class[] {Integer.class, Integer.class}); m.invoke(null, new Object[] {null}); } }
956
34.444444
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect18.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect18 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("reflection.Helper"); Method m = c.getDeclaredMethod("t", new Class[] {Integer.class, Integer.class}); Integer i = 0; Helper h = new Helper(); m.invoke(h, new Object[] {i}); } }
998
33.448276
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect19.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** Test of Constructor.newInstance */ public class Reflect19 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("reflection.Helper"); Constructor<?> m = c.getConstructor(new Class<?>[] {Integer.class}); Integer i = 0; m.newInstance(new Object[] {i}); } }
974
33.821429
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect2.java
/* * Copyright (c) 2008 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; public class Reflect2 { public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { Class.forName("java.lang.Integer"); } }
587
28.4
85
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect20.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Constructor.newInstance */ public class Reflect20 { public static void main(String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException { Class<?> helperClass = Class.forName("reflection.Helper"); Class<?> objectClass = Class.forName("java.lang.Object"); Class<?>[] paramArrayTypes = new Class[] {objectClass, objectClass}; Method m = helperClass.getMethod("o", paramArrayTypes); Object helperObject = helperClass.newInstance(); Object[] paramArrayObjects = new Object[] {new Object(), new Object()}; m.invoke(helperObject, paramArrayObjects); } }
1,221
38.419355
83
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect21.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** Test of Constructor.newInstance */ public class Reflect21 { public static void main(String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException { Class<?> helperClass = Class.forName("reflection.Helper"); Class<?> objectClass = Class.forName("java.lang.Object"); Class<?>[] paramArrayTypes = new Class[] {objectClass, objectClass}; Constructor<?> constr = helperClass.getDeclaredConstructor(paramArrayTypes); Object[] paramArrayObjects = new Object[] {new Object(), new Object()}; constr.newInstance(paramArrayObjects); } }
1,190
38.7
83
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect22.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** Test of Constructor.newInstance */ public class Reflect22 { public static void main(String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException { Class<?> helperClass = Class.forName("reflection.Helper"); Constructor<?>[] constrs = helperClass.getDeclaredConstructors(); for (Constructor<?> constr : constrs) { if (constr.getParameterTypes().length == 1) { Class<?> paramType = constr.getParameterTypes()[0]; if (paramType.getName().equals("java.lang.Integer")) { Integer i = 1; Object[] initArgs = new Object[] {i}; constr.newInstance(initArgs); break; } } } } }
1,298
34.108108
83
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect23.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; /** Test of Constructor.newInstance */ public class Reflect23 { public static void main(String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException { Class<?> helperClass = Class.forName("reflection.Helper"); Object helperObject = helperClass.newInstance(); Method[] methods = helperClass.getDeclaredMethods(); for (Method m : methods) { if (m.getParameterTypes().length == 1) { Class<?> paramType = m.getParameterTypes()[0]; if (!Modifier.isStatic(m.getModifiers()) && paramType.getName().equals("java.lang.Integer")) { Integer i = 1; Object[] initArgs = new Object[] {i}; m.invoke(helperObject, initArgs); break; } } } } }
1,401
34.05
83
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect24.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; /** * Test of Object.getClass(); * * @author genli */ public class Reflect24 { public static void main(String[] args) { Helper helper = new Helper(); doNothing(helper.getClass()); } static void doNothing(Class<?> clazz) {} }
634
22.518519
72
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect3.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.util.Hashtable; public class Reflect3 { public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException { Class<?> c = Class.forName("java.util.Properties"); Hashtable<Object, Object> h = (Hashtable<Object, Object>) c.newInstance(); System.out.println(h); } private static class Hash extends Hashtable<Object, Object> {} }
804
29.961538
85
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect4.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.io.FilePermission; public class Reflect4 { public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException { Class<?> c = Class.forName("java.io.FilePermission"); FilePermission h = (FilePermission) c.newInstance(); System.out.println(h); } }
721
29.083333
85
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect5.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; public class Reflect5 { public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException { Class<?> c = Class.forName("reflection.Reflect5$A"); A h = (A) c.newInstance(); System.out.println(h); } public static class A { private A() {} @Override public String toString() { return "Instance of A"; } } }
794
24.645161
85
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect6.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; public class Reflect6 { public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException { Class<?> c = Class.forName("reflection.Reflect6$A"); A h = (A) c.newInstance(); System.out.println(h); } public static class A { private A(int i) {} @Override public String toString() { return "Instance of A"; } } }
799
24.806452
85
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect7.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.io.FilePermission; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** @author pistoia */ public class Reflect7 { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Class<FilePermission> c = (Class<FilePermission>) Class.forName("java.io.FilePermission"); Class<?>[] paramTypes = new Class[] {"".getClass(), "".getClass()}; Constructor<FilePermission> constr = c.getConstructor(paramTypes); Object[] params = new String[] {"log.txt", "read"}; FilePermission fp = constr.newInstance(params); fp.toString(); } }
1,142
37.1
94
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect8.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** Test of Class.getConstructors(). */ public class Reflect8 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Class<?> c = Class.forName("java.lang.Integer"); Constructor<?>[] ctors = c.getConstructors(); Integer i = (Integer) ctors[0].newInstance(1); i.toString(); } }
912
32.814815
86
java
WALA
WALA-master/core/src/testSubjects/java/reflection/Reflect9.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package reflection; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** Test of Method.invoke */ public class Reflect9 { public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { Class<?> c = Class.forName("java.lang.Integer"); Method m = c.getDeclaredMethod("toString", new Class[] {}); m.invoke(2, new Object[] {}); } }
927
33.37037
86
java
WALA
WALA-master/core/src/testSubjects/java/shrike/FloatingPoints.java
package shrike; public class FloatingPoints { public static void main(String[] args) { doubble(); floatt(); } public static void doubble() { double pi = Math.PI; double added = pi + 1.337; System.out.println(added); } public static void floatt() { float f = 42.1337f; double added = f + 1.337; System.out.println(added); } }
373
16
42
java
WALA
WALA-master/core/src/testSubjects/java/shrike/StackMaps.java
package shrike; public class StackMaps { private int field1; private int field2; private int min; public StackMaps(int field1, int field2) { setMin(field1 > field2 ? field2 : field1); this.field1 = field1; this.field2 = field2; } private void setMin(int x) { this.min = x; } public static void main(String[] args) { String result = "success"; try { if ("max".equals(args[0])) { System.err.println(new StackMaps(3, 2).max()); } else { System.err.println(new StackMaps("min" == args[0] ? 7 : 5, 2).min()); } } catch (RuntimeException e) { result = "bad"; throw e; } finally { System.err.println(result); } } public int max() { return field1 > field2 ? field1 : field2; } public int min() { return min; } }
832
18.833333
77
java
WALA
WALA-master/core/src/testSubjects/java/slice/A.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; class A { Object f; Object g; Object foo() { return new Integer(3); } public Object getF() { return f; } public void setF(Object f) { this.f = f; } }
566
17.9
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/B.java
/* * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; class B extends A { @Override Object foo() { return new Float(4); } }
464
23.473684
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/JustThrow.java
package slice; import java.io.IOException; public class JustThrow { private static int throwException() { throw new RuntimeException(); } public static void main(String[] argv) throws IOException { doNothing(throwException()); } private static void doNothing(int x) {} }
294
16.352941
61
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice1.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; public class Slice1 { public static void main(String[] args) { int x = foo(1); int y = bar(2); System.out.println(x + y); } static int foo(int x) { return x + 2; } static int bar(int x) { return x + 3; } }
624
21.321429
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice2.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; public class Slice2 { public static void main(String[] args) { int x = foo(1); int y = bar(2); baz(x + y); } public static void baz(int z) { System.out.println(z); } static int foo(int x) { return x + 2; } static int bar(int x) { return x + 3; } }
676
19.515152
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice3.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; public class Slice3 { static void doNothing(Object o) {} public static void main(String[] args) { Object o1 = new Object(); Object o2 = new Object(); Object o3 = foo(o1, o2); doNothing(o3); } static Object foo(Object x, Object y) { return x; } }
662
23.555556
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice4.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; public class Slice4 { public static void main(String[] args) { int x = foo(1); bar(x); } static int foo(int x) { return x + 2; } static void bar(int x) { return; } }
580
20.518519
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice5.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; public class Slice5 { public static void main(String[] args) { int x = baz(); bar(x); } static int baz() { return foo(1); } static int foo(int x) { return x + 2; } static void bar(int x) { return; } }
625
18.5625
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice6.java
/* * Copyright (c) 2007 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; import java.util.Vector; public class Slice6 { public static Vector<Integer> messages; public static void main(String[] args) { messages = new Vector<>(); messages.add(5); int message = messages.elementAt(0); sendMessage(message); } public static void sendMessage(int message) { // do nothing } }
717
21.4375
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice7.java
/* * Copyright (c) 2007 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; import java.util.Hashtable; public class Slice7 { public static void main(String args[]) { Hashtable<Object, Object> abc = new Hashtable<>(3, 0.75f); } }
547
26.4
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice8.java
/* * Copyright (c) 2008 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; /** Test for bug described on mailing list by Ravi Chandhran. */ public class Slice8 { public static void main(String[] args) { process(); } private static void process() { int x = getVal(); doNothing(x); } private static int getVal() { return 3; } private static void doNothing(int x) {} }
709
21.903226
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/Slice9.java
/* * Copyright (c) 2008 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; import java.util.Random; public class Slice9 { public static void main(String[] args) { Random r = null; r = new Random(); int i = 42; i = r.nextInt(); int j; j = 42 * i; doNothing(j); } static void doNothing(int x) {} }
642
21.172414
72
java
WALA
WALA-master/core/src/testSubjects/java/slice/TestArrays.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; public class TestArrays { static void doNothing(Object o) {} /** slice should include statements involving arr2 and i, exclude statements with arr1 and j */ public static void main(String[] args) { Object[] arr1 = new Object[10], arr2 = new Object[10]; int i = 3; int j = 4; arr2[i] = new Object(); arr1[j] = new Object(); Object x = arr2[i]; doNothing(x); } }
782
28
97
java
WALA
WALA-master/core/src/testSubjects/java/slice/TestCD1.java
/* * Copyright (c) 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package slice; public class TestCD1 { static void doNothing(Object o) {} public static void main(String[] args) { Integer I = (Integer) new A().foo(); int i = I; if (i > 0) { System.out.println("X"); if (i > 1) { System.out.println("Y"); doNothing(I); } } } }
687
22.724138
72
java