Path: blob/master/test/langtools/tools/jdeprscan/usage/jdk/deprusage/UseMethod.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.members.ExampleClass;26import jdk.deprcases.members.ExampleInterface;27import jdk.deprcases.members.ExampleSubclass;2829public class UseMethod {30static class Direct {31void m(ExampleClass ec) {32ec.method1();33}34}3536static class Inherited {37void m(ExampleSubclass esc) {38esc.method2();39}40}4142static class InheritedDefault {43void m(ExampleSubclass esc) {44esc.defaultMethod();45}46}4748static class InterfaceDirect {49void m(ExampleInterface ei) {50ei.interfaceMethod1();51}52}5354static class InterfaceDefault {55void m(ExampleInterface ei) {56ei.defaultMethod();57}58}5960static class ClassStatic {61void m() {62ExampleClass.staticmethod1();63}64}6566static class InterfaceStatic {67void m() {68ExampleInterface.staticmethod2();69}70}7172static class SuperFromSubclass extends ExampleClass {73void m() {74super.method1();75}76}7778static class InheritedFromSubclass extends ExampleClass {79void m() {80method1();81}82}8384static class Constructor {85Object m() {86return new ExampleClass(true);87}88}8990static class ConstructorFromSubclass extends ExampleClass {91public ConstructorFromSubclass() {92super(true);93}94}9596abstract static class InheritedInterfaceDefault extends ExampleSubclass {97void m() {98defaultMethod();99}100}101102abstract static class InheritedInterface extends ExampleSubclass {103void m() {104interfaceMethod1();105}106}107108static class OverrideClassMethod extends ExampleClass {109@Override110public void method1() { }111}112113abstract static class OverrideInterfaceMethod implements ExampleInterface {114@Override115public void interfaceMethod1() { }116}117118abstract static class OverrideDefaultMethod implements ExampleInterface {119@Override120public void defaultMethod() { }121}122}123124125