This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Objects created by ObjectInputStream.readObject() are not registered | ||
---|---|---|---|
Product: | profiler | Reporter: | Tomas Hurka <thurka> |
Component: | Base | Assignee: | Tomas Hurka <thurka> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | Keywords: | VISUALVM |
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Tomas Hurka
2009-04-23 14:13:25 UTC
This is day one bug. Below is the test-case: package javaapplication1; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; public class Main { public static void main(String[] args) throws IOException, ClassNotFoundException { int size = 100000; int b = 0; ByteArrayOutputStream stream = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(stream); for (int i = 0; i<size;i++) { A a = new A(i); oos.writeObject(a); } ByteArrayInputStream inStrem = new ByteArrayInputStream(stream.toByteArray()); ObjectInputStream ois = new ObjectInputStream(inStrem); for (int i = 0; i<size;i++) { A a = (A) ois.readObject(); if (a != null) { b++; } } System.out.println("done "+b); } } class A implements Serializable { int val; A(int v) { val = v; } } Profiler should see 200000 allocations of A, but only 100000 is reported. Fixed in profiler-main changeset: 128275:f3b2d11bfa7e user: Tomas Hurka <thurka@netbeans.org> date: Thu Apr 23 21:06:23 2009 +0200 summary: bugfix #163488, constructor does not need to be invoked on 'newOpClassName' class; in case of de-serialization the constructor of the first non-serializable superclass is invoked instead Integrated into 'main-golden', will be available in build *200904250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f3b2d11bfa7e User: Tomas Hurka <thurka@netbeans.org> Log: bugfix #163488, constructor does not need to be invoked on 'newOpClassName' class; in case of de-serialization the constructor of the first non-serializable superclass is invoked instead seems ok, makarking 'verified' |