Bug 118516 [DataBinding] Asserts should provide meaningful messages
Currently we use JDK Assert in various places in the code. However, if an assert fails, there often is no indication of why it failed or what the assert failure means without looking at the code indicated by the stack trace. It would be nicer if we would log exceptions or throw RuntimeExceptions with useful error messages instead.
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.java
/**
	 * Returns a copy of this tree path with one segment removed from the end,
	 * or <code>null</code> if this tree path has no segments.
	 * @return a tree path
	 */
	public TreePath getParentPath() {
		int segmentCount = getSegmentCount();
		if (segmentCount <= 1) {
			return null;
		}
		Object[] parentSegments = new Object[segmentCount - 1];
		System.arraycopy(segments, 0, parentSegments, 0, segmentCount - 1);
		return new TreePath(parentSegments);
	}
	/**
	 * Returns a copy of this tree path with the given segment added at the end.
	 * @param newSegment 
	 * @return a tree path
	 */
	public TreePath createChildPath(Object newSegment) {
		int segmentCount = getSegmentCount();
		Object[] childSegments = new Object[segmentCount + 1];
		if(segmentCount>0) {
			System.arraycopy(segments, 0, childSegments, 0, segmentCount);
		}
		childSegments[segmentCount] = newSegment;
		return new TreePath(childSegments);
	}
}