jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giota Karadimitriou" <Giota.Karadimitr...@eurodyn.com>
Subject some small error found
Date Fri, 10 Mar 2006 08:44:08 GMT
I have been testing my application with jackrabbit 1.0 and found a small
error which causes a null pointer exception.
 
Class org.apache.jackrabbit.core.BatchedItemOperations
 
public void checkAddNode(.
 
//line 576
// make sure parent node is not protected
< if (parentDef.isProtected()) {
 
> if (parentDef!=null && parentDef.isProtected()) {
 
I don't know the process, whether I should report to jira/file issue
that is why I write directly to the list
 
The code that tested that is this below.
One must have 2 workspaces to run this and try to clone a node of the
first workspace under the root of the second:
 
          String originalWorkspace = entry.getWorkspace();
          String originalPath = entry.getAbsolutePath();
          Session originalSession = getSession(originalWorkspace);
          Session session = getSession(secondWorkspace);
          log.debug("originalSession=" + originalSession);
          Node rnOriginal=originalSession.getRootNode();
          Node node=rnOriginal.getNode(originalPath.substring(1));
          log.debug("node=" + node);
          log.debug("session=" + session);
          Workspace ws = session.getWorkspace();
          log.debug("ws=" + ws.getName());
          String name=Util.getName(originalPath); //gets just the file
name
          log.debug("name=" + name);
          ws.clone(originalWorkspace, originalPath,
                  Constants.PATH_SEPARATOR_CHAR + name, true);
          Node rn = session.getRootNode();
          log.debug("rn=" + rn);
          Node movedNode = rn.getNode(name);
          log.debug("movedNode=" + movedNode);
 
regards,
Giota
          
 
 
 
 
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message