Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: compiler/java/com/google/dart/compiler/PackageLibraryManager.java

Issue 10919160: Fix PackageLibraryManager set package directory (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.net.URI; 8 import java.net.URI;
9 import java.net.URISyntaxException; 9 import java.net.URISyntaxException;
10 import java.util.ArrayList; 10 import java.util.ArrayList;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 218
219 public List<File> getPackageRoots(){ 219 public List<File> getPackageRoots(){
220 return packageRoots; 220 return packageRoots;
221 } 221 }
222 222
223 223
224 public void setPackageRoots(List<File> roots){ 224 public void setPackageRoots(List<File> roots){
225 if (roots == null || roots.isEmpty()){ 225 if (roots == null || roots.isEmpty()){
226 this.packageRoots = DEFAULT_PACKAGE_ROOTS; 226 roots = DEFAULT_PACKAGE_ROOTS;
227 } else {
228 packageRoots.clear();
229 for (File file : roots){
230 packageRoots.add(file.getAbsoluteFile());
231 }
232 } 227 }
228 packageRoots.clear();
229 for (File file : roots){
230 packageRoots.add(file.getAbsoluteFile());
231 }
233 packageRootsUri.clear(); 232 packageRootsUri.clear();
234 for (File file : roots){ 233 for (File file : roots){
235 packageRootsUri.add(file.toURI()); 234 packageRootsUri.add(file.toURI());
236 } 235 }
237 } 236 }
238 237
239 /** 238 /**
240 * Translate the URI from dart://[host]/[pathToLib] (e.g. dart://html/html.dar t) 239 * Translate the URI from dart://[host]/[pathToLib] (e.g. dart://html/html.dar t)
241 * to a "file:" URI (e.g. "file:/some/install/directory/html.dart") 240 * to a "file:" URI (e.g. "file:/some/install/directory/html.dart")
242 * 241 *
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return SDK_LIBRARY_MANAGER.getAllSystemLibraries(); 312 return SDK_LIBRARY_MANAGER.getAllSystemLibraries();
314 } 313 }
315 314
316 public File getSdkLibPath() { 315 public File getSdkLibPath() {
317 return SDK_LIBRARY_MANAGER.getSdkLibPath(); 316 return SDK_LIBRARY_MANAGER.getSdkLibPath();
318 } 317 }
319 318
320 319
321 320
322 } 321 }
OLDNEW
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/analysis/AnalyzeLibraryTaskTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698