On 9.10.2015 08:51, Jaroslav Bachorik wrote:
On 8.10.2015 18:56, Martin Buchholz wrote:
Hi Jaroslav,
we all keep writing finalization code like this... welcome to the club!
I think it would be better :
- never use currentTimeMillis to measure elapsed time; use nanoTime
instead
Ok. I suppo
Hi,
I don't think it has been mentioned before, but is
@ConstructorProperties still necessary in JDK8+ ? Couldn't the
j.l.r.Constructor#getParameters() be used instead?
How is one supposed to compile an MXBean that would work in JDK8 and at
the same time in JDK9+ without java.desktop in the
On 09/10/2015 12:42, Peter Levart wrote:
Hi,
I don't think it has been mentioned before, but is
@ConstructorProperties still necessary in JDK8+ ? Couldn't the
j.l.r.Constructor#getParameters() be used instead?
How is one supposed to compile an MXBean that would work in JDK8 and
at the same
On 9.10.2015 13:42, Peter Levart wrote:
Hi,
I don't think it has been mentioned before, but is
@ConstructorProperties still necessary in JDK8+ ? Couldn't the
j.l.r.Constructor#getParameters() be used instead?
This requires the class to be compiled with '-parameters' switch.
How is one suppo
On 10/09/2015 02:07 PM, Jaroslav Bachorik wrote:
On 9.10.2015 13:42, Peter Levart wrote:
Hi,
I don't think it has been mentioned before, but is
@ConstructorProperties still necessary in JDK8+ ? Couldn't the
j.l.r.Constructor#getParameters() be used instead?
This requires the class to be com
On 9.10.2015 14:21, Peter Levart wrote:
On 10/09/2015 02:07 PM, Jaroslav Bachorik wrote:
On 9.10.2015 13:42, Peter Levart wrote:
Hi,
I don't think it has been mentioned before, but is
@ConstructorProperties still necessary in JDK8+ ? Couldn't the
j.l.r.Constructor#getParameters() be used ins
On 09/10/15 14:30, Jaroslav Bachorik wrote:
Would it be possible for javac to recognise a class is an MXBean and
turn-on -parameters for such classes only by default? Too hacky?
Definitely :) Hacky as heck :)
I agree with Jaroslav.
FWIW - The @CP is not used for the MXBean itself, but for th
> http://cr.openjdk.java.net/~jbachorik/8135188/webrev.01
test/serviceability/dcmd/gc/RunFinalizationTest.java
L53: OutputAnalyzer out =
ProcessTools.executeProcess(testAppPb);
L54: out.stderrShouldNotMatch("^" +
FinalizationRunner.FAILED + ".*")
L55:.std
On 10/09/2015 02:30 PM, Jaroslav Bachorik wrote:
To answer my question: "How is one supposed to compile an MXBean that
would work in JDK8- and at the same time in JDK9+ without java.desktop
in the module graph?"
Annotate the constructor with the both the @j.b.CP and the new @CP. In
JDK 9 the
On 09/10/2015 16:36, Peter Levart wrote:
:
Sorry, but I must be missing something.
When you compile a class (not an MXBean as Daniel pointed out, but a
data object class) with JDK9, it can't be used on JDK8 because of
class file version.
When you compile a class with JDK8, it can't conta
On Thu, Oct 8, 2015 at 11:51 PM, Jaroslav Bachorik <
jaroslav.bacho...@oracle.com> wrote:
> On 8.10.2015 18:56, Martin Buchholz wrote:
>
>>
>>I think it would be better :
>> - never use currentTimeMillis to measure elapsed time; use nanoTime
>> instead
>>
>
> Ok. I suppose this would be becaus
85 long targetTime = System.nanoTime()+ TIMEOUT;
86 while (System.nanoTime()< targetTime) {
This code violates the rules for usage of nanoTime
https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#nanoTime--
If it ever happens that an object with a non-trivial finalizer is optimized
away, that would be a serious JDK bug, so I would remove the constructor
code for MyObject (what are you protecting against?). See my sample code
in previous msg.
WeakReference ref = new WeakReference(new Object() {
Is the code below expected to be running in the thread created by
System.runFinalization()? If so, check for that, i.e. that the thread name
is as you expect.
61 } else {
62 /*
63 * A 'non-finalizer' thread in this context means that
we
64
On 10/09/2015 06:54 PM, Alan Bateman wrote:
On 09/10/2015 16:36, Peter Levart wrote:
:
Sorry, but I must be missing something.
When you compile a class (not an MXBean as Daniel pointed out, but a
data object class) with JDK9, it can't be used on JDK8 because of
class file version.
Whe
On Thu, Oct 8, 2015 at 11:51 PM, Jaroslav Bachorik <
jaroslav.bacho...@oracle.com> wrote:
> On 8.10.2015 18:56, Martin Buchholz wrote:
>
>> Hi Jaroslav,
>>
>> we all keep writing finalization code like this... welcome to the club!
>>
>>I think it would be better :
>> - never use currentTimeMil
16 matches
Mail list logo