Skip to content

Commit fab96ca

Browse files
committed
Use default visibility for test classes and methods in spring-core
See gh-23451
1 parent cf1bf3d commit fab96ca

File tree

180 files changed

+2920
-2899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+2920
-2899
lines changed
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,52 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.core.type;
17+
package example.type;
1818

1919
/**
2020
* We must use a standalone set of types to ensure that no one else is loading
21-
* them and interfering with {@link ClassloadingAssertions#assertClassNotLoaded(String)}.
21+
* them and interfering with
22+
* {@link org.springframework.core.type.ClassloadingAssertions#assertClassNotLoaded(String)}.
2223
*
2324
* @author Ramnivas Laddad
2425
* @author Juergen Hoeller
2526
* @author Oliver Gierke
2627
* @author Sam Brannen
27-
* @see AnnotationTypeFilterTests
28+
* @see org.springframework.core.type.AnnotationTypeFilterTests
2829
*/
29-
class AnnotationTypeFilterTestsTypes {
30+
public class AnnotationTypeFilterTestsTypes {
3031

31-
@AnnotationTypeFilterTests.InheritedAnnotation
32-
private static class SomeComponent {
32+
@InheritedAnnotation
33+
public static class SomeComponent {
3334
}
3435

3536

36-
@AnnotationTypeFilterTests.InheritedAnnotation
37-
private interface SomeComponentInterface {
37+
@InheritedAnnotation
38+
public interface SomeComponentInterface {
3839
}
3940

4041

4142
@SuppressWarnings("unused")
42-
private static class SomeClassWithSomeComponentInterface implements Cloneable, SomeComponentInterface {
43+
public static class SomeClassWithSomeComponentInterface implements Cloneable, SomeComponentInterface {
4344
}
4445

4546

4647
@SuppressWarnings("unused")
47-
private static class SomeSubclassOfSomeComponent extends SomeComponent {
48+
public static class SomeSubclassOfSomeComponent extends SomeComponent {
4849
}
4950

50-
@AnnotationTypeFilterTests.NonInheritedAnnotation
51-
private static class SomeClassMarkedWithNonInheritedAnnotation {
51+
@NonInheritedAnnotation
52+
public static class SomeClassMarkedWithNonInheritedAnnotation {
5253
}
5354

5455

5556
@SuppressWarnings("unused")
56-
private static class SomeSubclassOfSomeClassMarkedWithNonInheritedAnnotation extends SomeClassMarkedWithNonInheritedAnnotation {
57+
public static class SomeSubclassOfSomeClassMarkedWithNonInheritedAnnotation extends SomeClassMarkedWithNonInheritedAnnotation {
5758
}
5859

5960

6061
@SuppressWarnings("unused")
61-
private static class SomeNonCandidateClass {
62+
public static class SomeNonCandidateClass {
6263
}
6364

6465
}
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,39 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.core.type;
17+
package example.type;
1818

1919
import org.springframework.stereotype.Component;
2020

2121
/**
2222
* We must use a standalone set of types to ensure that no one else is loading
23-
* them and interfering with {@link ClassloadingAssertions#assertClassNotLoaded(String)}.
23+
* them and interfering with
24+
* {@link org.springframework.core.type.ClassloadingAssertions#assertClassNotLoaded(String)}.
2425
*
2526
* @author Ramnivas Laddad
2627
* @author Sam Brannen
27-
* @see AspectJTypeFilterTests
28+
* @see org.springframework.core.type.AspectJTypeFilterTests
2829
*/
2930
public class AspectJTypeFilterTestsTypes {
3031

31-
interface SomeInterface {
32+
public interface SomeInterface {
3233
}
3334

34-
static class SomeClass {
35+
public static class SomeClass {
3536
}
3637

37-
static class SomeClassExtendingSomeClass extends SomeClass {
38+
public static class SomeClassExtendingSomeClass extends SomeClass {
3839
}
3940

40-
static class SomeClassImplementingSomeInterface implements SomeInterface {
41+
public static class SomeClassImplementingSomeInterface implements SomeInterface {
4142
}
4243

43-
static class SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface
44+
public static class SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface
4445
extends SomeClassExtendingSomeClass implements SomeInterface {
4546
}
4647

4748
@Component
48-
static class SomeClassAnnotatedWithComponent {
49+
public static class SomeClassAnnotatedWithComponent {
4950
}
5051

5152
}
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,39 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.core.type;
17+
package example.type;
1818

1919
/**
2020
* We must use a standalone set of types to ensure that no one else is loading
21-
* them and interfering with {@link ClassloadingAssertions#assertClassNotLoaded(String)}.
21+
* them and interfering with
22+
* {@link org.springframework.core.type.ClassloadingAssertions#assertClassNotLoaded(String)}.
2223
*
2324
* @author Ramnivas Laddad
2425
* @author Juergen Hoeller
2526
* @author Sam Brannen
26-
* @see AssignableTypeFilterTests
27+
* @see org.springframework.core.type.AssignableTypeFilterTests
2728
*/
28-
class AssignableTypeFilterTestsTypes {
29+
public class AssignableTypeFilterTestsTypes {
2930

30-
static class TestNonInheritingClass {
31+
public static class TestNonInheritingClass {
3132
}
3233

33-
interface TestInterface {
34+
public interface TestInterface {
3435
}
3536

36-
static class TestInterfaceImpl implements TestInterface {
37+
public static class TestInterfaceImpl implements TestInterface {
3738
}
3839

39-
interface SomeDaoLikeInterface {
40+
public interface SomeDaoLikeInterface {
4041
}
4142

42-
static class SomeDaoLikeImpl extends SimpleJdbcDaoSupport implements SomeDaoLikeInterface {
43+
public static class SomeDaoLikeImpl extends SimpleJdbcDaoSupport implements SomeDaoLikeInterface {
4344
}
4445

45-
interface JdbcDaoSupport {
46+
public interface JdbcDaoSupport {
4647
}
4748

48-
static class SimpleJdbcDaoSupport implements JdbcDaoSupport {
49+
public static class SimpleJdbcDaoSupport implements JdbcDaoSupport {
4950
}
5051

5152
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2002-2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package example.type;
18+
19+
import java.lang.annotation.Inherited;
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
22+
23+
@Inherited
24+
@Retention(RetentionPolicy.RUNTIME)
25+
public @interface InheritedAnnotation {
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2002-2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package example.type;
18+
19+
import java.lang.annotation.Retention;
20+
import java.lang.annotation.RetentionPolicy;
21+
22+
@Retention(RetentionPolicy.RUNTIME)
23+
public @interface NonInheritedAnnotation {
24+
}

spring-core/src/test/java/org/springframework/core/AttributeAccessorSupportTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @author Sam Brannen
2828
* @since 2.0
2929
*/
30-
public class AttributeAccessorSupportTests {
30+
class AttributeAccessorSupportTests {
3131

3232
private static final String NAME = "foo";
3333

@@ -36,28 +36,28 @@ public class AttributeAccessorSupportTests {
3636
private AttributeAccessor attributeAccessor = new SimpleAttributeAccessorSupport();
3737

3838
@Test
39-
public void setAndGet() throws Exception {
39+
void setAndGet() throws Exception {
4040
this.attributeAccessor.setAttribute(NAME, VALUE);
4141
assertThat(this.attributeAccessor.getAttribute(NAME)).isEqualTo(VALUE);
4242
}
4343

4444
@Test
45-
public void setAndHas() throws Exception {
45+
void setAndHas() throws Exception {
4646
assertThat(this.attributeAccessor.hasAttribute(NAME)).isFalse();
4747
this.attributeAccessor.setAttribute(NAME, VALUE);
4848
assertThat(this.attributeAccessor.hasAttribute(NAME)).isTrue();
4949
}
5050

5151
@Test
52-
public void remove() throws Exception {
52+
void remove() throws Exception {
5353
assertThat(this.attributeAccessor.hasAttribute(NAME)).isFalse();
5454
this.attributeAccessor.setAttribute(NAME, VALUE);
5555
assertThat(this.attributeAccessor.removeAttribute(NAME)).isEqualTo(VALUE);
5656
assertThat(this.attributeAccessor.hasAttribute(NAME)).isFalse();
5757
}
5858

5959
@Test
60-
public void attributeNames() throws Exception {
60+
void attributeNames() throws Exception {
6161
this.attributeAccessor.setAttribute(NAME, VALUE);
6262
this.attributeAccessor.setAttribute("abc", "123");
6363
String[] attributeNames = this.attributeAccessor.attributeNames();

0 commit comments

Comments
 (0)