Upgrade to spring-javaformat 0.0.28 and downgrade to Checkstyle 8.41
In order to be able to use text blocks and other new Java language features, we are upgrading to a recent version of Checkstyle. The latest version of spring-javaformat-checkstyle (0.0.28) is built against Checkstyle 8.32 which does not include support for language features such as text blocks. Support for text blocks was added in Checkstyle 8.36. In addition, there is a binary compatibility issue between spring-javaformat-checkstyle 0.0.28 and Checkstyle 8.42. Thus we cannot use Checkstyle 8.42 or higher. In this commit, we therefore upgrade to spring-javaformat-checkstyle 0.0.28 and downgrade to Checkstyle 8.41. This change is being applied to `5.3.x` as well as `main` in order to benefit from the enhanced checking provided in more recent versions of Checkstyle. Closes gh-27481
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.expression.spel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -31,10 +32,10 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Andy Clement
|
||||
* @author Giovanni Dall'Oglio Risso
|
||||
*/
|
||||
public class DefaultComparatorUnitTests {
|
||||
class DefaultComparatorUnitTests {
|
||||
|
||||
@Test
|
||||
public void testPrimitives() throws EvaluationException {
|
||||
void testPrimitives() throws EvaluationException {
|
||||
TypeComparator comparator = new StandardTypeComparator();
|
||||
// primitive int
|
||||
assertThat(comparator.compare(1, 2) < 0).isTrue();
|
||||
@@ -63,7 +64,7 @@ public class DefaultComparatorUnitTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonPrimitiveNumbers() throws EvaluationException {
|
||||
void testNonPrimitiveNumbers() throws EvaluationException {
|
||||
TypeComparator comparator = new StandardTypeComparator();
|
||||
|
||||
BigDecimal bdOne = new BigDecimal("1");
|
||||
@@ -92,7 +93,7 @@ public class DefaultComparatorUnitTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNulls() throws EvaluationException {
|
||||
void testNulls() throws EvaluationException {
|
||||
TypeComparator comparator = new StandardTypeComparator();
|
||||
assertThat(comparator.compare(null,"abc")<0).isTrue();
|
||||
assertThat(comparator.compare(null,null)==0).isTrue();
|
||||
@@ -100,7 +101,7 @@ public class DefaultComparatorUnitTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testObjects() throws EvaluationException {
|
||||
void testObjects() throws EvaluationException {
|
||||
TypeComparator comparator = new StandardTypeComparator();
|
||||
assertThat(comparator.compare("a","a")==0).isTrue();
|
||||
assertThat(comparator.compare("a","b")<0).isTrue();
|
||||
@@ -108,7 +109,7 @@ public class DefaultComparatorUnitTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCanCompare() throws EvaluationException {
|
||||
void testCanCompare() throws EvaluationException {
|
||||
TypeComparator comparator = new StandardTypeComparator();
|
||||
assertThat(comparator.canCompare(null,1)).isTrue();
|
||||
assertThat(comparator.canCompare(1,null)).isTrue();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.expression.spel;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,14 +27,14 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
/**
|
||||
* Unit tests for type comparison
|
||||
* Unit tests for type comparison.
|
||||
*
|
||||
* @author Andy Clement
|
||||
*/
|
||||
public class StandardTypeLocatorTests {
|
||||
class StandardTypeLocatorTests {
|
||||
|
||||
@Test
|
||||
public void testImports() throws EvaluationException {
|
||||
void testImports() throws EvaluationException {
|
||||
StandardTypeLocator locator = new StandardTypeLocator();
|
||||
assertThat(locator.findType("java.lang.Integer")).isEqualTo(Integer.class);
|
||||
assertThat(locator.findType("java.lang.String")).isEqualTo(String.class);
|
||||
@@ -45,7 +46,7 @@ public class StandardTypeLocatorTests {
|
||||
|
||||
assertThat(locator.findType("Boolean")).isEqualTo(Boolean.class);
|
||||
// currently does not know about java.util by default
|
||||
// assertEquals(java.util.List.class,locator.findType("List"));
|
||||
// assertEquals(java.util.List.class,locator.findType("List"));
|
||||
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
locator.findType("URL"))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +13,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.expression.spel.testdata;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @since 4.1.2
|
||||
*/
|
||||
@@ -35,4 +35,5 @@ public class PersonInOtherPackage {
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user