|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2011 the original author or authors. |
| 2 | + * Copyright 2002-2012 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
16 | 16 |
|
17 | 17 | package org.springframework.beans;
|
18 | 18 |
|
19 |
| -import static java.lang.String.format; |
20 | 19 | import static org.hamcrest.CoreMatchers.equalTo;
|
21 | 20 | import static org.hamcrest.CoreMatchers.instanceOf;
|
22 | 21 | import static org.hamcrest.CoreMatchers.is;
|
|
30 | 29 | import java.beans.IntrospectionException;
|
31 | 30 | import java.beans.Introspector;
|
32 | 31 | import java.beans.PropertyDescriptor;
|
33 |
| -import java.lang.reflect.Method; |
34 | 32 |
|
35 |
| -import org.junit.Ignore; |
36 | 33 | import org.junit.Test;
|
37 | 34 | import org.springframework.beans.ExtendedBeanInfo.PropertyDescriptorComparator;
|
38 | 35 |
|
@@ -664,51 +661,12 @@ private boolean hasIndexedReadMethodForProperty(BeanInfo beanInfo, String proper
|
664 | 661 | }
|
665 | 662 |
|
666 | 663 | @Test
|
667 |
| - public void reproSpr8806_y() throws IntrospectionException, SecurityException, NoSuchMethodException { |
| 664 | + public void reproSpr8806() throws IntrospectionException { |
| 665 | + // does not throw |
668 | 666 | Introspector.getBeanInfo(LawLibrary.class);
|
669 |
| - } |
670 |
| - |
671 |
| - @Ignore @Test |
672 |
| - public void reproSpr8806_x() throws IntrospectionException, SecurityException, NoSuchMethodException { |
673 |
| - BeanInfo info = Introspector.getBeanInfo(LawLibrary.class); |
674 |
| - for (PropertyDescriptor d : info.getPropertyDescriptors()) { |
675 |
| - if (d.getName().equals("book")) { |
676 |
| - Method readMethod = d.getReadMethod(); |
677 |
| - Method writeMethod = d.getWriteMethod(); |
678 |
| - System.out.println(format("READ : %s.%s (bridge:%s)", |
679 |
| - readMethod.getDeclaringClass().getSimpleName(), readMethod.getName(), readMethod.isBridge())); |
680 |
| - System.out.println(format("WRITE: %s.%s (bridge:%s)", |
681 |
| - writeMethod.getDeclaringClass().getSimpleName(), writeMethod.getName(), writeMethod.isBridge())); |
682 |
| - new PropertyDescriptor("book", readMethod, writeMethod); |
683 |
| - } |
684 |
| - } |
685 |
| - |
686 |
| - Method readMethod = LawLibrary.class.getMethod("getBook"); |
687 |
| - Method writeMethod = LawLibrary.class.getMethod("setBook", Book.class); |
688 |
| - |
689 |
| - System.out.println(format("read : %s.%s (bridge:%s)", |
690 |
| - readMethod.getDeclaringClass().getSimpleName(), readMethod.getName(), readMethod.isBridge())); |
691 |
| - System.out.println(format("write: %s.%s (bridge:%s)", |
692 |
| - writeMethod.getDeclaringClass().getSimpleName(), writeMethod.getName(), writeMethod.isBridge())); |
693 | 667 |
|
694 |
| - |
695 |
| - System.out.println("--------"); |
696 |
| - for (Method m : LawLibrary.class.getMethods()) { |
697 |
| - if (m.getDeclaringClass() == Object.class) continue; |
698 |
| - System.out.println(format("%s %s.%s(%s) [bridge:%s]", |
699 |
| - m.getReturnType().getSimpleName(), m.getDeclaringClass().getSimpleName(), |
700 |
| - m.getName(), |
701 |
| - m.getParameterTypes().length == 1 ? m.getParameterTypes()[0].getSimpleName() : "", |
702 |
| - m.isBridge())); |
703 |
| - } |
704 |
| - |
705 |
| - //new ExtendedBeanInfo(info); |
706 |
| - } |
707 |
| - |
708 |
| - @Test |
709 |
| - public void reproSpr8806() throws IntrospectionException { |
710 |
| - BeanInfo bi = Introspector.getBeanInfo(LawLibrary.class); |
711 |
| - new ExtendedBeanInfo(bi); // throws |
| 668 | + // does not throw after the changes introduced in SPR-8806 |
| 669 | + new ExtendedBeanInfo(Introspector.getBeanInfo(LawLibrary.class)); |
712 | 670 | }
|
713 | 671 |
|
714 | 672 | interface Book { }
|
|
0 commit comments