Skip to content

Commit b101de2

Browse files
committed
Our greclipse-based steps are not working, disable them for now and document in #685.
1 parent d060862 commit b101de2

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

‎lib-extra/src/test/java/com/diffplug/spotless/extra/eclipse/EclipseCommonTests.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 DiffPlug
2+
* Copyright 2016-2020 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -64,8 +64,12 @@ public abstract class EclipseCommonTests extends ResourceHarness {
6464
/** Create formatter step for a specific version */
6565
protected abstract FormatterStep createStep(String version);
6666

67+
/** Called before the test, so that clients may call {@link org.junit.Assume}. */
68+
protected void makeAssumptions() {}
69+
6770
@Test
6871
public void testSupportedVersions() throws Exception {
72+
makeAssumptions();
6973
String[] versions = getSupportedVersions();
7074
for (String version : versions) {
7175
String input = getTestInput(version);

‎lib-extra/src/test/java/com/diffplug/spotless/extra/groovy/GrEclipseFormatterStepTest.java‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 DiffPlug
2+
* Copyright 2016-2020 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616
package com.diffplug.spotless.extra.groovy;
1717

1818
import com.diffplug.spotless.FormatterStep;
19+
import com.diffplug.spotless.JreVersion;
1920
import com.diffplug.spotless.TestProvisioner;
2021
import com.diffplug.spotless.extra.EclipseBasedStepBuilder;
2122
import com.diffplug.spotless.extra.eclipse.EclipseCommonTests;
@@ -36,6 +37,30 @@ protected String getTestExpectation(String version) {
3637
return "class F{\n\tdef m(){}\n}";
3738
}
3839

40+
@Override
41+
protected void makeAssumptions() {
42+
// JRE 11 warns like this:
43+
// WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
44+
// WARNING: All illegal access operations will be denied in a future release
45+
// And after that it fails like this:
46+
// Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
47+
// at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:39)
48+
// at org.codehaus.groovy.ast.ClassHelper.makeCached(ClassHelper.java:133)
49+
// at org.codehaus.groovy.ast.ClassHelper.<clinit>(ClassHelper.java:67)
50+
// at org.codehaus.groovy.classgen.Verifier.<clinit>(Verifier.java:113)
51+
// at org.codehaus.groovy.control.CompilationUnit.<init>(CompilationUnit.java:158)
52+
// at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.makeCompilationUnit(GroovyParser.java:467)
53+
// at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.<init>(GroovyParser.java:247)
54+
// at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.<init>(GroovyParser.java:216)
55+
// at org.codehaus.groovy.eclipse.core.compiler.GroovySnippetParser.dietParse(GroovySnippetParser.java:105)
56+
// at org.codehaus.groovy.eclipse.core.compiler.GroovySnippetParser.parse(GroovySnippetParser.java:69)
57+
// at org.codehaus.groovy.eclipse.refactoring.core.utils.ASTTools.getASTNodeFromSource(ASTTools.java:204)
58+
// at org.codehaus.groovy.eclipse.refactoring.formatter.DefaultGroovyFormatter.initCodebase(DefaultGroovyFormatter.java:109)
59+
// at org.codehaus.groovy.eclipse.refactoring.formatter.DefaultGroovyFormatter.format(DefaultGroovyFormatter.java:121)
60+
// at com.diffplug.spotless.extra.eclipse.groovy.GrEclipseFormatterStepImpl.format(GrEclipseFormatterStepImpl.java:81)
61+
JreVersion.assume11OrLess();
62+
}
63+
3964
@Override
4065
protected FormatterStep createStep(String version) {
4166
EclipseBasedStepBuilder builder = GrEclipseFormatterStep.createBuilder(TestProvisioner.mavenCentral());

0 commit comments

Comments
 (0)