Re: RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-02 Thread Peter Levart
Hi Henry, Just a hint: Instead of parameterized singleton ProxyClassDumper with static method getInstance(path) which suggests that different ProxyClassDumper instances are returned for different path parameters (which are not), you could create for example: class DumpProxyClassAction

Re: RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-02 Thread Peter Levart
Ah, I see, you want it that way to track that a warning about invalid directory is logged only once. That could be solved with an: private static final ConcurrentMapPath, Path invalidDirs = new ConcurrentHashMap(); ...and then in validateDumpDir: if (invalidDirs.putIfAbsent(path,

Re: RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-02 Thread Remi Forax
On 10/02/2013 07:42 AM, Henry Jen wrote: Remi, Thanks for the review and comments, you have some good points. I am thinking perhaps the dumper class could be used somewhere else given a different path, which is why the directory is used as key to get an instance and injected from caller. As

Re: RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-02 Thread Remi Forax
On 10/02/2013 04:12 PM, Peter Levart wrote: On 10/02/2013 12:19 PM, Remi Forax wrote: final class ProxyClassesDumper { ... private final Path dumpDir; // null if invalid public static ProxyClassesDumper create(String dir) { dir = dir.trim(); Path path =

Re: RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-02 Thread Peter Levart
On 10/02/2013 12:19 PM, Remi Forax wrote: final class ProxyClassesDumper { ... private final Path dumpDir; // null if invalid public static ProxyClassesDumper create(String dir) { dir = dir.trim(); Path path = *Paths.get*(dir.isEmpty() ? . : dir); path =

Re: RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-02 Thread Henry Jen
On Oct 2, 2013, at 7:21 AM, Remi Forax fo...@univ-mlv.fr wrote: On 10/02/2013 04:12 PM, Peter Levart wrote: On 10/02/2013 12:19 PM, Remi Forax wrote: final class ProxyClassesDumper { ... private final Path dumpDir; // null if invalid public static ProxyClassesDumper create(String

Re: RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-02 Thread Peter Levart
On 10/02/2013 05:17 PM, Henry Jen wrote: One thing to watch though is that Paths.get(String) can throw InvalidPathException. This will render InnerClassLambdaMetafactory non-functional since its static initialization will throw exception. Each lambda capture will than throw Error. I think the

RFR (4th): 8023524: Mechanism to dump generated lambda classes / log lambda code generation

2013-10-01 Thread Henry Jen
Hi, Please review the updated webrev at http://cr.openjdk.java.net/~henryjen/ccc/8023524/3/webrev/ This update addressed comments from Mandy with following, - call doPrivileged with specific file permission, ALL FILES, write. - Use nio package to write deal with FS, also create directory