]
Koen Aers updated JBIDE-19830:
------------------------------
Fix Version/s: 4.3.0.Beta1
Nullpointer at recieving schema
-------------------------------
Key: JBIDE-19830
URL:
https://issues.jboss.org/browse/JBIDE-19830
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: hibernate
Affects Versions: 4.3.0.Alpha2
Environment: Hibernate: 5.0.0.Alpha2-v20150417-1452-B12
Eclipse: Eclipse Mars M7
OS: Windows 7 x64 Enterprise
DB: Postgres 9.3
Reporter: Philipp Birkl
Assignee: Koen Aers
Fix For: 4.3.0.Beta1
While receiving a schema from Database initially a _java.lang.NullPointerException* is
thrown_.
!http://i.imgur.com/2Frtlwu.png!
Stack trace can be found
[
here|https://gist.github.com/calaedo/394f3fdb8994741de3ce#file-jbide-1983...].
While debugging the plugin i found the problem at the implementation of the anonymous
comperator in
_org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(Object,
IProgressMonitor)_.
{code}
res = toArray(result.iterator(), Object.class, new Comparator<Object>() {
public int compare(Object arg0, Object arg1) {
return getName(arg0).compareTo(getName(arg1));
}
private String getName(Object o) {
String result = null;
try {
Method m = o.getClass().getMethod("getName", new Class[] {});
m.invoke(o, new Object[] {});
} catch (Exception e) {
throw new RuntimeException(e);
}
return result;
}
});
{code}
The string result is never set. So the _compareTo_ is always failing.
I haven't looked it up, but the problem might consist also in earlier versions of
JBoss tools.