Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #430 from miklossy/master
Browse files Browse the repository at this point in the history
  • Loading branch information
cdietrich authored Apr 24, 2018
2 parents 8def762 + 67a0e8c commit 1ad4e80
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4840,4 +4840,41 @@ class QuickfixTest extends AbstractXtendUITestCase {
}
''')
}

@Ignore("java.lang.IllegalArgumentException: length must be >= 0")
@Test
def void unnecessaryModifier_46(){
// Xtend function having both 'def' and 'override' modifiers
val tripleQuotes = "'''"
val ifLiteral = "«IF true»"
val endifLiteral = "«ENDIF»"
create('Foo.xtend', '''
class Foo implements Runnable {
override de|f run() {
val e = «tripleQuotes»
«ifLiteral»
a
b
«endifLiteral»
«tripleQuotes»
}
}
''')
.assertIssueCodes(UNNECESSARY_MODIFIER)
.assertResolutionLabels("Remove the unnecessary modifier.")
.assertModelAfterQuickfix('''
class Foo implements Runnable {
override run() {
val e = «tripleQuotes»
«ifLiteral»
a
b
«endifLiteral»
«tripleQuotes»
}
}
''')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8646,4 +8646,76 @@ public void unnecessaryModifier_45() {
_builder_1.newLine();
_assertResolutionLabels.assertModelAfterQuickfix(_builder_1);
}

@Ignore("java.lang.IllegalArgumentException: length must be >= 0")
@Test
public void unnecessaryModifier_46() {
final String tripleQuotes = "\'\'\'";
final String ifLiteral = "«IF true»";
final String endifLiteral = "«ENDIF»";
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo implements Runnable {");
_builder.newLine();
_builder.append("\t");
_builder.append("override de|f run() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("val e = ");
_builder.append(tripleQuotes, "\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t");
_builder.append(ifLiteral, "\t\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t\t");
_builder.append("a");
_builder.newLine();
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("b");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append(endifLiteral, "\t\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append(tripleQuotes, "\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
QuickfixTestBuilder _assertResolutionLabels = this.builder.create("Foo.xtend", _builder).assertIssueCodes(org.eclipse.xtend.core.validation.IssueCodes.UNNECESSARY_MODIFIER).assertResolutionLabels("Remove the unnecessary modifier.");
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class Foo implements Runnable {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("override run() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("val e = ");
_builder_1.append(tripleQuotes, "\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t\t");
_builder_1.append(ifLiteral, "\t\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t\t\t");
_builder_1.append("a");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("\t\t\t\t");
_builder_1.append("b");
_builder_1.newLine();
_builder_1.append("\t\t\t");
_builder_1.append(endifLiteral, "\t\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
_builder_1.append(tripleQuotes, "\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
_assertResolutionLabels.assertModelAfterQuickfix(_builder_1);
}
}

0 comments on commit 1ad4e80

Please sign in to comment.