Buggy code:
public class DisplayHierarchyNode { public static final String SORT_BY_FORMAT = "%1$s%2$s" ; public static final int MAX_RELATED_LINK_LABEL_LENGTH = 30 ; private PropertyPath pathTo ; private Set < PropertyPath > explicitPaths = new HashSet < PropertyPath > ( ) ; private DisplayHierarchyNode parent ; DisplayRdfNode rdfNode ; private List < DisplayHierarchyNode > children = new ArrayList < DisplayHierarchyNode > ( ) ; private List < DisplayHierarchyNode > siblings = new ArrayList < DisplayHierarchyNode > ( ) ; private List < String > hints = new ArrayList < String > ( ) ; private ShortNameRenderer shortNameRenderer ; public DisplayHierarchyNode ( PropertyPath pathTo , DisplayHierarchyNode parent , DisplayRdfNode rdfNode , ShortNameRenderer shortNameRenderer ) { } public PropertyPath pathTo ( ) { } public RDFNodeWrapper terminalLink ( ) { } public boolean isOnExplicitPath ( ) { } public Set < PropertyPath > explicitPaths ( ) { } public DisplayHierarchyNode parent ( ) { } public boolean isRoot ( ) { } public DisplayRdfNode rdfNode ( ) { } public boolean isLoop ( ) { } public boolean findAncestor ( DisplayRdfNode resource ) { } public boolean isLeaf ( DisplayHierarchyContext context ) { } public List < DisplayHierarchyNode > children ( ) { } public void addSibling ( DisplayHierarchyNode sibling ) { } public List < DisplayHierarchyNode > siblings ( ) { } public boolean hasSiblings ( ) { } public void addHint ( String hint ) { } public String hintsString ( ) { } public boolean hasHint ( String hint ) { } public boolean isSimpleResource ( ) { } public String relatedLinksHTML ( ) { } public List < Link > relatedLinks ( ) { } public boolean hasAllProperties ( Object ... properties ) { } public boolean hasAllProperties ( List < Object > properties ) { } public void pullToStart ( Object ... properties ) { } public void pullToStart ( List < Object > properties ) { } public List < DisplayHierarchyNode > extractByPredicate ( Object ... properties ) { } public List < DisplayHierarchyNode > extractByPredicate ( List < Object > properties ) { } public boolean isResource ( ) { } public boolean isLiteral ( ) { } public boolean isAnon ( ) { } public boolean isList ( ) { } public String getLexicalForm ( ) { } public String getName ( ) { } public Object getValue ( ) { } public String getURI ( ) { } protected Link generateLink ( String paramName , String paramNameLabel , String paramValue , String paramValueLabel , String rel , String hint , boolean set , Page page ) { OPERATION op = ( set ) ? OPERATION . SET : OPERATION . ADD ; String linkIcon = "fa-plus-circle" ; <START_BUG> EldaURL pageURL = page . pageURL ( ) ; <END_BUG> String prompt = "require<seq2seq4repair_space>" ; String closeQuote = "" ; if ( pageURL . hasParameter ( paramName , paramValue ) ) { op = OPERATION . REMOVE ; linkIcon = "fa-minus-circle" ; prompt = "remove<seq2seq4repair_space><em>'require<seq2seq4repair_space>" ; closeQuote = "'<//em>" ; } return new Link ( String . format ( "<i<seq2seq4repair_space>class='fa<seq2seq4repair_space>%s'><//i><seq2seq4repair_space>%s%s<seq2seq4repair_space>%s<seq2seq4repair_space>%s%s" , linkIcon , prompt , paramNameLabel , rel , paramValueLabel , closeQuote ) , pageURL . withParameter ( op , paramName , paramValue ) , hint ) ; } protected Link generateSortLink ( String paramName , String paramHTML , String hint , boolean asc , Page page ) { } protected int indexOfChildProperty ( Property prop ) { } private String ellipsis = "..." ; private int maxLength = ( DisplayHierarchyNode . MAX_RELATED_LINK_LABEL_LENGTH ) - ( ellipsis . length ( ) ) ; private String truncateToMaxLength ( String s ) { } }

Fix:
EldaURL pageURL = ( page . isItemEndpoint ( ) ) ? page . pageURL ( ) . parentURL ( ) : page . pageURL ( ) ;