| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package com.google.dart.compiler; | 5 package com.google.dart.compiler; |
| 6 | 6 |
| 7 import java.io.File; | 7 import java.io.File; |
| 8 import java.io.IOException; | 8 import java.io.IOException; |
| 9 import java.net.MalformedURLException; | 9 import java.net.MalformedURLException; |
| 10 import java.net.URI; | 10 import java.net.URI; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (host == null) { | 123 if (host == null) { |
| 124 String spec = uri.getSchemeSpecificPart(); | 124 String spec = uri.getSchemeSpecificPart(); |
| 125 String replacement = expansionMap.get(spec); | 125 String replacement = expansionMap.get(spec); |
| 126 if (replacement != null) { | 126 if (replacement != null) { |
| 127 try { | 127 try { |
| 128 uri = new URI(DART_SCHEME + ":" + replacement); | 128 uri = new URI(DART_SCHEME + ":" + replacement); |
| 129 } catch (URISyntaxException e) { | 129 } catch (URISyntaxException e) { |
| 130 throw new AssertionError(); | 130 throw new AssertionError(); |
| 131 } | 131 } |
| 132 } else { | 132 } else { |
| 133 throw new RuntimeException("Don't know how to expand dart URI: " + uri
); | 133 return null; |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 return uri; | 137 return uri; |
| 138 } | 138 } |
| 139 | 139 |
| 140 /** | 140 /** |
| 141 * Answer <code>true</code> if the specified URI has a "dart" scheme | 141 * Answer <code>true</code> if the specified URI has a "dart" scheme |
| 142 */ | 142 */ |
| 143 public static boolean isDartUri(URI uri) { | 143 public static boolean isDartUri(URI uri) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 if (library != null) { | 305 if (library != null) { |
| 306 defaultLibraries.add(library); | 306 defaultLibraries.add(library); |
| 307 baseFiles[path.ordinal()] = library.getFile(); | 307 baseFiles[path.ordinal()] = library.getFile(); |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 | 311 |
| 312 return defaultLibraries.toArray(new SystemLibrary[defaultLibraries.size()]); | 312 return defaultLibraries.toArray(new SystemLibrary[defaultLibraries.size()]); |
| 313 } | 313 } |
| 314 } | 314 } |
| OLD | NEW |