@Test public void shouldConsiderAsNormalizedAnAbsolutePathWithParentSegmentAtFront() { parent = path("/../a/b"); path = new ChildPath(parent, segment("c")); assertThat(path.isNormalized(), is(false)); }
@Override public boolean isNormalized() { if (child.isSelfReference()) return false; if (!parent.isNormalized()) return false; if (!child.isParentReference()) return true; for (Path.Segment segment : parent) { if (!segment.isParentReference()) return false; } return true; }
ChildPath extends AbstractPath { @Override public boolean isNormalized() { if (child.isSelfReference()) return false; if (!parent.isNormalized()) return false; if (!child.isParentReference()) return true; for (Path.Segment segment : parent) { if (!segment.isParentReference()) return false; } return true; } }
ChildPath extends AbstractPath { @Override public boolean isNormalized() { if (child.isSelfReference()) return false; if (!parent.isNormalized()) return false; if (!child.isParentReference()) return true; for (Path.Segment segment : parent) { if (!segment.isParentReference()) return false; } return true; } ChildPath( Path parent,
                      Path.Segment child ); }
ChildPath extends AbstractPath { @Override public boolean isNormalized() { if (child.isSelfReference()) return false; if (!parent.isNormalized()) return false; if (!child.isParentReference()) return true; for (Path.Segment segment : parent) { if (!segment.isParentReference()) return false; } return true; } ChildPath( Path parent,
                      Path.Segment child ); @Override Path getAncestor( int degree ); @Override Segment getLastSegment(); @Override Path getParent(); @Override Segment getSegment( int index ); @Override List<Segment> getSegmentsList(); @Override boolean hasSameAncestor( Path that ); @Override boolean isAbsolute(); @Override boolean isAtOrBelow( Path other ); @Override boolean isDescendantOf( Path ancestor ); @Override boolean isNormalized(); @Override boolean isRoot(); @Override @SuppressWarnings( "synthetic-access" ) Iterator<Segment> iterator(); @Override int size(); @Override Path subpath( int beginIndex,
                         int endIndex ); }
ChildPath extends AbstractPath { @Override public boolean isNormalized() { if (child.isSelfReference()) return false; if (!parent.isNormalized()) return false; if (!child.isParentReference()) return true; for (Path.Segment segment : parent) { if (!segment.isParentReference()) return false; } return true; } ChildPath( Path parent,
                      Path.Segment child ); @Override Path getAncestor( int degree ); @Override Segment getLastSegment(); @Override Path getParent(); @Override Segment getSegment( int index ); @Override List<Segment> getSegmentsList(); @Override boolean hasSameAncestor( Path that ); @Override boolean isAbsolute(); @Override boolean isAtOrBelow( Path other ); @Override boolean isDescendantOf( Path ancestor ); @Override boolean isNormalized(); @Override boolean isRoot(); @Override @SuppressWarnings( "synthetic-access" ) Iterator<Segment> iterator(); @Override int size(); @Override Path subpath( int beginIndex,
                         int endIndex );  }