Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 1 | // Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | package bridge; |
| 5 | |
| 6 | abstract class Super<T> { |
| 7 | public abstract int method(T t0, T t1); |
| 8 | public abstract int rangeMethod(T t0, T t1, T t2, T t3, T t4, T t5); |
| 9 | } |
| 10 | |
| 11 | public class BridgeMethod extends Super<Integer> { |
| 12 | |
| 13 | @Override |
| 14 | public int method(Integer t0, Integer t1) { |
| 15 | if (t0 > t1) { |
| 16 | return t0; |
| 17 | } |
| 18 | return t1; |
| 19 | } |
| 20 | |
| 21 | @Override |
| 22 | public int rangeMethod(Integer t0, Integer t1, Integer t2, Integer t3, Integer t4, Integer t5) { |
| 23 | if (t0 > t1) { |
| 24 | return t0; |
| 25 | } |
| 26 | return t1 + t2 + t3 + t4 + t5; |
| 27 | } |
| 28 | |
| 29 | public static void main(String[] args) { |
| 30 | Super<Integer> instance = new BridgeMethod(); |
| 31 | instance.method(1, 2); |
| 32 | instance.method(2, 1); |
| 33 | instance.rangeMethod(1, 2, 3, 4, 5, 6); |
| 34 | instance.rangeMethod(2, 1, 3, 4, 5, 6); |
| 35 | } |
| 36 | } |