Skip to content

Commit 6193b6d

Browse files
authored
Report for M1 removals (closes #162) (#324)
- Add common SpringBeanMethodDeclarationFinder
1 parent 56cc9f0 commit 6193b6d

File tree

24 files changed

+823
-228
lines changed

24 files changed

+823
-228
lines changed

components/sbm-core/src/main/java/org/springframework/sbm/java/api/JavaSource.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ public interface JavaSource extends ProjectResource {
3535

3636
List<? extends Import> getImports();
3737

38+
/**
39+
* Check if this JavaSource has any import starting with any of the given {@code impoorts}.
40+
*
41+
* Internally {@code .contains(impoort)} is used to check against all imports
42+
*
43+
* @param importPattern array of import starting patterns
44+
*/
3845
boolean hasImportStartingWith(String... importPattern);
3946

4047
String getPackageName();

components/sbm-core/src/main/java/org/springframework/sbm/java/impl/OpenRewriteJavaSource.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@ public List<OpenRewriteImport> getImports() {
9090
}
9191

9292
/**
93-
* Check if this JavaSource has any import starting with the any of the given {@code impoorts}.
94-
*
95-
* Internally {@code .contains(impoort)} is used to check against all imports
96-
*
97-
* @param impoort array of import starting patterns
93+
* {@inheritDoc}
9894
*/
9995
@Override
10096
public boolean hasImportStartingWith(String... impoort) {

components/sbm-core/src/main/java/org/springframework/sbm/java/impl/OpenRewriteMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public Visibility getVisibility() {
160160
@Override
161161
public String getReturnValue() {
162162
JavaType.FullyQualified fullyQualified = TypeUtils.asFullyQualified(getMethodDecl().getReturnTypeExpression().getType());
163-
return fullyQualified.getClassName();
163+
return fullyQualified.getFullyQualifiedName();
164164
}
165165

166166
// FIXME: renaming method should not require a methodPattern in this context
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2021 - 2022 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.example</groupId>
24+
<artifactId>parent</artifactId>
25+
<version>1.0-SNAPSHOT</version>
26+
<relativePath>../pom.xml</relativePath>
27+
</parent>
28+
<artifactId>module1</artifactId>
29+
<properties>
30+
<maven.compiler.source>17</maven.compiler.source>
31+
<maven.compiler.target>17</maven.compiler.target>
32+
</properties>
33+
<dependencies>
34+
<dependency>
35+
<groupId>org.example</groupId>
36+
<artifactId>module2</artifactId>
37+
<version>${project.version}</version>
38+
</dependency>
39+
</dependencies>
40+
</project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2021 - 2022 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+
public class Foo {
18+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2021 - 2022 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.example</groupId>
24+
<artifactId>parent</artifactId>
25+
<version>1.0-SNAPSHOT</version>
26+
<relativePath>../pom.xml</relativePath>
27+
</parent>
28+
<artifactId>module2</artifactId>
29+
<properties>
30+
<maven.compiler.source>17</maven.compiler.source>
31+
<maven.compiler.target>17</maven.compiler.target>
32+
</properties>
33+
</project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2021 - 2022 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+
public class Bar {}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2021 - 2022 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<groupId>org.example</groupId>
23+
<artifactId>parent</artifactId>
24+
<version>1.0-SNAPSHOT</version>
25+
<packaging>pom</packaging>
26+
<properties>
27+
<maven.compiler.source>17</maven.compiler.source>
28+
<maven.compiler.target>17</maven.compiler.target>
29+
</properties>
30+
<modules>
31+
<module>module1</module>
32+
<module>module2</module>
33+
</modules>
34+
</project>

components/sbm-openrewrite/src/test/java/org/springframework/sbm/support/openrewrite/java/FindInterfacesAnnotatedWithTest.java

Lines changed: 0 additions & 188 deletions
This file was deleted.

0 commit comments

Comments
 (0)