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

Peter Levart peter.levart at gmail.com
Wed Oct 2 00:19:04 PDT 2013


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 implements PrivilegedAction<Void> {
     DumpProxyClassAction(String dumpDir, String className, byte[] 
classBytes) {
         ...

...and use it in InnerClassLambdaMetafactory instead of an anonymous 
inner class. Same number of objects per generated class are created that 
way...

Regards, Peter

On 10/02/2013 01:04 AM, Henry Jen wrote:
> 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 hierarchy
> with package name instead of flat files.
> - If not specify a value or empty string, the directory is default to
> current working directory as "." is specified.
>
> We continue to use local encoding rule as other suggestions doesn't fit.
> The reason we cannot use something like URLEncoder is that ":" won't get
> encoded and it's not valid character for filename on Windows. All the
> suggestions so far seems to have that same issue.
>
> Cheers,
> Henry
>
>



More information about the lambda-dev mailing list