()
| 37 | } |
| 38 | |
| 39 | private static BeanSupport createInstance() { |
| 40 | // Only intended for unit tests. Not intended to be part of public API. |
| 41 | boolean useFull = !Boolean.getBoolean("jakarta.el.BeanSupport.useStandalone"); |
| 42 | |
| 43 | if (useFull) { |
| 44 | // If not explicitly configured to use standalone, use the full implementation unless it is not available. |
| 45 | try { |
| 46 | Class.forName("java.beans.BeanInfo"); |
| 47 | } catch (Exception e) { |
| 48 | // Ignore: Expected if using modules and java.desktop module is not present |
| 49 | useFull = false; |
| 50 | } |
| 51 | } |
| 52 | if (useFull) { |
| 53 | // The full implementation provided by the java.beans package |
| 54 | return new BeanSupportFull(); |
| 55 | } else { |
| 56 | // The cut-down local implementation that does not depend on the java.beans package |
| 57 | return new BeanSupportStandalone(); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | static BeanSupport getInstance() { |
| 62 | if (beanSupport == null) { |
no test coverage detected