Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ public static <T> TupleDomain<T> intersect(List<? extends TupleDomain<? extends
}

@SuppressWarnings("unchecked")
private static <U, T extends U> TupleDomain<U> upcast(TupleDomain<T> domain)
private static <T> TupleDomain<T> upcast(TupleDomain<? extends T> domain)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a correct simplification.
Was the original code an incorrect Java, according to JLS?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler complained about the usage:

The method upcast(TupleDomain<T>) in the type TupleDomain<T> is not applicable for the arguments (capture#20-of ? extends TupleDomain<? extends T>)

so it couldn't infer the U type, I'm not sure, if ECJ is too limited, or Javac is more lazy in this case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this particular change. In the past, I've seen ECJ having problems where it shouldn't. I don't have any recent experience with this compiler.
Is there any reason you want to use ECJ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because this is what Eclipse is using,and a bit annoying that I can't start the app, without fixing the errors 😉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible to configure Eclipse to use javac as a compiler?

{
// TupleDomain<T> is covariant with respect to T (because it's immutable), so it's a safe operation
return (TupleDomain<U>) domain;
return (TupleDomain<T>) domain;
}

@SafeVarargs
Expand Down