Issue #6587 has been updated by Christopher Brooks.

% Done changed from 0 to 90

We now print the missing classes to stdout.  

MessageHandler can have selectable text if you invoke 
MessageHandler.warning(String, Throwable) and click on the Stack Trace button.  
However, in general, we don't call MessageHandler.warning(), we throw an 
exception instead.  See bug #4147 "Error message with selectable text" for 
details.

I don't think we want to use MessageHandler.warning() here because it brings up 
yet another dialog to click through when there is a missing class or classes.  
So, I stuck with printing to stderr.  If a dialog is really wanted, then 
perhaps MoMLParser could check for a property being set before calling 
MessageHandler?  Maybe

if (!StringUtilities.getProperty("KEPLER").equals("")) {
  MessageHandler.warning("Missing Classes", new Exception(warning.toString())); 
 
}

A couple of changes I made to the patch:
1) Use a HashSet so that missing classes appear only once
2) Added a private method to add classes to the Set of missing classes so that 
we can call this from multiple places.

The guts of the code look like:

        // See https://projects.ecoinformatics.org/ecoinfo/issues/6587: 
summarize missing actors       
        if (_missingClasses != null) {
            StringBuffer warning = new StringBuffer();
            for(String missingClass : _missingClasses) {
                warning.append(missingClass + ", ");
            }
            // Get rid of the trailing comma and space.                         
                       
            warning.delete(warning.length()-2, warning.length());

            // Adding another dialog is annoying, so we print out the warning.  
                       
            System.err.println("Warning: Missing Classes: " + warning);

            // MessageHandler(String) is not selectable, so we use 
MessageHandler(String, Throwable).  
            //MessageHandler.warning("Missing Classes", new 
Exception(warning.toString()));            
        }

The ptII repo change is r69837.

I'm leaving this for Dan to close if he thinks it is closeable.

----------------------------------------
Feature #6587: summarize missing actors
https://projects.ecoinformatics.org/ecoinfo/issues/6587#change-21786

* Author: Daniel Crawl
* Status: New
* Priority: Normal
* Assignee: Daniel Crawl
* Category: general
* Target version: 2.5.0
* Bugzilla-Id: 
----------------------------------------
If a workflow is opened that contains actors that are not present in the class 
path, an error dialog is displayed for each actor. It would be nice if a list 
of all the missing actors were displayed.

Attached is a modified MoMLParser.java (based on ptolemy-kepler-2.4 sources) 
from Philippe Huyhn that displays the missing actors. The list of missing 
actors is written to stdout. Using MessageHandler would be preferred since it 
displays a dialog, but MessageHandler appears to not allow copy and paste.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
https://projects.ecoinformatics.org/ecoinfo/my/account

_______________________________________________
Kepler-dev mailing list
[email protected]
http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev

Reply via email to