diff options
Diffstat (limited to 'test/026-access')
-rw-r--r-- | test/026-access/expected.txt | 4 | ||||
-rw-r--r-- | test/026-access/src/Iface.java | 22 | ||||
-rw-r--r-- | test/026-access/src/Iface2.java | 25 | ||||
-rw-r--r-- | test/026-access/src/Main.java | 5 | ||||
-rw-r--r-- | test/026-access/src/Unrelated.java | 24 |
5 files changed, 80 insertions, 0 deletions
diff --git a/test/026-access/expected.txt b/test/026-access/expected.txt index dabfb37..89fa21a 100644 --- a/test/026-access/expected.txt +++ b/test/026-access/expected.txt @@ -1,2 +1,6 @@ access test Blort. +1 +2 +3 +5 diff --git a/test/026-access/src/Iface.java b/test/026-access/src/Iface.java new file mode 100644 index 0000000..24f4b03 --- /dev/null +++ b/test/026-access/src/Iface.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Another interface. + */ +public interface Iface { + public final static int X = 1; +} diff --git a/test/026-access/src/Iface2.java b/test/026-access/src/Iface2.java new file mode 100644 index 0000000..d2de3f7 --- /dev/null +++ b/test/026-access/src/Iface2.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Another interface. + */ +public interface Iface2 extends Iface { + public final static int Y = Iface.X + 1; + + public final static int A = new Unrelated(3).instance_x; + public final static int B = Unrelated.static_x; +} diff --git a/test/026-access/src/Main.java b/test/026-access/src/Main.java index 6b509a3..fe1a1eb 100644 --- a/test/026-access/src/Main.java +++ b/test/026-access/src/Main.java @@ -22,5 +22,10 @@ public class Main { PublicAccess pa = new PublicAccess(); pa.main(); + + System.out.println(Iface.X); + System.out.println(Iface2.Y); + System.out.println(Iface2.A); + System.out.println(Iface2.B); } } diff --git a/test/026-access/src/Unrelated.java b/test/026-access/src/Unrelated.java new file mode 100644 index 0000000..c3e4248 --- /dev/null +++ b/test/026-access/src/Unrelated.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class Unrelated { + protected int instance_x; + protected static int static_x = 5; + + protected Unrelated(int x) { + instance_x = x; + } +} |