1 /* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 public class Base { declaredInBase()18 public void declaredInBase() { 19 System.out.println("declaredInBase: Base"); 20 } 21 overridden()22 public void overridden() { 23 System.out.println("overridden: Base"); 24 } 25 26 /* src2: removed */ wasOverridden()27 public void wasOverridden() { 28 System.out.println("wasOverridden: Base"); 29 } 30 callOverrideWithPublic()31 public void callOverrideWithPublic() { 32 overrideWithPublic(); 33 } overrideWithPublic()34 public void overrideWithPublic() { 35 System.out.println("overrideWithPublic: Base"); 36 } 37 callOverridePublicWithProtected()38 public void callOverridePublicWithProtected() { 39 overridePublicWithProtected(); 40 } 41 /* src2: public */ overridePublicWithProtected()42 protected void overridePublicWithProtected() { 43 System.out.println("overridePublicWithProtected: Base"); 44 } 45 callOverrideProtectedWithPublic()46 public void callOverrideProtectedWithPublic() { 47 overrideProtectedWithPublic(); 48 } overrideProtectedWithPublic()49 protected void overrideProtectedWithPublic() { 50 System.out.println("overrideProtectedWithPublic: Base"); 51 } 52 callOverridePublicWithPrivate()53 public void callOverridePublicWithPrivate() { 54 overridePublicWithPrivate(); 55 } 56 /* src2: public */ overridePublicWithPrivate()57 private void overridePublicWithPrivate() { 58 System.out.println("overridePublicWithPrivate: Base"); 59 } 60 callOverridePrivateWithPublic()61 public void callOverridePrivateWithPublic() { 62 overridePrivateWithPublic(); 63 } overridePrivateWithPublic()64 private void overridePrivateWithPublic() { 65 System.out.println("overridePrivateWithPublic: Base"); 66 } 67 callOverrideVirtualWithStatic()68 public void callOverrideVirtualWithStatic() { 69 overrideVirtualWithStatic(); 70 } 71 /* src2: non-static */ overrideVirtualWithStatic()72 public static void overrideVirtualWithStatic() { 73 System.out.println("overrideVirtualWithStatic: Base"); 74 } 75 callOverrideStaticWithVirtual()76 public void callOverrideStaticWithVirtual() { 77 overrideStaticWithVirtual(); 78 } 79 /* src2: static */ overrideStaticWithVirtual()80 public void overrideStaticWithVirtual() { 81 System.out.println("overrideStaticWithVirtual: Base"); 82 } 83 } 84