Dear Ptolemy-hackers,
I am trying to use the FilePortParameter and I had some problem, When I call a asFile() http://chess.eecs.berkeley.edu/ptexternal/src/ptII/doc/codeDoc/ptolemy/actor/parameters/FilePortParameter.html#asFile() on an FilePortParameter which has not been used by the user I get a nullPointerException, while in the doc it says that it should return null. My guess is that there is a bug in the FilePortParameter.java and the following patch fixes my problem.

[EMAIL PROTECTED]:~/projects/opal/kepler/ptII$ svn diff ptolemy/actor/parameters/FilePortParameter.java Index: ptolemy/actor/parameters/FilePortParameter.java
===================================================================
--- ptolemy/actor/parameters/FilePortParameter.java     (revision 49987)
+++ ptolemy/actor/parameters/FilePortParameter.java     (working copy)
@@ -277,6 +277,7 @@

        try {
            File file = FileUtilities.nameToFile(name, getBaseDirectory());
+            if ( file == null ) return null;

            if ((file.toString().indexOf("!/") != -1)
                    || (file.toString().indexOf("!\\") != -1)) {




Please let me know if I am wrong or I am missing something,
Luca

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to