private void addOneshotEntries(List<WebService<?>> services, JMenu menu)
{
- services.sort(Comparator
- .<WebService<?>, String> comparing(s -> s.getUrl().toString())
- .thenComparing(WebService::getName));
+ // Workaround. Comparator methods not working in j2s
+ services.sort((ws1, ws2) -> {
+ var res = ws1.getUrl().toString().compareTo(ws2.getUrl().toString());
+ if (res == 0)
+ res = ws1.getName().compareTo(ws2.getName());
+ return res;
+ });
URL lastHost = null;
for (WebService<?> service : services)
{
private void buildAlternativesMenu(List<WebService<?>> services)
{
var menu = alternativesMenu;
- services.sort(Comparator
- .<WebService<?>, String> comparing(s -> s.getUrl().toString())
- .thenComparing(s -> s.getName()));
+ services.sort((ws1, ws2) -> {
+ var res = ws1.getUrl().toString().compareTo(ws2.getUrl().toString());
+ if (res == 0)
+ res = ws1.getName().compareTo(ws2.getName());
+ return res;
+ });
URL lastHost = null;
for (var service : services)
{