Skip to content

Commit

Permalink
Fixed bug 434188: [quick fix] shows sign of quick fix, but says no su…
Browse files Browse the repository at this point in the history
…ggestions available.
  • Loading branch information
mkeller authored and Dani Megert committed May 14, 2014
1 parent e28aefb commit 51a68d3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public class LocalCorrectionsQuickFixTest extends QuickFixTest {
* Bug 430336: [1.8][compiler] Bad syntax error recovery: Lonely identifier should be variable name, not type
*/
public static final boolean BUG_430818= false;

/**
* Bug 434188: [quick fix] shows sign of quick fix, but says no suggestions available.
*/
public static final boolean BUG_434188= true;

private IJavaProject fJProject1;
private IPackageFragmentRoot fSourceFolder;
Expand Down Expand Up @@ -9796,6 +9801,8 @@ public void testUnusedTypeParameter3() throws Exception {
* @throws Exception
*/
public void testLoopOverAddedToFixesForVariable() throws Exception {
if (BUG_434188)
return;
if (BUG_430818)
return;

Expand Down Expand Up @@ -9860,6 +9867,9 @@ public void testLoopOverAddedToFixesForVariable() throws Exception {
* @throws Exception
*/
public void testLoopOverAddedToFixesForMethodInvocation() throws Exception {
if (BUG_434188)
return;

IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
Expand Down Expand Up @@ -9922,6 +9932,8 @@ public void testLoopOverAddedToFixesForMethodInvocation() throws Exception {
* @throws Exception
*/
public void testGenerateForeachNotAddedForLowVersion() throws Exception {
if (BUG_434188)
return;
if (BUG_430818)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2743,8 +2743,8 @@ private static boolean getConvertIterableLoopProposal(IInvocationContext context
}

public static boolean getGenerateForLoopProposals(IInvocationContext context, ASTNode coveringNode, IProblemLocation[] locations, Collection<ICommandAccess> resultingCollections) {
if (containsMatchingProblem(locations, IProblem.ParsingErrorInsertToComplete))
return false;
// if (containsMatchingProblem(locations, IProblem.ParsingErrorInsertToComplete))
// return false;

Statement statement= ASTResolving.findParentStatement(coveringNode);
ICompilationUnit cu= context.getCompilationUnit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ public boolean hasCorrections(ICompilationUnit cu, int problemId) {
case IProblem.NullableFieldReference:
case IProblem.ConflictingNullAnnotations:
case IProblem.ConflictingInheritedNullAnnotations:
case IProblem.ParsingErrorInsertToComplete:
case IProblem.ExplicitThisParameterNotBelow18:
case IProblem.DefaultMethodNotBelow18:
case IProblem.StaticInterfaceMethodNotBelow18:
Expand Down Expand Up @@ -761,9 +760,6 @@ private void process(IInvocationContext context, IProblemLocation problem, Colle
NullAnnotationsCorrectionProcessor.addReturnAndArgumentTypeProposal(context, problem, ChangeKind.LOCAL, proposals);
NullAnnotationsCorrectionProcessor.addReturnAndArgumentTypeProposal(context, problem, ChangeKind.INVERSE, proposals);
break;
case IProblem.ParsingErrorInsertToComplete:
LocalCorrectionsSubProcessor.getGenerateForLoopProposals(context, problem, proposals);
break;
default:
}
if (JavaModelUtil.is50OrHigher(context.getCompilationUnit().getJavaProject())) {
Expand Down

0 comments on commit 51a68d3

Please sign in to comment.