September 25, 2011  
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30

[02:38:10] *** echelog-2 has joined #weld-dev
[04:03:11] <stuartdouglas> In case anyone here is interested I have moved weld over to the AS7 code style + setup checkstyle at https://github.com/weld/core/pull/137
[09:51:48] *** oskutka has joined #weld-dev
[10:15:55] <ge0ffrey> stuartdouglas: intresting :)
[10:16:25] <ge0ffrey> stuartdouglas: no more 3 spaces idents in java files?
[10:16:28] <ge0ffrey> :)
[13:21:17] *** kevinpollet has joined #weld-dev
[13:26:57] *** kevinpollet has quit IRC
[15:20:03] *** kevinpollet has joined #weld-dev
[15:29:38] *** kevinpollet has left #weld-dev
[15:30:02] *** kevinpollet has joined #weld-dev
[17:03:15] *** oskutka has quit IRC
[17:52:54] *** oskutka has joined #weld-dev
[19:45:02] *** alesj has joined #weld-dev
[20:13:23] *** kevinpollet has quit IRC
[20:19:25] *** pmuir has joined #weld-dev
[20:23:57] *** ge0ffrey has quit IRC
[21:03:59] *** kevinpollet has joined #weld-dev
[22:43:41] *** pmuir has quit IRC
[23:02:23] *** oskutka has quit IRC
[23:16:34] <stuartdouglas> alesj: are you happy for me to push those code style changes?
[23:18:03] <alesj> hey
[23:18:14] <alesj> i guess weld-osgi guys are OK with it?
[23:18:16] <alesj> stuartdouglas: ^
[23:18:38] <stuartdouglas> I will hopefully have a solution for them today
[23:18:43] <stuartdouglas> If not I won't push it
[23:19:27] <alesj> ok
[23:19:34] <alesj> if they are fine, then fine by me
[23:19:45] <alesj> since they did some work on top of old code
[23:19:56] <alesj> if that delays them too much
[23:20:16] <alesj> i guess it's easier for us to re-factor code style later
[23:20:36] <stuartdouglas> yea, I did not think about them until after I had finished
[23:20:51] <stuartdouglas> It might actually be best just to wait
[23:21:16] <stuartdouglas> because now it did not take that long, and it should be even faster the second time around
[23:22:06] <alesj> btw: any idea how to hack around package protected ctor? :-)
[23:22:22] <stuartdouglas> what do you mean?
[23:22:52] <stuartdouglas> You really have to use the same class loader, or use the same hack that is used for the private ctor
[23:23:53] <alesj> which is?
[23:24:08] <alesj> CL won't be the same, as this class is in diff module ...
[23:24:22] <stuartdouglas> generate two ctors that call each other recursively, just to allow the class to be loaded by the jvm
[23:24:54] <stuartdouglas> then instantiate the proxy with Unsafe
[23:25:09] <stuartdouglas> sun.misc.Unsafe
[23:25:38] <stuartdouglas> hmm, the osgi patch also has some conflicts with the proxy serialisation patch
[23:26:08] <stuartdouglas> I think I may just have to leave it, now that I have done it once it should be fairly trivial to do it the second time
[23:26:28] <stuartdouglas> although fixing all the check style errors was a bit of a pain :-)
[23:27:01] <stuartdouglas> although as that is a separate commit I can probably just cherry pick it into the newly reformatted code
[23:27:03] <alesj> :-)
[23:27:07] <alesj> can imagine ...
[23:34:10] <alesj> stuartdouglas: so, i still don't see how would you hack the pckg priv ctor?
[23:35:30] <stuartdouglas> The JVM spec says that every ctor must call super() or this()
[23:36:25] <stuartdouglas> if you have a package private ctor, and the sub class is in a different CL, then the JVM code verifier will not let you load the class
[23:36:40] <stuartdouglas> as it will detect that you are calling a method that you do no have permission to call
[23:37:18] <alesj> what about some ctor::setAccessible = true?
[23:37:24] <alesj> and then use it ? somehow
[23:37:25] <alesj> :-)
[23:37:31] <stuartdouglas> to get around this you can create two ctors that just call each other in an infinite loop, and AFAIK no JVM's will pick up that there is a problem
[23:37:46] <stuartdouglas> alesj: that is a reflection construct, which is a much higher level
[23:38:03] <alesj> yeah, but any hack will do in my case
[23:38:08] <stuartdouglas> you have to do an INVOKESPECIAL call of super)(
[23:38:12] <stuartdouglas> a reflection call does not count
[23:38:36] <stuartdouglas> so creating those two ctors lets you load the class into the JVM
[23:38:39] <alesj> yup ? :-(
[23:38:50] <stuartdouglas> then you can instantiate it using sun.misc.Unsafe
[23:38:59] <stuartdouglas> which will avoid calling the constructors
[23:39:10] <alesj> which two ctors?
[23:39:33] <stuartdouglas> the two that you create on the proxy that just call each other recursvly
[23:40:02] <alesj> proxy? ? i'm still lost :-)
[23:40:15] <stuartdouglas> hang on, what are you actually trying to do?
[23:42:24] <alesj> :-)
[23:42:50] <alesj> i have class A, which is in diff module, and A's ctor is pckg protected
[23:43:09] <alesj> i then need to instantiate this A, but from diff package, diff module
[23:43:24] <alesj> and that pp_ctor is A's only ctor
[23:45:28] <stuartdouglas> alesj: can't you just use reflection?
[23:46:12] <alesj> stuartdouglas: yeah, looks like I'll have to do that ...
[23:56:18] *** kevinpollet has quit IRC

top