Lines 4226-4236
Link Here
|
4226 |
" } finally {\n" + |
4226 |
" } finally {\n" + |
4227 |
" throw new Error();\n" + |
4227 |
" throw new Error();\n" + |
4228 |
" }\n" + |
4228 |
" }\n" + |
4229 |
" Zork z;\n" + |
|
|
4230 |
" }\n" + |
4229 |
" }\n" + |
4231 |
"\n" + |
4230 |
"\n" + |
4232 |
" class S implements Serializable {\n" + |
4231 |
" class S implements Serializable {\n" + |
4233 |
" String dummy;\n" + |
4232 |
" Zork dummy;\n" + |
4234 |
" }\n" + |
4233 |
" }\n" + |
4235 |
"}", |
4234 |
"}", |
4236 |
"W.java", |
4235 |
"W.java", |
Lines 4243-4250
Link Here
|
4243 |
"}\n" |
4242 |
"}\n" |
4244 |
}, |
4243 |
}, |
4245 |
"----------\n" + |
4244 |
"----------\n" + |
4246 |
"1. ERROR in X.java (at line 20)\n" + |
4245 |
"1. ERROR in X.java (at line 23)\n" + |
4247 |
" Zork z;\n" + |
4246 |
" Zork dummy;\n" + |
4248 |
" ^^^^\n" + |
4247 |
" ^^^^\n" + |
4249 |
"Zork cannot be resolved to a type\n" + |
4248 |
"Zork cannot be resolved to a type\n" + |
4250 |
"----------\n"); |
4249 |
"----------\n"); |
Lines 4272-4278
Link Here
|
4272 |
" } finally {\n" + |
4271 |
" } finally {\n" + |
4273 |
" throw new Error();\n" + |
4272 |
" throw new Error();\n" + |
4274 |
" }\n" + |
4273 |
" }\n" + |
4275 |
" Zork z;\n" + |
|
|
4276 |
" }\n" + |
4274 |
" }\n" + |
4277 |
"\n" + |
4275 |
"\n" + |
4278 |
" @SuppressWarnings(\"unchecked\"//$NON-NLS-1$\n" + |
4276 |
" @SuppressWarnings(\"unchecked\"//$NON-NLS-1$\n" + |
Lines 4282-4288
Link Here
|
4282 |
" @SuppressWarnings(\"serial\"//$NON-NLS-1$\n" + |
4280 |
" @SuppressWarnings(\"serial\"//$NON-NLS-1$\n" + |
4283 |
" )\n" + |
4281 |
" )\n" + |
4284 |
" class S implements Serializable {\n" + |
4282 |
" class S implements Serializable {\n" + |
4285 |
" String dummy;\n" + |
4283 |
" Zork dummy;\n" + |
4286 |
" }\n" + |
4284 |
" }\n" + |
4287 |
"}", |
4285 |
"}", |
4288 |
"W.java", |
4286 |
"W.java", |
Lines 4295-4302
Link Here
|
4295 |
"}\n" |
4293 |
"}\n" |
4296 |
}, |
4294 |
}, |
4297 |
"----------\n" + |
4295 |
"----------\n" + |
4298 |
"1. ERROR in X.java (at line 19)\n" + |
4296 |
"1. ERROR in X.java (at line 28)\n" + |
4299 |
" Zork z;\n" + |
4297 |
" Zork dummy;\n" + |
4300 |
" ^^^^\n" + |
4298 |
" ^^^^\n" + |
4301 |
"Zork cannot be resolved to a type\n" + |
4299 |
"Zork cannot be resolved to a type\n" + |
4302 |
"----------\n"); |
4300 |
"----------\n"); |
Lines 4450-4466
Link Here
|
4450 |
" Zork z;\n" + |
4448 |
" Zork z;\n" + |
4451 |
"}\n" |
4449 |
"}\n" |
4452 |
}, |
4450 |
}, |
4453 |
"----------\n" + |
4451 |
"----------\n" + |
4454 |
"1. WARNING in X.java (at line 1)\n" + |
4452 |
"1. WARNING in X.java (at line 1)\n" + |
4455 |
" @SuppressWarnings(\"zork\")//$NON-NLS-1$\n" + |
4453 |
" @SuppressWarnings(\"zork\")//$NON-NLS-1$\n" + |
4456 |
" ^^^^^^\n" + |
4454 |
" ^^^^^^\n" + |
4457 |
"Unhandled warning token zork\n" + |
4455 |
"Unsupported @SuppressWarnings(\"zork\")\n" + |
4458 |
"----------\n" + |
4456 |
"----------\n" + |
4459 |
"2. ERROR in X.java (at line 3)\n" + |
4457 |
"2. ERROR in X.java (at line 3)\n" + |
4460 |
" Zork z;\n" + |
4458 |
" Zork z;\n" + |
4461 |
" ^^^^\n" + |
4459 |
" ^^^^\n" + |
4462 |
"Zork cannot be resolved to a type\n" + |
4460 |
"Zork cannot be resolved to a type\n" + |
4463 |
"----------\n", |
4461 |
"----------\n", |
4464 |
null, true, customOptions); |
4462 |
null, true, customOptions); |
4465 |
} |
4463 |
} |
4466 |
// check @SuppressWarning support |
4464 |
// check @SuppressWarning support |
Lines 4476-4491
Link Here
|
4476 |
" Zork z;\n" + |
4474 |
" Zork z;\n" + |
4477 |
"}\n" |
4475 |
"}\n" |
4478 |
}, |
4476 |
}, |
4479 |
"----------\n" + |
4477 |
"----------\n" + |
4480 |
"1. WARNING in X.java (at line 1)\n" + |
4478 |
"1. WARNING in X.java (at line 1)\n" + |
4481 |
" @SuppressWarnings({\"zork\", \"warningToken\"})//$NON-NLS-1$//$NON-NLS-2$\n" + |
4479 |
" @SuppressWarnings({\"zork\", \"warningToken\"})//$NON-NLS-1$//$NON-NLS-2$\n" + |
4482 |
" ^^^^^^\n" + |
4480 |
" ^^^^^^\n" + |
4483 |
"Unhandled warning token zork\n" + |
4481 |
"Unsupported @SuppressWarnings(\"zork\")\n" + |
4484 |
"----------\n" + |
4482 |
"----------\n" + |
4485 |
"2. WARNING in X.java (at line 1)\n" + |
4483 |
"2. WARNING in X.java (at line 1)\n" + |
4486 |
" @SuppressWarnings({\"zork\", \"warningToken\"})//$NON-NLS-1$//$NON-NLS-2$\n" + |
4484 |
" @SuppressWarnings({\"zork\", \"warningToken\"})//$NON-NLS-1$//$NON-NLS-2$\n" + |
4487 |
" ^^^^^^^^^^^^^^\n" + |
4485 |
" ^^^^^^^^^^^^^^\n" + |
4488 |
"Unhandled warning token warningToken\n" + |
4486 |
"Unsupported @SuppressWarnings(\"warningToken\")\n" + |
4489 |
"----------\n" + |
4487 |
"----------\n" + |
4490 |
"3. ERROR in X.java (at line 3)\n" + |
4488 |
"3. ERROR in X.java (at line 3)\n" + |
4491 |
" Zork z;\n" + |
4489 |
" Zork z;\n" + |
Lines 4913-4923
Link Here
|
4913 |
"@SuppressWarnings(\"assertIdentifier\")\n" + |
4911 |
"@SuppressWarnings(\"assertIdentifier\")\n" + |
4914 |
"class X {}", |
4912 |
"class X {}", |
4915 |
}, |
4913 |
}, |
4916 |
"----------\n" + |
4914 |
"----------\n" + |
4917 |
"1. WARNING in X.java (at line 1)\n" + |
4915 |
"1. WARNING in X.java (at line 1)\n" + |
4918 |
" @SuppressWarnings(\"assertIdentifier\")\n" + |
4916 |
" @SuppressWarnings(\"assertIdentifier\")\n" + |
4919 |
" ^^^^^^^^^^^^^^^^^^\n" + |
4917 |
" ^^^^^^^^^^^^^^^^^^\n" + |
4920 |
"Unhandled warning token assertIdentifier\n" + |
4918 |
"Unsupported @SuppressWarnings(\"assertIdentifier\")\n" + |
4921 |
"----------\n"); |
4919 |
"----------\n"); |
4922 |
} |
4920 |
} |
4923 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99009 |
4921 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99009 |
Lines 5680-5686
Link Here
|
5680 |
null, true, customOptions); |
5678 |
null, true, customOptions); |
5681 |
} |
5679 |
} |
5682 |
|
5680 |
|
5683 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 |
5681 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - variation |
5684 |
public void test170() { |
5682 |
public void test170() { |
5685 |
Map customOptions = getCompilerOptions(); |
5683 |
Map customOptions = getCompilerOptions(); |
5686 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
5684 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
Lines 5695-5701
Link Here
|
5695 |
"", |
5693 |
"", |
5696 |
null, true, null, customOptions, null); |
5694 |
null, true, null, customOptions, null); |
5697 |
} |
5695 |
} |
5698 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 |
5696 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - variation |
5699 |
public void test171() { |
5697 |
public void test171() { |
5700 |
Map customOptions = getCompilerOptions(); |
5698 |
Map customOptions = getCompilerOptions(); |
5701 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
5699 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
Lines 5709-5728
Link Here
|
5709 |
" String s2 = \"Hello2\"; \n" + |
5707 |
" String s2 = \"Hello2\"; \n" + |
5710 |
"}" |
5708 |
"}" |
5711 |
}, |
5709 |
}, |
5712 |
"----------\n" + |
5710 |
"----------\n" + |
5713 |
"1. WARNING in X.java (at line 1)\n" + |
5711 |
"1. WARNING in X.java (at line 1)\n" + |
5714 |
" public class X extends Exception {\n" + |
5712 |
" public class X extends Exception {\n" + |
5715 |
" ^\n" + |
5713 |
" ^\n" + |
5716 |
"The serializable class X does not declare a static final serialVersionUID field of type long\n" + |
5714 |
"The serializable class X does not declare a static final serialVersionUID field of type long\n" + |
5717 |
"----------\n" + |
5715 |
"----------\n" + |
5718 |
"2. WARNING in X.java (at line 5)\n" + |
5716 |
"2. WARNING in X.java (at line 4)\n" + |
|
|
5717 |
" @SuppressWarnings(\"serial\")\n" + |
5718 |
" ^^^^^^^^\n" + |
5719 |
"Unnecessary @SuppressWarnings(\"serial\")\n" + |
5720 |
"----------\n" + |
5721 |
"3. WARNING in X.java (at line 5)\n" + |
5719 |
" String s2 = \"Hello2\"; \n" + |
5722 |
" String s2 = \"Hello2\"; \n" + |
5720 |
" ^^^^^^^^\n" + |
5723 |
" ^^^^^^^^\n" + |
5721 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5724 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5722 |
"----------\n", |
5725 |
"----------\n", |
5723 |
null, true, customOptions); |
5726 |
null, true, customOptions); |
5724 |
} |
5727 |
} |
5725 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 |
5728 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - variation |
5726 |
public void test172() { |
5729 |
public void test172() { |
5727 |
Map customOptions = getCompilerOptions(); |
5730 |
Map customOptions = getCompilerOptions(); |
5728 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
5731 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
Lines 5738-5751
Link Here
|
5738 |
"}" |
5741 |
"}" |
5739 |
}, |
5742 |
}, |
5740 |
"----------\n" + |
5743 |
"----------\n" + |
5741 |
"1. WARNING in X.java (at line 6)\n" + |
5744 |
"1. WARNING in X.java (at line 5)\n" + |
|
|
5745 |
" @SuppressWarnings(\"serial\")\n" + |
5746 |
" ^^^^^^^^\n" + |
5747 |
"Unnecessary @SuppressWarnings(\"serial\")\n" + |
5748 |
"----------\n" + |
5749 |
"2. WARNING in X.java (at line 6)\n" + |
5742 |
" String s2 = \"Hello2\"; \n" + |
5750 |
" String s2 = \"Hello2\"; \n" + |
5743 |
" ^^^^^^^^\n" + |
5751 |
" ^^^^^^^^\n" + |
5744 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5752 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5745 |
"----------\n", |
5753 |
"----------\n", |
5746 |
null, true, customOptions); |
5754 |
null, true, customOptions); |
5747 |
} |
5755 |
} |
5748 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 |
5756 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - variation |
5749 |
public void test173() { |
5757 |
public void test173() { |
5750 |
Map customOptions = getCompilerOptions(); |
5758 |
Map customOptions = getCompilerOptions(); |
5751 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
5759 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
Lines 5763-5782
Link Here
|
5763 |
" String s2 = \"Hello2\"; \n" + |
5771 |
" String s2 = \"Hello2\"; \n" + |
5764 |
"}" |
5772 |
"}" |
5765 |
}, |
5773 |
}, |
5766 |
"----------\n" + |
5774 |
"----------\n" + |
5767 |
"1. WARNING in X.java (at line 5)\n" + |
5775 |
"1. WARNING in X.java (at line 5)\n" + |
5768 |
" public class X extends Exception {\n" + |
5776 |
" public class X extends Exception {\n" + |
5769 |
" ^\n" + |
5777 |
" ^\n" + |
5770 |
"The serializable class X does not declare a static final serialVersionUID field of type long\n" + |
5778 |
"The serializable class X does not declare a static final serialVersionUID field of type long\n" + |
5771 |
"----------\n" + |
5779 |
"----------\n" + |
5772 |
"2. WARNING in X.java (at line 9)\n" + |
5780 |
"2. WARNING in X.java (at line 8)\n" + |
|
|
5781 |
" @SuppressWarnings(\"serial\")\n" + |
5782 |
" ^^^^^^^^\n" + |
5783 |
"Unnecessary @SuppressWarnings(\"serial\")\n" + |
5784 |
"----------\n" + |
5785 |
"3. WARNING in X.java (at line 9)\n" + |
5773 |
" String s2 = \"Hello2\"; \n" + |
5786 |
" String s2 = \"Hello2\"; \n" + |
5774 |
" ^^^^^^^^\n" + |
5787 |
" ^^^^^^^^\n" + |
5775 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5788 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5776 |
"----------\n", |
5789 |
"----------\n", |
5777 |
null, true, customOptions); |
5790 |
null, true, customOptions); |
5778 |
} |
5791 |
} |
5779 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 |
5792 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - variation |
5780 |
public void test174() { |
5793 |
public void test174() { |
5781 |
Map customOptions = getCompilerOptions(); |
5794 |
Map customOptions = getCompilerOptions(); |
5782 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
5795 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
Lines 5798-5812
Link Here
|
5798 |
"X.java", |
5811 |
"X.java", |
5799 |
source |
5812 |
source |
5800 |
}, |
5813 |
}, |
5801 |
"----------\n" + |
5814 |
"----------\n" + |
5802 |
"1. WARNING in X.java (at line 12)\n" + |
5815 |
"1. WARNING in X.java (at line 11)\n" + |
|
|
5816 |
" @SuppressWarnings(\"serial\")\n" + |
5817 |
" ^^^^^^^^\n" + |
5818 |
"Unnecessary @SuppressWarnings(\"serial\")\n" + |
5819 |
"----------\n" + |
5820 |
"2. WARNING in X.java (at line 12)\n" + |
5803 |
" String s2 = \"Hello2\"; \n" + |
5821 |
" String s2 = \"Hello2\"; \n" + |
5804 |
" ^^^^^^^^\n" + |
5822 |
" ^^^^^^^^\n" + |
5805 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5823 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5806 |
"----------\n", |
5824 |
"----------\n", |
5807 |
null, true, customOptions); |
5825 |
null, true, customOptions); |
5808 |
} |
5826 |
} |
5809 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 |
5827 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - variation |
5810 |
public void test175() { |
5828 |
public void test175() { |
5811 |
Map customOptions = getCompilerOptions(); |
5829 |
Map customOptions = getCompilerOptions(); |
5812 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
5830 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
Lines 5827-5846
Link Here
|
5827 |
"X.java", |
5845 |
"X.java", |
5828 |
source |
5846 |
source |
5829 |
}, |
5847 |
}, |
5830 |
"----------\n" + |
5848 |
"----------\n" + |
5831 |
"1. WARNING in X.java (at line 9)\n" + |
5849 |
"1. WARNING in X.java (at line 9)\n" + |
5832 |
" @Annot2(value=\"nls\") String s = \"value\"; \n" + |
5850 |
" @Annot2(value=\"nls\") String s = \"value\"; \n" + |
5833 |
" ^^^^^^^\n" + |
5851 |
" ^^^^^^^\n" + |
5834 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5852 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5835 |
"----------\n" + |
5853 |
"----------\n" + |
5836 |
"2. WARNING in X.java (at line 11)\n" + |
5854 |
"2. WARNING in X.java (at line 10)\n" + |
|
|
5855 |
" @SuppressWarnings(\"serial\")\n" + |
5856 |
" ^^^^^^^^\n" + |
5857 |
"Unnecessary @SuppressWarnings(\"serial\")\n" + |
5858 |
"----------\n" + |
5859 |
"3. WARNING in X.java (at line 11)\n" + |
5837 |
" String s2 = \"Hello2\"; \n" + |
5860 |
" String s2 = \"Hello2\"; \n" + |
5838 |
" ^^^^^^^^\n" + |
5861 |
" ^^^^^^^^\n" + |
5839 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5862 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5840 |
"----------\n", |
5863 |
"----------\n", |
5841 |
null, true, customOptions); |
5864 |
null, true, customOptions); |
5842 |
} |
5865 |
} |
5843 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 |
5866 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - variation |
5844 |
public void test176() { |
5867 |
public void test176() { |
5845 |
Map customOptions = getCompilerOptions(); |
5868 |
Map customOptions = getCompilerOptions(); |
5846 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
5869 |
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); |
Lines 5862-5872
Link Here
|
5862 |
"X.java", |
5885 |
"X.java", |
5863 |
source |
5886 |
source |
5864 |
}, |
5887 |
}, |
5865 |
"----------\n" + |
5888 |
"----------\n" + |
5866 |
"1. WARNING in X.java (at line 9)\n" + |
5889 |
"1. WARNING in X.java (at line 9)\n" + |
5867 |
" @Annot2(value=\"nls\") String s = \"value\"; \n" + |
5890 |
" @Annot2(value=\"nls\") String s = \"value\"; \n" + |
5868 |
" ^^^^^^^\n" + |
5891 |
" ^^^^^^^\n" + |
5869 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
5892 |
"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + |
|
|
5893 |
"----------\n" + |
5894 |
"2. WARNING in X.java (at line 10)\n" + |
5895 |
" @SuppressWarnings({\"serial\", \"nls\"})\n" + |
5896 |
" ^^^^^^^^\n" + |
5897 |
"Unnecessary @SuppressWarnings(\"serial\")\n" + |
5870 |
"----------\n", |
5898 |
"----------\n", |
5871 |
null, true, customOptions); |
5899 |
null, true, customOptions); |
5872 |
} |
5900 |
} |
Lines 7590-7593
Link Here
|
7590 |
"Syntax error, annotation declaration cannot have type parameters\n" + |
7618 |
"Syntax error, annotation declaration cannot have type parameters\n" + |
7591 |
"----------\n"); |
7619 |
"----------\n"); |
7592 |
} |
7620 |
} |
|
|
7621 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 |
7622 |
public void test228() { |
7623 |
this.runNegativeTest( |
7624 |
new String[] { |
7625 |
"X.java", |
7626 |
"public class X {\n" + |
7627 |
" @SuppressWarnings(\"unchecked\") //unused\n" + |
7628 |
" void doNoEvil(){\n" + |
7629 |
" }\n" + |
7630 |
" Zork z;\n" + |
7631 |
"}\n", |
7632 |
}, |
7633 |
"----------\n" + |
7634 |
"1. WARNING in X.java (at line 2)\n" + |
7635 |
" @SuppressWarnings(\"unchecked\") //unused\n" + |
7636 |
" ^^^^^^^^^^^\n" + |
7637 |
"Unnecessary @SuppressWarnings(\"unchecked\")\n" + |
7638 |
"----------\n" + |
7639 |
"2. ERROR in X.java (at line 5)\n" + |
7640 |
" Zork z;\n" + |
7641 |
" ^^^^\n" + |
7642 |
"Zork cannot be resolved to a type\n" + |
7643 |
"----------\n"); |
7644 |
} |
7645 |
|
7646 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 |
7647 |
public void test229() { |
7648 |
this.runNegativeTest( |
7649 |
new String[] { |
7650 |
"X.java", |
7651 |
"public class X {\n" + |
7652 |
" @SuppressWarnings({\"unchecked\",\"all\"})\n" + |
7653 |
" void doNoEvil(){\n" + |
7654 |
" }\n" + |
7655 |
" Zork z;\n" + |
7656 |
"}\n", |
7657 |
}, |
7658 |
"----------\n" + |
7659 |
"1. ERROR in X.java (at line 5)\n" + |
7660 |
" Zork z;\n" + |
7661 |
" ^^^^\n" + |
7662 |
"Zork cannot be resolved to a type\n" + |
7663 |
"----------\n"); |
7664 |
} |
7665 |
|
7666 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation |
7667 |
public void test230() { |
7668 |
this.runNegativeTest( |
7669 |
new String[] { |
7670 |
"X.java", |
7671 |
"public class X {\n" + |
7672 |
" @SuppressWarnings({\"zork\", \"unused\" })\n" + |
7673 |
" void foo() {}\n" + |
7674 |
"}\n" + |
7675 |
"@SuppressWarnings({\"all\"})\n" + |
7676 |
"class X2 {\n" + |
7677 |
" @SuppressWarnings({\"zork\", \"unused\" })\n" + |
7678 |
" Zork foo() {}\n" + |
7679 |
"}\n", |
7680 |
}, |
7681 |
"----------\n" + |
7682 |
"1. WARNING in X.java (at line 2)\n" + |
7683 |
" @SuppressWarnings({\"zork\", \"unused\" })\n" + |
7684 |
" ^^^^^^\n" + |
7685 |
"Unsupported @SuppressWarnings(\"zork\")\n" + |
7686 |
"----------\n" + |
7687 |
"2. WARNING in X.java (at line 2)\n" + |
7688 |
" @SuppressWarnings({\"zork\", \"unused\" })\n" + |
7689 |
" ^^^^^^^^\n" + |
7690 |
"Unnecessary @SuppressWarnings(\"unused\")\n" + |
7691 |
"----------\n" + |
7692 |
"3. ERROR in X.java (at line 8)\n" + |
7693 |
" Zork foo() {}\n" + |
7694 |
" ^^^^\n" + |
7695 |
"Zork cannot be resolved to a type\n" + |
7696 |
"----------\n"); |
7697 |
} |
7698 |
|
7699 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation |
7700 |
public void test231() { |
7701 |
this.runNegativeTest( |
7702 |
new String[] { |
7703 |
"X.java", |
7704 |
"public class X {\n" + |
7705 |
" @SuppressWarnings({\"zork\", \"unused\",\"all\"})\n" + |
7706 |
" void foo() {}\n" + |
7707 |
"}\n" + |
7708 |
"\n" + |
7709 |
"@SuppressWarnings({\"all\"})\n" + |
7710 |
"class X2 {\n" + |
7711 |
" @SuppressWarnings(\"unused\")\n" + |
7712 |
" void foo() {}\n" + |
7713 |
" Zork z;\n" + |
7714 |
"}\n", |
7715 |
}, |
7716 |
"----------\n" + |
7717 |
"1. ERROR in X.java (at line 10)\n" + |
7718 |
" Zork z;\n" + |
7719 |
" ^^^^\n" + |
7720 |
"Zork cannot be resolved to a type\n" + |
7721 |
"----------\n"); |
7722 |
} |
7723 |
|
7724 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation |
7725 |
public void test232() { |
7726 |
this.runNegativeTest( |
7727 |
new String[] { |
7728 |
"X.java", |
7729 |
"public class X {\n" + |
7730 |
" @SuppressWarnings({\"finally\",\"finally\"})\n" + |
7731 |
" public int test(int p) {\n" + |
7732 |
" try {\n" + |
7733 |
" return 1;\n" + |
7734 |
" } finally {\n" + |
7735 |
" return 2;\n" + |
7736 |
" }\n" + |
7737 |
" }\n" + |
7738 |
"}\n" + |
7739 |
"class Y extends Zork{}", |
7740 |
}, |
7741 |
"----------\n" + |
7742 |
"1. WARNING in X.java (at line 2)\n" + |
7743 |
" @SuppressWarnings({\"finally\",\"finally\"})\n" + |
7744 |
" ^^^^^^^^^\n" + |
7745 |
"Unnecessary @SuppressWarnings(\"finally\")\n" + |
7746 |
"----------\n" + |
7747 |
"2. ERROR in X.java (at line 11)\n" + |
7748 |
" class Y extends Zork{}\n" + |
7749 |
" ^^^^\n" + |
7750 |
"Zork cannot be resolved to a type\n" + |
7751 |
"----------\n"); |
7752 |
} |
7753 |
|
7754 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation |
7755 |
public void test233() { |
7756 |
this.runNegativeTest( |
7757 |
new String[] { |
7758 |
"X.java", |
7759 |
"public class X {\n" + |
7760 |
" @SuppressWarnings({\"finally\",\"finally\"})\n" + |
7761 |
" public int test(int p) {\n" + |
7762 |
" try {\n" + |
7763 |
" return Zork;\n" + |
7764 |
" } finally {\n" + |
7765 |
" return 2;\n" + |
7766 |
" }\n" + |
7767 |
" }\n" + |
7768 |
"}\n", |
7769 |
}, |
7770 |
"----------\n" + |
7771 |
"1. WARNING in X.java (at line 2)\n" + |
7772 |
" @SuppressWarnings({\"finally\",\"finally\"})\n" + |
7773 |
" ^^^^^^^^^\n" + |
7774 |
"Unnecessary @SuppressWarnings(\"finally\")\n" + |
7775 |
"----------\n" + |
7776 |
"2. ERROR in X.java (at line 5)\n" + |
7777 |
" return Zork;\n" + |
7778 |
" ^^^^\n" + |
7779 |
"Zork cannot be resolved\n" + |
7780 |
"----------\n"); |
7781 |
} |
7782 |
|
7783 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation |
7784 |
public void test234() { |
7785 |
this.runNegativeTest( |
7786 |
new String[] { |
7787 |
"X.java", |
7788 |
"public class X {\n" + |
7789 |
" @SuppressWarnings(\"finally\")\n" + // unused but no complaint since an error is nested (can't tell for sure) |
7790 |
" public int test(int p) {\n" + |
7791 |
" return Zork;\n" + |
7792 |
" }\n" + |
7793 |
"}\n", |
7794 |
}, |
7795 |
"----------\n" + |
7796 |
"1. ERROR in X.java (at line 4)\n" + |
7797 |
" return Zork;\n" + |
7798 |
" ^^^^\n" + |
7799 |
"Zork cannot be resolved\n" + |
7800 |
"----------\n"); |
7801 |
} |
7593 |
} |
7802 |
} |