File tree Expand file tree Collapse file tree
beam/tools/src/main/java/cz/o2/proxima/beam/tools/groovy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747import java .util .Collections ;
4848import java .util .List ;
4949import java .util .Map ;
50+ import java .util .Objects ;
5051import java .util .Optional ;
5152import java .util .function .Supplier ;
5253import java .util .stream .Collectors ;
@@ -274,7 +275,17 @@ private Collection<URI> getAddedJars() {
274275 .map (
275276 l ->
276277 l .getDefinedClasses ().stream ()
277- .map (name -> ExceptionUtils .uncheckedFactory (() -> loader .loadClass (name )))
278+ .map (
279+ name -> {
280+ try {
281+ return ExceptionUtils .uncheckedFactory (
282+ () -> loader .loadClass (name ));
283+ } catch (Exception ex ) {
284+ log .warn ("Failed to find class {}. Skipping." , name , ex );
285+ return null ;
286+ }
287+ })
288+ .filter (Objects ::nonNull )
278289 .map (cls -> Pair .of (cls , loader .getClassByteCode (cls .getName ())))
279290 .collect (Collectors .toMap (Pair ::getFirst , Pair ::getSecond )))
280291 .orElse (Collections .emptyMap ());
You can’t perform that action at this time.
0 commit comments