Buggy code:
public class MergedRestriction extends Intersection { private class SafeIterator implements Iterator { Iterator it ; SafeIterator ( Iterator it ) { } public boolean hasNext ( ) { } public Object next ( ) { } public void remove ( ) { } } public static final int allValuesFromID = 0 ; public static final int someValuesFromID = 1 ; public static final int hasValueID = 2 ; public static final int boundingValueID = 3 ; public static final int minCardinalityID = 4 ; public static final int maxCardinalityID = 5 ; public static final int exactCardinalityID = 6 ; private int [ ] index = new int [ 7 ] ; private String onProperty = null ; public MergedRestriction ( ) { } public MergedRestriction ( String onProperty ) { } public MergedRestriction ( String onProperty , ArrayList restrictions ) { } public static final MergedRestriction getPropertyBanningRestriction ( String propURI ) { } public static final MergedRestriction getFixedValueRestriction ( String propURI , Object o ) { } public static final MergedRestriction getCardinalityRestriction ( String propURI , int min , int max ) { } public static final MergedRestriction getAllValuesRestrictionWithCardinality ( String propURI , String typeURI , int min , int max ) { } public static final MergedRestriction getAllValuesRestriction ( String propURI , String typeURI ) { } public static final MergedRestriction getAllValuesRestrictionWithCardinality ( String propURI , ClassExpression expr , int min , int max ) { } public static ArrayList getFromList ( List o ) { } public void reset ( ) { } public int getMinCardinality ( ) { } public int getMaxCardinality ( ) { } public Object getConstraint ( int id ) { } public void setRestrictions ( String onProperty , ArrayList restrictions ) { } public List getRestrictions ( ) { } private void removeRestriction ( int id ) { } public AbstractRestriction getRestriction ( int id ) { } public MergedRestriction addRestriction ( AbstractRestriction res ) { } public MergedRestriction addRestriction ( MergedRestriction r ) { } private int getIndex ( AbstractRestriction res ) { } private void analyze ( ) { } public ClassExpression copy ( ) { } public MergedRestriction copyWithNewCardinality ( int min , int max ) { } public MergedRestriction copyOnNewProperty ( String onProp ) { } public boolean isWellFormed ( ) { } public void setProperty ( String propURI , Object o ) { } public Iterator types ( ) { } public String getPropTypeURI ( ) { } public String getOnProperty ( ) { } public MergedRestriction appendTo ( MergedRestriction root , String [ ] path ) { if ( ( path == null ) || ( ( path . length ) == 0 ) ) return null ; if ( ( getOnProperty ( ) ) == null ) return null ; if ( ! ( getOnProperty ( ) . equals ( path [ ( ( path . length ) - 1 ) ] ) ) ) return null ; if ( ( path . length ) == 1 ) if ( root == null ) { return this ; } else { root . addRestriction ( this ) ; return root ; } if ( root == null ) { <START_BUG> root = new MergedRestriction ( this . getOnProperty ( ) ) ; <END_BUG> AbstractRestriction r = new AllValuesFromRestriction ( ) ; r . setProperty ( PROP_OWL_ON_PROPERTY , path [ 0 ] ) ; root . addRestriction ( r ) ; } else { if ( ! ( root . getOnProperty ( ) . equals ( path [ 0 ] ) ) ) return null ; } AbstractRestriction tmp = root . getRestriction ( MergedRestriction . allValuesFromID ) ; if ( tmp == null ) { tmp = new AllValuesFromRestriction ( ) ; tmp . setOnProperty ( path [ 0 ] ) ; root . addRestriction ( tmp ) ; } for ( int i = 1 ; i < ( ( path . length ) - 1 ) ; i ++ ) tmp = tmp . getRestrictionOnProperty ( path [ i ] ) ; ClassExpression all = ( ( ClassExpression ) ( getConstraint ( MergedRestriction . allValuesFromID ) ) ) ; if ( ! ( all instanceof Intersection ) ) { Intersection i = new Intersection ( ) ; if ( all != null ) i . addType ( all ) ; tmp . changeProperty ( PROP_OWL_ALL_VALUES_FROM , i ) ; all = i ; } Intersection isec = ( ( Intersection ) ( all ) ) ; for ( int i = 0 ; i < ( types . size ( ) ) ; i ++ ) isec . addType ( ( ( ClassExpression ) ( types . get ( i ) ) ) ) ; return root ; } public MergedRestriction getRestrictionOnPath ( String [ ] path ) { } private MergedRestriction getRestrictionOnPathElement ( String pathElement ) { } public Object [ ] getEnumeratedValues ( ) { } public MergedRestriction merge ( MergedRestriction other ) { } public boolean hasMemberIgnoreCardinality ( Object o ) { } }

Fix:
root = new MergedRestriction ( path [ 0 ] ) ;