Created
October 17, 2022 21:18
-
-
Save fmbenhassine/46da38e422259dc4b290f97a6d9b57c5 to your computer and use it in GitHub Desktop.
SF overloaded setter selection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | |
<bean class="org.springframework.retry.policy.SimpleRetryPolicy" xmlns="http://www.springframework.org/schema/beans"> | |
<property name="maxAttempts" value="2"/> | |
</bean> | |
</beans> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo; | |
import org.springframework.context.support.ClassPathXmlApplicationContext; | |
import org.springframework.retry.policy.SimpleRetryPolicy; | |
public class DemoApplication { | |
public static void main(String[] args) { | |
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("application-context.xml"); | |
SimpleRetryPolicy bean = context.getBean(SimpleRetryPolicy.class); | |
int maxAttempts = bean.getMaxAttempts(); | |
System.out.println("maxAttempts = " + maxAttempts); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example</groupId> | |
<artifactId>demo</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>demo</name> | |
<description>Demo project for Spring</description> | |
<properties> | |
<java.version>17</java.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context</artifactId> | |
<!-- <version>6.0.0-RC1</version>--> | |
<version>6.0.0-SNAPSHOT</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.retry</groupId> | |
<artifactId>spring-retry</artifactId> | |
<version>2.0.0-RC1</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.10.1</version> | |
<configuration> | |
<release>${java.version}</release> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
<repositories> | |
<repository> | |
<id>spring-milestones</id> | |
<name>Spring Milestones</name> | |
<url>https://repo.spring.io/milestone</url> | |
<snapshots> | |
<enabled>false</enabled> | |
</snapshots> | |
</repository> | |
</repositories> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fails randomly on the same OS/JVM with: