Hi,

Lambda is deceptively lightweight. It seems like a straightforward operation but
the real implementation is more costly than one might expect.
There are other cases where the implementation doesn't match the appearance, for example, who pays any attention to the fact that String in switch creates an extra inner class.

Roger


On 3/7/2014 3:19 PM, Mandy Chung wrote:
On 3/7/14 7:03 AM, Sergey Bylokhov wrote:
Is this absolutely necessary? Does it mean that Get**Actions are deprecated now?

The question should be whether this dependency is absolutely necessary and it's not. Get**Action classes are simple convenient classes that you could either use lambda or implement your own one. AWT and other client code in the JDK is another heavy user of sun.security.action that you can consider simply have your own convenient class as module-private API. If sun.security.action were private to the security library, they would not be used in the client code in the first place (there are external code depending on it too [1 for example]). Now we are retrofitting and eliminate unnecessary dependency.

Mandy
[1] http://grepcode.com/file/repo1.maven.org/maven2/com.googlecode.streamflyer-regex-fast/streamflyer-regex-fast/1.0.1/com/googlecode/streamflyer/regex/fast/PatternSyntaxException.java#PatternSyntaxException.0nl

Reply via email to