sbmlteam / jsbml

JSBML is a community-driven project to create a free, open-source, pure Java™ library for reading, writing, and manipulating SBML files (the Systems Biology Markup Language) and data streams. It is an alternative to the mixed Java/native code-based interface provided in libSBML.

Home Page:https://sbml.org/software/jsbml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Removing objectives from a model is not sensitive for removal of the active objective

Schmoho opened this issue · comments

Test to reproduce:

   @Test
    public void test() {
        var m = new Model(3,2);
        var fbcPlugin = (FBCModelPlugin) m.getPlugin(FBCConstants.shortLabel);

        var o1 = fbcPlugin.createObjective("obj1");
        fbcPlugin.setActiveObjective(o1);

        fbcPlugin.getListOfObjectives().removeAll(fbcPlugin.getListOfObjectives());

        assertTrue(fbcPlugin.isSetActiveObjective());
        assertEquals("obj1", fbcPlugin.getActiveObjective());
        assertEquals(0, fbcPlugin.getObjectiveCount());
    }