if (parentElement instanceof TreeParent) {
if (sortChildren) {
Object[] tmpArr = ((TreeParent) parentElement).getChildren();
if (parentElement instanceof TreeParent) {
if (sortChildren) {
Object[] tmpArr = ((TreeParent) parentElement).getChildren();
+ if (tmpArr == null)
+ return new Object[0];
TreeParent[] arr = new TreeParent[tmpArr.length];
for (int i = 0; i < tmpArr.length; i++)
arr[i] = (TreeParent) tmpArr[i];
TreeParent[] arr = new TreeParent[tmpArr.length];
for (int i = 0; i < tmpArr.length; i++)
arr[i] = (TreeParent) tmpArr[i];
return arr;
} else
return ((TreeParent) parentElement).getChildren();
return arr;
} else
return ((TreeParent) parentElement).getChildren();
- public Session getSession() {
+ public synchronized Session getSession() {
- public Node getRootNode() {
+ public synchronized Node getRootNode() {
try {
if (session != null)
return session.getRootNode();
try {
if (session != null)
return session.getRootNode();
+ public synchronized void login() {
try {
session = ((RepositoryElem) getParent()).repositoryLogin(getName());
} catch (RepositoryException e) {
try {
session = ((RepositoryElem) getParent()).repositoryLogin(getName());
} catch (RepositoryException e) {
}
/** Logouts the session, does not nothing if there is no live session. */
}
/** Logouts the session, does not nothing if there is no live session. */
+ public synchronized void logout() {
clearChildren();
JcrUtils.logoutQuietly(session);
clearChildren();
JcrUtils.logoutQuietly(session);
- public boolean hasChildren() {
+ public synchronized boolean hasChildren() {
try {
if (isConnected())
return session.getRootNode().hasNodes();
try {
if (isConnected())
return session.getRootNode().hasNodes();