Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 16d97dc

Browse files
committed
Add repro project for SPR-9584
1 parent fe6844f commit 16d97dc

File tree

5 files changed

+128
-0
lines changed

5 files changed

+128
-0
lines changed

SPR-9584/Main.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import org.springframework.beans.BeanUtils;
2+
3+
import java.beans.PropertyDescriptor;
4+
5+
public class Main {
6+
7+
public static void main(String[] args) {
8+
int threadCount = Integer.parseInt(args[0]);
9+
10+
final Object lock = new Object();
11+
12+
for(int i=0; i<threadCount; i++) {
13+
new Thread(new Runnable() {
14+
public void run() {
15+
synchronized (lock) {
16+
try { lock.wait(); } catch(InterruptedException ignore) {}
17+
}
18+
verifyDescriptors();
19+
}
20+
}).start();
21+
}
22+
23+
try { Thread.sleep(500); } catch(InterruptedException ignore) {}
24+
25+
synchronized (lock) {
26+
lock.notifyAll();
27+
}
28+
}
29+
30+
private static void verifyDescriptors() {
31+
PropertyDescriptor[] pds = BeanUtils.getPropertyDescriptors(Three.class);
32+
if(pds.length != 9) {
33+
System.out.println("Fail: " + pds.length);
34+
}
35+
}
36+
37+
}

SPR-9584/One.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.util.Date;
2+
3+
public abstract class One {
4+
5+
private final Date a1;
6+
7+
public One() {
8+
this(null);
9+
}
10+
11+
protected One(Date a1) {
12+
this.a1 = a1;
13+
}
14+
15+
public Date getA() {
16+
return a1;
17+
}
18+
19+
}

SPR-9584/Three.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import java.util.Date;
2+
3+
public final class Three extends Two {
4+
5+
private final Boolean c1;
6+
7+
public Three() {
8+
this(null, null, null, null, null, null, null, null);
9+
}
10+
11+
public Three(Date a1, Boolean b1, Boolean b2, Boolean b3, Boolean b4, Boolean b5, String b6, Boolean c1) {
12+
super(a1, b1, b2, b3, b4, b5, b6);
13+
this.c1 = c1;
14+
}
15+
16+
public Boolean getC1() {
17+
return c1;
18+
}
19+
20+
}

SPR-9584/Two.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import java.util.Date;
2+
3+
public abstract class Two extends One {
4+
5+
private final Boolean b1;
6+
private final Boolean b2;
7+
private final Boolean b3;
8+
private final Boolean b4;
9+
private final Boolean b5;
10+
private final String b6;
11+
12+
protected Two(Date a1, Boolean b1, Boolean b2, Boolean b3, Boolean b4, Boolean b5, String b6) {
13+
super(a1);
14+
this.b1 = b1;
15+
this.b2 = b2;
16+
this.b3 = b3;
17+
this.b4 = b4;
18+
this.b5 = b5;
19+
this.b6 = b6;
20+
}
21+
22+
public Boolean getB1() {
23+
return b1;
24+
}
25+
26+
public Boolean getB2() {
27+
return b2;
28+
}
29+
30+
public Boolean getB3() {
31+
return b3;
32+
}
33+
34+
public Boolean getB4() {
35+
return b4;
36+
}
37+
38+
public Boolean getB5() {
39+
return b5;
40+
}
41+
42+
public String getB6() {
43+
return b6;
44+
}
45+
}

SPR-9584/repro.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# per instructions at https://jira.springsource.org/browse/SPR-9584
2+
3+
javac -classpath ../../spring-framework/spring-beans/build/libs/spring-beans-3.2.0.BUILD-SNAPSHOT.jar:../../spring-framework/spring-core/build/libs/spring-core-3.2.0.BUILD-SNAPSHOT.jar *.java
4+
5+
for i in {1..1000}; do
6+
java -cp ../../spring-framework/spring-beans/build/libs/spring-beans-3.2.0.BUILD-SNAPSHOT.jar:../../spring-framework/spring-core/build/libs/spring-core-3.2.0.BUILD-SNAPSHOT.jar:/Users/cbeams/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:. Main 50
7+
done

0 commit comments

Comments
 (0)