// Path: trip/Main.java
// static void error(String format, Object... args) {
//     throw new IllegalArgumentException(String.format(format, args));
// }


import static trip.Main.error;
package trip;


/** Represents a road between two Locations.
 *  @author P. N. Hilfinger
 */
class Road {

    /** A Road whose name is NAME, going in DIRECTION, and of given
     *  LENGTH. */
    Road(String name, Direction direction, double length) {
        if (length < 0) {
// Path: trip/Main.java
// static void error(String format, Object... args) {
//     throw new IllegalArgumentException(String.format(format, args));
// }


// Path: trip/Road.java
import static trip.Main.error;

package trip;


/** Represents a road between two Locations.
 *  @author P. N. Hilfinger
 */
class Road {

    /** A Road whose name is NAME, going in DIRECTION, and of given
     *  LENGTH. */
    Road(String name, Direction direction, double length) {
        if (length < 0) {
            error("Road %s given negative length.", length);