NullPointerException, when using org.tmatesoft.svn.core.wc2.SvnMerge.setSources

There are two methods to fill the Source(s) for a SvnMerge-Operation:
org.tmatesoft.svn.core.wc2.SvnMerge.setSources
org.tmatesoft.svn.core.wc2.SvnMerge.setSources

The second method fails with a NullPointerException since svnkit 1.10.2


Sample code:
String path = “C:\sample”;
Strign fromUrl = “https://sample/svn/reposXXX/sample”;
Strign toUrl = “https://sample/svn/reposXXX/sample”;
long fromRev = 123456;

SVNClientManager thisClientManager = …
SVNDiffClient client = thisClientManager.getDiffClient();
SvnMerge merge = client.getOperationsFactory().createMerge();
SVNDiffOptions diffOptions = new SVNDiffOptions();
merge.setMergeOptions(diffOptions);
merge.setAllowMixedRevisions(true);
merge.addTarget(SvnTarget.fromFile(path));
merge.setDepth(SVNDepth.INFINITY);
merge.setIgnoreAncestry(true);
merge.setForce(false);
merge.setDryRun(true);
merge.setRecordOnly(false);
merge.setSources(SvnTarget.fromURL(SVNURL.parseURIEncoded(fromUrl), SVNRevision.create(fromRev)), SvnTarget.fromURL(SVNURL.parseURIEncoded(toUrl),SVNRevision.HEAD));


Stack-Trace:
at org.tmatesoft.svn.core.wc2.SvnMerge.getRevisionRanges(SvnMerge.java:207)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgMerge.isApplicable(SvnNgMerge.java:37)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgMerge.isApplicable(SvnNgMerge.java:30)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.getImplementation(SvnOperationFactory.java:1365)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1227)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)


Failing code:

public Collection getRevisionRanges() {
if (ranges == null && EMULATE_AUTOMATIC_MERGE) {
SvnTarget source = getSource();
SVNRevision startRevision = SVNRevision.create(1);
SVNRevision endRevision = source.getPegRevision();
if (endRevision == null || endRevision == SVNRevision.UNDEFINED) {
endRevision = source.isURL() ? SVNRevision.HEAD : SVNRevision.WORKING;
}
final List revisionRanges = new ArrayList();
revisionRanges.add(SvnRevisionRange.create(startRevision, endRevision));
return revisionRanges;
}
return ranges;
}

The folling line above causes the NullPointerException

SVNRevision endRevision = source.getPegRevision();

source is null in this case (this is permitted because firstSource and secondSource are set)

correction: svnkit 1.10.2 does not cause the NullPointerException
Any version >= 1.10.3 (including trunk) causes the NullPointerException

Maybe my post was a bit to hasty:
whenI adding the following code it does what I want and there is no NPE:

merge.addRevisionRange(SvnRevisionRange.create(SVNRevision.create(fromRev), SVNRevision.HEAD));

so I’m not sure this is a bug.