private Route calculateRoute(Class<?> sourceType, Class<?> targetType) { Route match = buildInitialRoutes(sourceType, targetType); if (match != null) { return match; } while (!candidates.isEmpty() && !routes.isEmpty()) { Route route = getShortestRoute(); for (ContentTypeConverter candidate : new HashSet<>(candidates)) { if (route.endPoint().equals(candidate.expectedSourceType())) { Route newRoute = route.joinedWith(candidate); candidates.remove(candidate); if (targetType.equals(newRoute.endPoint())) { return newRoute; } routes.add(newRoute); } } routes.remove(route); } return null; }
private Route calculateRoute(Class<?> sourceType, Class<?> targetType) { Route match = buildInitialRoutes(sourceType, targetType); if (match != null) { return match; } while (!candidates.isEmpty() && !routes.isEmpty()) { Route route = getShortestRoute(); for (ContentTypeConverter candidate : new HashSet<>(candidates)) { if (route.endPoint().equals(candidate.expectedSourceType())) { Route newRoute = route.joinedWith(candidate); candidates.remove(candidate); if (targetType.equals(newRoute.endPoint())) { return newRoute; } routes.add(newRoute); } } routes.remove(route); } return null; }
private Route calculateRoute(Class<?> sourceType, Class<?> targetType) { Route match = buildInitialRoutes(sourceType, targetType); if (match != null) { return match; } while (!candidates.isEmpty() && !routes.isEmpty()) { Route route = getShortestRoute(); for (ContentTypeConverter candidate : new HashSet<>(candidates)) { if (route.endPoint().equals(candidate.expectedSourceType())) { Route newRoute = route.joinedWith(candidate); candidates.remove(candidate); if (targetType.equals(newRoute.endPoint())) { return newRoute; } routes.add(newRoute); } } routes.remove(route); } return null; }