Skip to content

Commit

Permalink
Correct rule
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Manuel Leflet Estrada <jleflete@redhat.com>
  • Loading branch information
jmle committed Nov 4, 2024
1 parent e38595a commit 66f4dfe
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
when:
or:
- java.referenced:
pattern: java.beans.Introspector
location: IMPORT
pattern: org.springframework.beans.BeanInfoFactory
- java.referenced:
pattern: java.beans.BeanInfo
location: IMPLEMENTS_TYPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,71 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>core-container</artifactId>
<version>1.0-SNAPSHOT</version>
<groupId>com.example</groupId>
<artifactId>spring-framework5-app</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>11</java.version>
<spring.version>5.3.31</spring.version>
</properties>

</project>
<dependencies>
<!-- Spring Core for essential Spring functionalities -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- Spring Context for ApplicationContext and DI support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- Spring Web for building web applications -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- Optional: Spring WebMVC for full MVC support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- Optional: For logging support -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!-- Maven Compiler Plugin to set Java version -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

import org.konveyor.beans.Bean;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;

import org.springframework.beans.BeanInfoFactory;
import org.springframework.beans.SimpleBeanInfoFactory;

public class Main {

public static void main(String[] args) throws IntrospectionException {
Bean bean = new Bean();
Introspector.getBeanInfo(bean.getClass(), Object.class);
BeanInfoFactory factory = new SimpleBeanInfoFactory();
BeanInfo beanInfo = factory.getBeanInfo(Bean.class);
System.out.println(beanInfo.getBeanDescriptor());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ tests:
analysisParams:
mode: "source-only"
hasIncidents:
exactly: 2
exactly: 3

0 comments on commit 66f4dfe

Please sign in to comment.