Object data = type.getData(); if( null != data ) { if( data instanceof Strategy ) { return (Strategy) data; } else { final String error = "Datatype associated as the 'part' datastructure is not an instance of " + Strategy.class.getName() + "." + "\nClass " + type.getClass().getName(); throw new BuildException( error, getLocation() ); } } else { final String error = "No data associated with part declaration." + "\nResource: " + resource + "\nType: " + TYPE; throw new BuildException( error, getLocation() ); }
final String error = "No data associated with part declaration." + "\nResource: " + resource + "\nType: " + TYPE; throw new BuildException( error, getLocation() );
    protected Strategy getStrategy( Resource resource )    {        if( null == m_strategy )        {            Type type = resource.getType( TYPE );            if( type instanceof Strategy )            {                return (Strategy) type;            }            else            {                Object data = type.getData();                if( null != data )                {                    if( data instanceof Strategy )                    {                        return (Strategy) data;                    }                    else                    {                        final String error =                          "Datatype associated as the 'part' datastructure is not an instance of "                          + Strategy.class.getName() + "."                          + "\nClass " + type.getClass().getName();                        throw new BuildException( error, getLocation() );                    }                }                else                {                    final String error =                       "No data associated with part declaration."                      + "\nResource: " + resource                      + "\nType: " + TYPE;                    throw new BuildException( error, getLocation() );                }            }        }        else        {            return m_strategy;        }    }