Lines 8794-8799
Link Here
|
8794 |
|
8794 |
|
8795 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 |
8795 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 |
8796 |
public void test170() { |
8796 |
public void test170() { |
|
|
8797 |
Map options = getCompilerOptions(); |
8798 |
options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR); |
8797 |
this.runNegativeTest( |
8799 |
this.runNegativeTest( |
8798 |
new String[] { |
8800 |
new String[] { |
8799 |
"X.java", |
8801 |
"X.java", |
Lines 8801-8816
Link Here
|
8801 |
"class Y extends X { @Override void foo() { } }" |
8803 |
"class Y extends X { @Override void foo() { } }" |
8802 |
}, |
8804 |
}, |
8803 |
"----------\n" + |
8805 |
"----------\n" + |
8804 |
"1. WARNING in X.java (at line 2)\n" + |
8806 |
"1. ERROR in X.java (at line 2)\n" + |
8805 |
" class Y extends X { @Override void foo() { } }\n" + |
8807 |
" class Y extends X { @Override void foo() { } }\n" + |
8806 |
" ^^^^^\n" + |
8808 |
" ^^^^^\n" + |
8807 |
"The method Y.foo() is overriding a synchronized method without being synchronized\n" + |
8809 |
"The method Y.foo() is overriding a synchronized method without being synchronized\n" + |
8808 |
"----------\n" |
8810 |
"----------\n", |
8809 |
); |
8811 |
null, |
|
|
8812 |
false, |
8813 |
options); |
8810 |
} |
8814 |
} |
8811 |
|
8815 |
|
8812 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation |
8816 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation |
8813 |
public void test171() { |
8817 |
public void test171() { |
|
|
8818 |
Map options = getCompilerOptions(); |
8819 |
options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR); |
8814 |
this.runNegativeTest( |
8820 |
this.runNegativeTest( |
8815 |
new String[] { |
8821 |
new String[] { |
8816 |
"X.java", |
8822 |
"X.java", |
Lines 8820-8834
Link Here
|
8820 |
"}" |
8826 |
"}" |
8821 |
}, |
8827 |
}, |
8822 |
"----------\n" + |
8828 |
"----------\n" + |
8823 |
"1. WARNING in X.java (at line 2)\n" + |
8829 |
"1. ERROR in X.java (at line 2)\n" + |
8824 |
" FOO { @Override void foo() { super.foo(); } };\n" + |
8830 |
" FOO { @Override void foo() { super.foo(); } };\n" + |
8825 |
" ^^^^^\n" + |
8831 |
" ^^^^^\n" + |
8826 |
"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" + |
8832 |
"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" + |
8827 |
"----------\n"); |
8833 |
"----------\n", |
|
|
8834 |
null, |
8835 |
false, |
8836 |
options); |
8828 |
} |
8837 |
} |
8829 |
|
8838 |
|
8830 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation |
8839 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation |
8831 |
public void test172() { |
8840 |
public void test172() { |
|
|
8841 |
Map options = getCompilerOptions(); |
8842 |
options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR); |
8832 |
this.runNegativeTest( |
8843 |
this.runNegativeTest( |
8833 |
new String[] { |
8844 |
new String[] { |
8834 |
"X.java", |
8845 |
"X.java", |
Lines 8838-8852
Link Here
|
8838 |
"}" |
8849 |
"}" |
8839 |
}, |
8850 |
}, |
8840 |
"----------\n" + |
8851 |
"----------\n" + |
8841 |
"1. WARNING in X.java (at line 2)\n" + |
8852 |
"1. ERROR in X.java (at line 2)\n" + |
8842 |
" void bar() { new X() { @Override void foo() {} }; }\n"+ |
8853 |
" void bar() { new X() { @Override void foo() {} }; }\n"+ |
8843 |
" ^^^^^\n" + |
8854 |
" ^^^^^\n" + |
8844 |
"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" + |
8855 |
"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" + |
8845 |
"----------\n"); |
8856 |
"----------\n", |
|
|
8857 |
null, |
8858 |
false, |
8859 |
options); |
8846 |
} |
8860 |
} |
8847 |
|
8861 |
|
8848 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation |
8862 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation |
8849 |
public void test173() { |
8863 |
public void test173() { |
|
|
8864 |
Map options = getCompilerOptions(); |
8865 |
options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR); |
8850 |
this.runNegativeTest( |
8866 |
this.runNegativeTest( |
8851 |
new String[] { |
8867 |
new String[] { |
8852 |
"X.java", |
8868 |
"X.java", |
Lines 8855-8865
Link Here
|
8855 |
"class Z extends Y { @Override void foo() {} }\n" |
8871 |
"class Z extends Y { @Override void foo() {} }\n" |
8856 |
}, |
8872 |
}, |
8857 |
"----------\n" + |
8873 |
"----------\n" + |
8858 |
"1. WARNING in X.java (at line 3)\n" + |
8874 |
"1. ERROR in X.java (at line 3)\n" + |
8859 |
" class Z extends Y { @Override void foo() {} }\n" + |
8875 |
" class Z extends Y { @Override void foo() {} }\n" + |
8860 |
" ^^^^^\n" + |
8876 |
" ^^^^^\n" + |
8861 |
"The method Z.foo() is overriding a synchronized method without being synchronized\n" + |
8877 |
"The method Z.foo() is overriding a synchronized method without being synchronized\n" + |
8862 |
"----------\n"); |
8878 |
"----------\n", |
|
|
8879 |
null, |
8880 |
false, |
8881 |
options); |
8863 |
} |
8882 |
} |
8864 |
|
8883 |
|
8865 |
} |
8884 |
} |