Message10835
I am sure there are probably other objects that cause this, but if you instantiate a `PyInteger` before any other call within the jython library, it will then cause the instantiation of a `PythonInterpreter` to always throw a NullPointerException.
This is very easy to reproduce:
```
public class NPETest {
public static void main(String[] args) {
new PyInteger(0);
new PythonInterpreter();
}
}
```
When the above code is run, the following warning message is printed:
```
init: Bootstrapping class not in BootstrapTypesSingleton.getInstance()[class=class org.python.core.PyInteger]
```
This can be avoided by getting the class loader to load the `PyObject` class before instantiating the new `PyInteger` even indirectly through loading `PyInteger`: adding `System.out.println(PyInteger.gcMonitorGlobal);` before instantiating the PyInteger works. This seems to only works because `PyInteger.gcMonitorGlobal` is inherited from `PyObject`.
I am not sure if adding a static code block that forces initialisation in `PyInteger` will help, or even be the best way to resolve this but it might work as a temporary fix.
This may be related to #1671 or the fix introduced for it. |
|
Date |
User |
Action |
Args |
2016-04-13 15:00:15 | flungo | set | recipients:
+ flungo |
2016-04-13 15:00:15 | flungo | set | messageid: <1460559615.35.0.490933758868.issue2492@psf.upfronthosting.co.za> |
2016-04-13 15:00:15 | flungo | link | issue2492 messages |
2016-04-13 15:00:14 | flungo | create | |
|