Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[stellation-res] Question about Merging NPE

Hello,

At last, I was putting aside trying to use the Eclipse client feature
to merge some changes because of an exception that came up trying to
use the client with the server to load a revision.

As long as I'm trying to exercise Stellation and find any problems I
can, I decided to try to merge a few changes using the command line
client.  My plan was:

1. Check out the main branch in a temporary directory.
2. Merge the changes from my sandbox branch into the main branch.
3. Check in the main branch.

Checking out the (empty) main branch worked just fine.  I got an
exception trying to merge the changes from my branch into the main
branch.

The stack trace is:

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.stellation.repos.util.BranchSpecSet.addAll(BranchSpecSet.java:95)
	at org.eclipse.stellation.repos.LocalHandle.nearestCommonAncestor(LocalHandle.java:1832)
	at org.eclipse.stellation.repos.LocalHandle.nearestCommonAncestor(LocalHandle.java:1755)
	at org.eclipse.stellation.repos.MergeManager.mergeChanges(MergeManager.java:81)
	at org.eclipse.stellation.repos.LocalHandle.realMergeChanges(LocalHandle.java:1700)
	at org.eclipse.stellation.repos.LocalHandle.mergeChanges(LocalHandle.java:1683)
	at org.eclipse.stellation.cli.workspace.Merge.performMerge(Merge.java:123)
	at org.eclipse.stellation.cli.workspace.Merge.command(Merge.java:64)
	at org.eclipse.stellation.cli.workspace.Svc.command(Svc.java:106)
	at org.eclipse.stellation.cli.workspace.Svc.run(Svc.java:624)
	at org.eclipse.stellation.cli.workspace.Svc.main(Svc.java:377)

Looking at the code for BranchSpecSet.addAll and
LocalHandle.nearestCommonAncestor, it looks as though it tries to get
a set of ancestors for the main branch and doesn't, thus leading to
the NullPointException.  A full debug tracing is below, including a
few logging statements I added to the classes involved.

483 [main] DEBUG org.eclipse.stellation.cli.data.DirectoryBranchImage  - DirectoryBranchImage: initializing with root =null
486 [main] DEBUG org.eclipse.stellation.cli.io.DirectoryInput  - directory input compressed false
487 [main] DEBUG org.eclipse.stellation.cli.io.DirectoryInput  -  directory input /home/jhoward/temp/SVC/Content/0/tmp_branch1
565 [main] DEBUG org.eclipse.stellation.repos.Handle  - NCA of branchspec jhoward-sandbox.3 and branch with parents [main.0]
568 [main] DEBUG org.eclipse.stellation.repos.Handle  - NCA of branchspec jhoward-sandbox.3 and parents [main.0]
582 [main] DEBUG org.eclipse.stellation.repos.HistoryCacheImpl  - Entered HistoryCacheImpl.getAllParents.
583 [main] DEBUG org.eclipse.stellation.repos.HistoryCacheImpl  - BranchSpec version = main.0
583 [main] DEBUG org.eclipse.stellation.repos.HistoryCacheImpl  - Entered getImmediateParents.
583 [main] DEBUG org.eclipse.stellation.repos.HistoryCacheImpl  -
History map: {jhoward-sandbox.3=[jhoward-sandbox.2],
jhoward-sandbox.2=[jhoward-sandbox.1],
jhoward-sandbox.1=[jhoward-sandbox.0], jhoward-sandbox.0=[main.0],
weatherend-sandbox.0=[main.0]}

Here's one I added.  Understandably, getImmediateParents does not have
a parent listed for main.0, which has no parent, so null is returned.
That null leads to the NPE.

584 [main] DEBUG org.eclipse.stellation.repos.HistoryCacheImpl  - Immediate parents: null
593 [main] DEBUG org.eclipse.stellation.cli.data.Connection  - disconnecting from access point
601 [main] DEBUG org.eclipse.stellation.cli.workspace.Workspace  - workspace closed
Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.stellation.repos.util.BranchSpecSet.addAll(BranchSpecSet.java:95)
	at org.eclipse.stellation.repos.LocalHandle.nearestCommonAncestor(LocalHandle.java:1832)
	at org.eclipse.stellation.repos.LocalHandle.nearestCommonAncestor(LocalHandle.java:1755)
	at org.eclipse.stellation.repos.MergeManager.mergeChanges(MergeManager.java:81)
	at org.eclipse.stellation.repos.LocalHandle.realMergeChanges(LocalHandle.java:1700)
	at org.eclipse.stellation.repos.LocalHandle.mergeChanges(LocalHandle.java:1683)
	at org.eclipse.stellation.cli.workspace.Merge.performMerge(Merge.java:123)
	at org.eclipse.stellation.cli.workspace.Merge.command(Merge.java:64)
	at org.eclipse.stellation.cli.workspace.Svc.command(Svc.java:106)
	at org.eclipse.stellation.cli.workspace.Svc.run(Svc.java:624)
	at org.eclipse.stellation.cli.workspace.Svc.main(Svc.java:377)


Am I right that there is a bug in how merges onto the main branch
revision 0 are made, or am I mistaken about how the merge command
operates?  

Thanks,
Jeffrey




Back to the top