Skip to content

Commit 96e74ec

Browse files
authored
Merge pull request #288 from diffplug/ext_eclipse_groovy_3.0.0
Groovy-Eclipse 3.0.0
2 parents 7e50a75 + f5e2aff commit 96e74ec

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

_ext/eclipse-groovy/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ ext {
1212
// the once used during code formatting
1313
'org.codehaus.groovy':'+', // Groovy compiler patches supporting use within GrEclipse and Groovy itself
1414
'org.codehaus.groovy.eclipse.core':'+', // Groovy core classes (provides central logging used by formatter)
15-
//'org.eclipse.jdt.core':"${VER_JDT_PATCH}", // Patches org.eclipse.jdt.core classes supporting use within GrEclipse (provides AST generator)
15+
'org.eclipse.jdt.core':'+', // Patches org.eclipse.jdt.core classes supporting use within GrEclipse (provides AST generator)
1616
'org.eclipse.jdt.groovy.core':'+' // Extends org.eclipse.jdt.core for Groovy
1717
]
1818

1919
internalJars = [
2020
//Jars included by org.codehaus.groovy
21-
"**/groovy-all-${VER_GROOVY}-indy", // Use Groovy compiler compatible with GrEclipse instead of localGroovy
21+
"**/groovy-${VER_GROOVY}-indy", // Use Groovy compiler compatible with GrEclipse instead of localGroovy
2222
'**/groovy-eclipse', // Patches/Overrides some of the Groovy compiler classes
2323
'**/eclipse-trace', // Provides logging capabilities for groovy-eclipse
2424

_ext/eclipse-groovy/gradle.properties

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Versions correspond to the Groovy-Eclipse version used for the fat-JAR.
22
# See https://github.com/groovy/groovy-eclipse/releases for further information about Groovy-Eclipse versions.
33
# Patch version can be incremented independently for backward compatible patches of this library.
4-
ext_version=2.9.2
4+
ext_version=3.0.0
55
ext_artifactId=spotless-eclipse-groovy
66
ext_description=Groovy Eclipse's formatter bundled for Spotless
77

@@ -12,8 +12,7 @@ ext_group=com.diffplug.spotless
1212
ext_VER_JAVA=1.8
1313

1414
# Compile
15-
VER_ECLIPSE=4.7
15+
VER_ECLIPSE=4.8
1616
VER_SPOTLESS_ECLISPE_BASE=[3.0.0,4.0.0[
1717
VER_ECLISPE_JFACE=[3.12.0,4.0.0[
18-
VER_GROOVY=2.5.0
19-
VER_JDT_PATCH=3.13.100.xx-201801041714-e47-RELEASE
18+
VER_GROOVY=2.6.0

_ext/eclipse-groovy/src/main/java/com/diffplug/spotless/extra/eclipse/groovy/SpotlessLogService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public SimpleLogEntry(LogLevel level, String message) {
369369
}
370370

371371
public SimpleLogEntry(LogLevel level, String message, Throwable execption) {
372-
this(level, message, Optional.of(execption));
372+
this(level, message, Optional.ofNullable(execption));
373373
}
374374

375375
private SimpleLogEntry(LogLevel level, String message, Optional<Throwable> execption) {

_ext/eclipse-groovy/src/test/java/com/diffplug/spotless/extra/eclipse/groovy/GrEclipseFormatterStepImplTest.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class GrEclipseFormatterStepImplTest {
3131
private final static TestData TEST_DATA = TestData.getTestDataOnFileSystem();
3232
private final static String PARSER_EXCEPTION = "class Test { void method() {} ";
3333
private final static String SCANNER_EXCEPTION = "{";
34-
private final static String BOUNDED_WILDCARDS = "foo(Map<String, ? extends Object> e) {}";
34+
private final static String BOUNDED_WILDCARDS = "foo(Map<String, ? extends Object> e)\n{\ne.clear();\n}";
3535

3636
@Test
3737
public void defaultFormat() throws Throwable {
@@ -71,10 +71,15 @@ public void scannerException() throws Throwable {
7171
format(SCANNER_EXCEPTION, config -> {});
7272
}
7373

74-
/** Test the handling bounded wildcards templates */
75-
@Test(expected = IllegalArgumentException.class)
74+
/**
75+
* Test the handling bounded wildcards templates
76+
* No exception since Groovy-Eclipse 3.0.0.
77+
*/
78+
@Test
7679
public void boundedWildCards() throws Throwable {
77-
format(BOUNDED_WILDCARDS, config -> {});
80+
String output = format(BOUNDED_WILDCARDS, config -> {});
81+
assertEquals("Groovy formatter does notformat after bounded wildcards correctly.",
82+
BOUNDED_WILDCARDS.replace("\n", " "), output);
7883
}
7984

8085
@Test

0 commit comments

Comments
 (0)