|
Lines 34-40
Link Here
|
| 34 |
// Static initializer to specify tests subset using TESTS_* static variables |
34 |
// Static initializer to specify tests subset using TESTS_* static variables |
| 35 |
// All specified tests which does not belong to the class are skipped... |
35 |
// All specified tests which does not belong to the class are skipped... |
| 36 |
static { |
36 |
static { |
| 37 |
// TESTS_NAMES = new String[] { "test4125_resultInMethodSpec3"}; |
37 |
// TESTS_NAMES = new String[] { "test4127_precedenceDeclaration19"}; |
| 38 |
// TESTS_NUMBERS = new int[] { 1459 }; |
38 |
// TESTS_NUMBERS = new int[] { 1459 }; |
| 39 |
// TESTS_RANGE = new int[] { 1097, -1 }; |
39 |
// TESTS_RANGE = new int[] { 1097, -1 }; |
| 40 |
} |
40 |
} |
|
Lines 4801-4806
Link Here
|
| 4801 |
"\'precedence\' declaration can only refer to direct role classes, however PrecBug.RA.RB is a nested role of team PrecBug.RA (OTJLD 4.8).\n" + |
4801 |
"\'precedence\' declaration can only refer to direct role classes, however PrecBug.RA.RB is a nested role of team PrecBug.RA (OTJLD 4.8).\n" + |
| 4802 |
"----------\n"); |
4802 |
"----------\n"); |
| 4803 |
} |
4803 |
} |
|
|
4804 |
|
| 4805 |
// Bug 335777 - [compiler] don't flag missing precedence if different enclosing teams |
| 4806 |
public void test4127_precedenceDeclaration19 () { |
| 4807 |
runConformTest( |
| 4808 |
new String[] { |
| 4809 |
"PrecBug19.java", |
| 4810 |
"public team class PrecBug19 {\n" + |
| 4811 |
" protected team class RA playedBy A {\n" + |
| 4812 |
" void some(String v) <- before void myMethod2()\n" + |
| 4813 |
" with { v <- \"RA\" }\n" + |
| 4814 |
" void some(String v) <- after void myMethod2()\n" + |
| 4815 |
" with { v <- \"RA\" }\n" + |
| 4816 |
" void some(String v) {\n" + |
| 4817 |
" System.out.print(\"some\"+v);\n" + |
| 4818 |
" }\n" + |
| 4819 |
" protected class RB playedBy B {\n" + |
| 4820 |
" void some(String v) <- before void myMethod2()" + |
| 4821 |
" with { v <- \"RB\" }\n" + |
| 4822 |
" void some(String v) <- after void myMethod2()" + |
| 4823 |
" with { v <- \"RB\" }\n" + |
| 4824 |
" }\n" + |
| 4825 |
" }\n" + |
| 4826 |
" public PrecBug19(A as RA a) {\n" + |
| 4827 |
" a.activate();\n" + |
| 4828 |
" }\n" + |
| 4829 |
" public static void main(String... args) {\n" + |
| 4830 |
" B b = new B();\n" + |
| 4831 |
" new PrecBug19(b).activate();\n" + |
| 4832 |
" new B().myMethod2();\n" + |
| 4833 |
" }\n" + |
| 4834 |
"}\n", |
| 4835 |
"A.java", |
| 4836 |
"public class A {\n" + |
| 4837 |
" void myMethod2() { System.out.print(\"-\"); }\n" + |
| 4838 |
"}\n", |
| 4839 |
"B.java", |
| 4840 |
"public class B extends A {\n" + |
| 4841 |
"}\n" |
| 4842 |
}, |
| 4843 |
"someRAsomeRB-someRBsomeRA"); |
| 4844 |
} |
| 4845 |
|
| 4804 |
// a regular class has a precedence declaration |
4846 |
// a regular class has a precedence declaration |
| 4805 |
// 4.1.28-otjld-invalid-precedence-declaration-1 |
4847 |
// 4.1.28-otjld-invalid-precedence-declaration-1 |
| 4806 |
public void test4128_invalidPrecedenceDeclaration1() { |
4848 |
public void test4128_invalidPrecedenceDeclaration1() { |