|
Lines 10-15
Link Here
|
| 10 |
* Benjamin Muskalla <bmuskalla@innoopract.com> - [quick fix] Shouldn't offer "Add throws declaration" quickfix for overriding signature if result would conflict with overridden signature |
10 |
* Benjamin Muskalla <bmuskalla@innoopract.com> - [quick fix] Shouldn't offer "Add throws declaration" quickfix for overriding signature if result would conflict with overridden signature |
| 11 |
* Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696 |
11 |
* Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696 |
| 12 |
* Lukas Hanke <hanke@yatta.de> - Bug 430818 [1.8][quick fix] Quick fix for "for loop" is not shown for bare local variable/argument/field - https://bugs.eclipse.org/bugs/show_bug.cgi?id=430818 |
12 |
* Lukas Hanke <hanke@yatta.de> - Bug 430818 [1.8][quick fix] Quick fix for "for loop" is not shown for bare local variable/argument/field - https://bugs.eclipse.org/bugs/show_bug.cgi?id=430818 |
|
|
13 |
* Sandra Lions <sandra.lions-piron@oracle.com> - Bug 90140 - [quick fix] for qualified enum constants in switch-case labels |
| 13 |
*******************************************************************************/ |
14 |
*******************************************************************************/ |
| 14 |
package org.eclipse.jdt.ui.tests.quickfix; |
15 |
package org.eclipse.jdt.ui.tests.quickfix; |
| 15 |
|
16 |
|
|
Lines 9173-9178
public class LocalCorrectionsQuickFixTest extends QuickFixTest {
Link Here
|
| 9173 |
assertExpectedExistInProposals(proposals, expected); |
9174 |
assertExpectedExistInProposals(proposals, expected); |
| 9174 |
} |
9175 |
} |
| 9175 |
|
9176 |
|
|
|
9177 |
public void testReplaceWithUnqualifiedEnumConstant() throws Exception { |
| 9178 |
final IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); |
| 9179 |
StringBuffer buf= new StringBuffer(); |
| 9180 |
buf.append("package pack;\n"); |
| 9181 |
buf.append("public class E {\n"); |
| 9182 |
buf.append(" public enum color {black, white}\n"); |
| 9183 |
buf.append(" public void foo(color c) {\n"); |
| 9184 |
buf.append(" switch (c) {\n"); |
| 9185 |
buf.append(" case color.black:\n"); |
| 9186 |
buf.append(" System.out.println(\"Black\");\n"); |
| 9187 |
buf.append(" break;\n"); |
| 9188 |
buf.append(" case color.white:\n"); |
| 9189 |
buf.append(" System.out.println(\"White\");\n"); |
| 9190 |
buf.append(" break;\n"); |
| 9191 |
buf.append(" default:\n"); |
| 9192 |
buf.append(" break;\n"); |
| 9193 |
buf.append(" }\n"); |
| 9194 |
buf.append(" }\n"); |
| 9195 |
buf.append("}\n"); |
| 9196 |
final ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); |
| 9197 |
|
| 9198 |
final CompilationUnit astRoot= getASTRoot(cu); |
| 9199 |
final ArrayList proposals= collectCorrections(cu, astRoot, 2); |
| 9200 |
|
| 9201 |
assertNumberOfProposals(proposals, 1); |
| 9202 |
assertCorrectLabels(proposals); |
| 9203 |
|
| 9204 |
final CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); |
| 9205 |
final String preview= getPreviewContent(proposal); |
| 9206 |
|
| 9207 |
buf= new StringBuffer(); |
| 9208 |
buf.append("package pack;\n"); |
| 9209 |
buf.append("public class E {\n"); |
| 9210 |
buf.append(" public enum color {black, white}\n"); |
| 9211 |
buf.append(" public void foo(color c) {\n"); |
| 9212 |
buf.append(" switch (c) {\n"); |
| 9213 |
buf.append(" case black:\n"); |
| 9214 |
buf.append(" System.out.println(\"Black\");\n"); |
| 9215 |
buf.append(" break;\n"); |
| 9216 |
buf.append(" case color.white:\n"); |
| 9217 |
buf.append(" System.out.println(\"White\");\n"); |
| 9218 |
buf.append(" break;\n"); |
| 9219 |
buf.append(" default:\n"); |
| 9220 |
buf.append(" break;\n"); |
| 9221 |
buf.append(" }\n"); |
| 9222 |
buf.append(" }\n"); |
| 9223 |
buf.append("}\n"); |
| 9224 |
assertEqualString(preview, buf.toString()); |
| 9225 |
} |
| 9226 |
|
| 9176 |
public void testCollectionsFieldMethodReplacement() throws Exception { |
9227 |
public void testCollectionsFieldMethodReplacement() throws Exception { |
| 9177 |
Hashtable options= JavaCore.getOptions(); |
9228 |
Hashtable options= JavaCore.getOptions(); |
| 9178 |
options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.WARNING); |
9229 |
options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.WARNING); |