Skip to main content

DocumentOperation behaves differently when deployed

Comments

2 comments

  • Stephan Janosch

    Hah! I found the culprit! In plugin form, Geneious does not set the options properly. Check out the screen shot!

    The same code on the produces different results. Then I tried something. REMOVING the ASSERTIONS. 

    Now it looks like that:

    primerOperationOptions.setStringValue("taskOptions.chooser", "designNewOptions");
    primerOperationOptions.setStringValue("taskOptions.designNewOptions.oligosToPickOptions.forwardOption", "true");
    primerOperationOptions.setStringValue("taskOptions.designNewOptions.oligosToPickOptions.reverseOption", "true");
    primerOperationOptions.setStringValue("taskOptions.designNewOptions.oligosToPickOptions.probeOption", "false");

    primerOperationOptions.setStringValue("panelForRegionType.designRegionTypeOption", "genericOptionValue");
    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.enableIncludedRegionOption", "false");

    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.enableTargetRegionOption", "true");
    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.targetRegionFromOption", fromPosition);
    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.targetRegionToOption", toPosition);

    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.enableProductSizeOption", "true");
    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.productSizeFromOption", options.getValueAsString("productSizeFromOption"));
    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.productSizeToOption", options.getValueAsString("productSizeToOption"));

    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.enableOptimalProductSizeOption", "false");
    primerOperationOptions.setStringValue("panelForRegionType.genericRegionOptions.numPairsOption", "1");

    And voila, it works! 

    Case is closed. I will check my other plugin now ASAP!

    *happy*
    Stephan

    BTW> I don't understand right now, why the assert keyword makes a difference there. I am not a java expert to understand the difference with and without _assert_.

     

     

    0
  • Matthew Cheung

    Oh! That explains it.  Sorry I should have caught that when looking at your other plugin.

    You've got actual production code in your assertions.  Assertions in Java only run when you give the JVM the flag -ea i.e. enable assertions.  So those assert lines weren't being run at all.

    We do this in the IDE projects we provide with the development kit because that's how we set up the project internally ourselves too.  But we don't enable assertions for distributions to avoid causing crashes for our users in case the assertions are wrong.  We treat them as a tool for use during development.

    Hope that explains things.

    Cheers,
    Matthew

    0

Please sign in to leave a comment.