()
| 3675 | } |
| 3676 | |
| 3677 | private void addProperties() { |
| 3678 | BeanInfo info; |
| 3679 | try { |
| 3680 | if (isBeanDerivative(theClass)) { |
| 3681 | info = Introspector.getBeanInfo(theClass, Introspector.IGNORE_ALL_BEANINFO); |
| 3682 | } else { |
| 3683 | info = Introspector.getBeanInfo(theClass); |
| 3684 | } |
| 3685 | } catch (Exception e) { |
| 3686 | throw new GroovyRuntimeException("exception during bean introspection", e); |
| 3687 | } |
| 3688 | PropertyDescriptor[] descriptors = info.getPropertyDescriptors(); |
| 3689 | // build up the metaproperties based on the public fields, property descriptors, |
| 3690 | // and the getters and setters |
| 3691 | setUpProperties(descriptors); |
| 3692 | addRecordProperties(info); |
| 3693 | |
| 3694 | EventSetDescriptor[] eventDescriptors = info.getEventSetDescriptors(); |
| 3695 | for (EventSetDescriptor descriptor : eventDescriptors) { |
| 3696 | Method[] listenerMethods = descriptor.getListenerMethods(); |
| 3697 | for (Method listenerMethod : listenerMethods) { |
| 3698 | final MetaMethod metaMethod = CachedMethod.find(descriptor.getAddListenerMethod()); |
| 3699 | // GROOVY-5202 |
| 3700 | // there might be a non-public listener of some kind |
| 3701 | // we skip that here |
| 3702 | if (metaMethod == null) continue; |
| 3703 | addToAllMethodsIfPublic(metaMethod); |
| 3704 | String name = listenerMethod.getName(); |
| 3705 | if (listeners.containsKey(name)) { |
| 3706 | listeners.put(name, AMBIGUOUS_LISTENER_METHOD); |
| 3707 | } else { |
| 3708 | listeners.put(name, metaMethod); |
| 3709 | } |
| 3710 | } |
| 3711 | } |
| 3712 | } |
| 3713 | |
| 3714 | private void addRecordProperties(BeanInfo info) { |
| 3715 | VMPlugin plugin = VMPluginFactory.getPlugin(); |
no test coverage detected