I was fishing around looking trying to figure out why Torque won't
maintain a collection of child objects when I have a foreign key to the
same table and found this, probably unrelated, oddity.

Starting at line 511 of
org/apache/torque/engine/database/model/Table.java

   /**
     * Adds a new FK to the FK list and set the
     * parent table of the column to the current table
     *
     * @param fk A foreign key
     */
    public void addForeignKey(ForeignKey fk)
    {
        fk.setTable (this);
        foreignKeys.add(fk);

        if (foreignTableNames == null)
        {
            foreignTableNames = new ArrayList(5);
        }
        if (foreignTableNames.contains(fk.getForeignTableName()))
        {
            foreignTableNames.add(fk.getForeignTableName());
        }
    }

foreignTables is private, and this is the only place that it is added to
Am I losing my mind, or is it impossilble that foreignTableNames will
ever contain anything?
Shouldn't there be a bang in the second if statement????

None of this really matters, since no one is calling the getter for this
member and it's never really referenced from within table, but I thought
I'd bring it up anyhow...

-Gary

PS:  if someone tells me how, I'll fix it myself...

Reply via email to