comparison graal/com.oracle.max.base/src/com/sun/max/program/Classpath.java @ 4142:bc8527f3071c

Adjust code base to new level of warnings.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 18 Dec 2011 05:24:06 +0100
parents e233f5660da4
children
comparison
equal deleted inserted replaced
4141:04d21be7a24f 4142:bc8527f3071c
358 * 358 *
359 * @param classpath the classpath to prepend to this classpath 359 * @param classpath the classpath to prepend to this classpath
360 * @return the result of prepending {@code classpath} to this classpath 360 * @return the result of prepending {@code classpath} to this classpath
361 */ 361 */
362 public Classpath prepend(Classpath classpath) { 362 public Classpath prepend(Classpath classpath) {
363 ArrayList<Entry> entries = new ArrayList<Entry>(this.entries.size() + classpath.entries.size()); 363 ArrayList<Entry> newEntries = new ArrayList<>(this.entries.size() + classpath.entries.size());
364 entries.addAll(classpath.entries); 364 newEntries.addAll(classpath.entries);
365 entries.addAll(this.entries); 365 newEntries.addAll(this.entries);
366 return new Classpath(entries); 366 return new Classpath(newEntries);
367 } 367 }
368 368
369 /** 369 /**
370 * Gets a new classpath obtained by prepending a given classpath to this class classpath. 370 * Gets a new classpath obtained by prepending a given classpath to this class classpath.
371 * 371 *
372 * @param classpath the classpath to prepend to this classpath 372 * @param classpath the classpath to prepend to this classpath
373 * @return the result of prepending {@code classpath} to this classpath 373 * @return the result of prepending {@code classpath} to this classpath
374 */ 374 */
375 public Classpath prepend(String path) { 375 public Classpath prepend(String path) {
376 ArrayList<Entry> entries = new ArrayList<Entry>(this.entries.size()); 376 ArrayList<Entry> newEntries = new ArrayList<>(this.entries.size());
377 entries.add(createEntry(path)); 377 newEntries.add(createEntry(path));
378 entries.addAll(this.entries); 378 newEntries.addAll(this.entries);
379 return new Classpath(entries); 379 return new Classpath(newEntries);
380 } 380 }
381 381
382 /** 382 /**
383 * Searches for a class file denoted by a given class name on this classpath and returns its contents in a byte array if 383 * Searches for a class file denoted by a given class name on this classpath and returns its contents in a byte array if
384 * found. Any IO exception that occurs when reading is silently ignored. 384 * found. Any IO exception that occurs when reading is silently ignored.