Skip to content

Commit

Permalink
Make exceptions public top-level classes (jgrapht#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell authored Mar 15, 2021
1 parent 5cbf13b commit 6ad6394
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 28 deletions.
16 changes: 0 additions & 16 deletions jgrapht-core/src/main/java/org/jgrapht/graph/GraphWalk.java
Original file line number Diff line number Diff line change
Expand Up @@ -527,19 +527,3 @@ public static <V, E> GraphWalk<V, E> singletonWalk(Graph<V, E> graph, V v, doubl
}

}

/**
* Exception thrown in the event that the path is invalid.
*/
class InvalidGraphWalkException
extends
RuntimeException
{
private static final long serialVersionUID = 3811666107707436479L;

public InvalidGraphWalkException(String message)
{
super(message);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* (C) Copyright 2017-2021, by Joris Kinable and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* See the CONTRIBUTORS.md file distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the
* GNU Lesser General Public License v2.1 or later
* which is available at
* http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html.
*
* SPDX-License-Identifier: EPL-2.0 OR LGPL-2.1-or-later
*/
package org.jgrapht.graph;

/**
* Exception thrown in the event that the path is invalid.
*/
public class InvalidGraphWalkException
extends
RuntimeException
{
private static final long serialVersionUID = 3811666107707436479L;

public InvalidGraphWalkException(String message)
{
super(message);
}

}
37 changes: 37 additions & 0 deletions jgrapht-core/src/main/java/org/jgrapht/util/SupplierException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* (C) Copyright 2021-2021, by Hannes Wellmann and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* See the CONTRIBUTORS.md file distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the
* GNU Lesser General Public License v2.1 or later
* which is available at
* http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html.
*
* SPDX-License-Identifier: EPL-2.0 OR LGPL-2.1-or-later
*/
package org.jgrapht.util;

import java.util.function.*;

/**
* Exception thrown to indicate that a {@link Supplier} is in an invalid state.
*
* @author Hannes Wellmann
*/
public class SupplierException
extends
IllegalArgumentException
{
private static final long serialVersionUID = -8192314371524515620L;

public SupplierException(String message, Throwable cause)
{
super(message, cause);
}
}
12 changes: 0 additions & 12 deletions jgrapht-core/src/main/java/org/jgrapht/util/SupplierUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,4 @@ Object writeReplace()
return new SerializedForm<>(constructor.getDeclaringClass());
}
}

static class SupplierException
extends
IllegalArgumentException
{
private static final long serialVersionUID = -8192314371524515620L;

public SupplierException(String message, Throwable cause)
{
super(message, cause);
}
}
}

0 comments on commit 6ad6394

Please sign in to comment.