Path: blob/master/test/langtools/tools/jdeprscan/usage/jdk/deprusage/UseClass.java
41161 views
/*1* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package jdk.jdeprusage;2425import jdk.deprcases.types.DeprecatedClass;2627public class UseClass {28static class Extends extends DeprecatedClass {29}3031static class ClassLiteral {32Class<?> clazz = DeprecatedClass.class;33}3435static class FieldType {36DeprecatedClass obj = null;37}3839static class MethodParameter {40void foo(DeprecatedClass x) { }41}4243static class MethodReturn {44DeprecatedClass foo() { return null; }45}4647static class ArrayCreation {48Object foo() {49return new DeprecatedClass[1];50}51}5253static class ArrayFieldUsage {54int foo(Object o) {55return ((DeprecatedClass[])o).length;56}57}5859static class ArrayMethodCall {60Object foo(Object o) {61return ((DeprecatedClass[])o).clone();62}63}6465static class InstanceOf {66boolean foo(Object o) {67return o instanceof DeprecatedClass;68}69}7071static class Cast {72Object foo(Object o) {73return (DeprecatedClass)o;74}75}7677static class Generic<T> {78static <U> void g() { }79}8081static class ClassTypeArg extends Generic<DeprecatedClass> { }8283static class MethodTypeArg {84void foo() {85Generic.<DeprecatedClass>g();86}87}8889static class ConstructorTypeArg {90Object foo() {91return new Generic<DeprecatedClass>();92}93}9495static class Construct {96Object foo() {97return new DeprecatedClass();98}99}100101static class Local {102void foo() {103DeprecatedClass obj = null;104}105}106}107108109