Changeset 13006 for trunk/abcl/src/org/armedbear
- Timestamp:
- 11/06/10 08:58:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Pathname.java
r12974 r13006 937 937 938 938 public static boolean isValidURL(String s) { 939 // On Windows, the scheme "[A-Z]:.*" is ambiguous; reject as urls 940 // This special case reduced exceptions while compiling Maxima by 90%+ 941 if (Utilities.isPlatformWindows && s.length() >= 2 && s.charAt(1) == ':') { 942 char c = s.charAt(0); 943 if (('A' <= s.charAt(0) && s.charAt(0) <= 'Z') 944 || ('a' <= s.charAt(0) && s.charAt(0) <= 'z')) 945 return false; 946 } 947 948 if (s.indexOf(':') == -1) // no schema separator; can't be valid 949 return false; 950 939 951 try { 940 952 URL url = new URL(s); 941 953 } catch (MalformedURLException e) { 954 // Generating an exception is a heavy operation, 955 // we want to try hard not to get into this branch, without 956 // implementing the URL class ourselves 942 957 return false; 943 958 }
Note: See TracChangeset
for help on using the changeset viewer.