new overload resolution: avoid second conflict resolution for the same conflicts, e.g. because resulted array would be available inside guard of ResolveCache (IDEA-138596)

This commit is contained in:
Anna Kozlova
2015-04-02 17:15:55 +02:00
parent a32b8f4aad
commit c08649b355
3 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import java.util.Arrays;
import java.util.function.Function;
import java.util.stream.Stream;
class CommandTest {
public static class Command {
public String[] getKeywords() { return new String[] {"GET", "PUT", "POST"}; }
public String getDescription() { return "Some HTTP command"; }
}
public static void main(Stream<Command> stream) {
stream.map(cmd -> Arrays.stream(cmd.getKeywords()).map(key -> String.format("%s -> %s", key, cmd.getDescription()))).flatMap(Function.identity());
}
}