comparison dwt/program/Program.d @ 239:43b41c7fe84a

work on allow null strings and arrays
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Jun 2008 16:27:36 +0200
parents 36f5cb12e1a2
children fd9c62a2998e
comparison
equal deleted inserted replaced
238:efe25e7c8a96 239:43b41c7fe84a
72 * this method returns an appropriate result. 72 * this method returns an appropriate result.
73 * 73 *
74 * @param extension the program extension 74 * @param extension the program extension
75 * @return the program or <code>null</code> 75 * @return the program or <code>null</code>
76 * 76 *
77 * @exception IllegalArgumentException <ul>
78 * <li>ERROR_NULL_ARGUMENT when extension is null</li>
79 * </ul>
80 */ 77 */
81 public static Program findProgram (String extension) { 78 public static Program findProgram (String extension) {
82 if (extension is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 79 // DWT extension: allow null string
80 //if (extension is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
83 if (extension.length is 0) return null; 81 if (extension.length is 0) return null;
84 if (extension.charAt (0) !is '.') extension = "." ~ extension; //$NON-NLS-1$ 82 if (extension.charAt (0) !is '.') extension = "." ~ extension; //$NON-NLS-1$
85 /* Use the character encoding for the default locale */ 83 /* Use the character encoding for the default locale */
86 TCHAR[] key = StrToTCHARs (0, extension, true); 84 TCHAR[] key = StrToTCHARs (0, extension, true);
87 Program program = null; 85 Program program = null;