Caching inObjectOuputStream: bug or undocumented "feature"?!

I'll give you the code in the end. The screen dump contains characters that is not allowed in to the editor window, so you'll have to run the code yourself to see the result.
This is what I did:
1. Create a LinkedList
2. Create an ObjectOutputStream connected to a ByteArrayOutputStream
3. Add an object to it
4. Serialize the LinkedList through ObjectOutputStream.writeObject()
5. Print the ByteArrayOutputStream the console.
6. Reset the ByteArrayOutputStream.
*. Do number 3 -> 6 a few times.
The result will be that what comes out in the ByteArrayOutputStream is cached (?) information. It does not matter how much you put into the list, you will allways get the first serialization out on the stream.
The second test I did was to serialize a clone of the list. Now things are going the way they should. All the added objects are sent to the stream.
I tested this using an ObjectInputStream as well, but this code takes less space and produces the behavior.
Now to my questions:
Is this really the way it should work? If it is why isn't it documented in the JavaDoc and why isn't there a more intelligent cache that can check if the object to be serialized has been changed?
The more I think of it the more worried I get. If someone has a big tree of som kind that the want to serialize, what happens if someone changes a small detail? Will that change go through? Not according to the test I just did. To clone every single object that go through the ObjectOutputStream more than once is not very good for performance...
Or does the cache only look at the "top" object?
Code:
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.LinkedList;
public class Test
 public static void main(String[] args)
  try
   ByteArrayOutputStream baOut = new ByteArrayOutputStream();
   ObjectOutputStream oOut = new ObjectOutputStream(baOut);
   LinkedList list = new LinkedList();
   for (int i = 0; i < 10; i++)
    list.add("Test" + i);
    System.out.println("Serializing: " + list);
    oOut.writeObject(list);
    System.out.println("Result: " + baOut.toString());
    baOut.reset();
   //Redoing the test but this time with list.clone()
   list = new LinkedList();
   for (int i = 0; i < 10; i++)
    list.add("Test" + i);
    System.out.println("Serializing: " + list);
    oOut.writeObject(list.clone());
    System.out.println("Result: " + baOut.toString());
    baOut.reset();
  catch (IOException e)
   e.printStackTrace();
/Lars

The ObjectOutputStream keeps track of whether or not
an object has been serialized, and if it has, any
further attemps to serialize the object will result in
a reference to the first occurence of the object in
the stream. This is to keep objects being serialized
multiple times unnecessarily.It is more than an optimization. This logic is required to avoid cycles during object graph serialization.

Similar Messages

  • FAQ: How do I submit a bug report or feature request or otherwise give feedback about Premiere Pro?

    The best way to submit a bug report or feature request is to use the bug-report/feature-request form.
    The Premiere Pro team doesn’t  necessarily see and record every post on every forum and social network, but we do see, record, and track every entry  through the the official feature-request/bug-report form.
    It also helps a lot if you opt into the Product Improvement Program.
    Also, be sure to use the crash reporter.
    We really do read all of the bug reports and feature  requests, and the software really does get a lot of benefit from  detailed crash reports.
    Don’t forget about contacting Adobe Technical Support or Customer  Service, too. For information on how to contact Adobe Technical Support,  see this page. (Note that you must register your product before you can open a technical support case for it.)
    If you have tried to get help from our support staff, but the service  was inadequate, I can help you to escalate your issue if you send me  your case number at kopriva at adobe dot com. You must provide me  a case number. I am not offering to solve your problem myself; rather, I  am willing to forward your information to someone if you have already  hit a dead end with our Technical Support or Customer Service.
    If you have feedback about the content of the Premiere Pro Help document,  then please add a comment at the bottom of the relevant page. You can  add comments to add information, to add links, to make corrections, or  to ask for clarification.
    If you want to keep up with the Premiere Pro team, then you can follow our blogs, Facebook page, and Twitter feed and so on.
    Oh, and I can’t resist this opportunity to remind you to update to  the most recent version of the application. Don’t be surprised when the  first thing that you hear back from us is that you need to install the  latest updates. We fix a lot of things in updates, and we don’t want to go chasing bugs that we’ve already fixed. We’ll keep you posted on our blogs, Facebook page, and Twitter feed about updates as they become available.

    Hi qwerty,
    Dun tink that creative customer support sucks cos I had been dealing with them in the past and I can say that their service are quite gd and fast. If you wanted a refund, I tink you need to contact the store that sells you the product. Dun tink creative will refund you though.

  • Music stops with Etymotic earphones and undocumented feature in iPod

    I have been using these Etymotic ER-6 with an iPod 4th generation without any problem, but after upgrading to an iPod Video, things have not been as smooth.
    It seems that there is a new undocumented feature in the iPod Video. If you unplug your earphones, the music stops automatically. Which is great. The problem is that the Etymotic earphones have a 90 degree plug, prone to move sideways. When it moves, the music stops.
    Has anyone experienced a similar problem?
    G5 & iPod Video   Mac OS X (10.4.4)  

    Haven't had a "problem" with that feature as my connector is straight however, it would have been nice if they applied the same feature for "Dock Removal" so it pauses when lifted from a dock.
    Beavis2084

  • Lync 2013 - re-connecting is un-muting microphone, is that a bug or a feature?

    Every time Lync 2013 re-connects (very often sadly) the microphone is un-muted.
    Is that a bug or a feature?
    I'm using a Plantronics Voyager UC headset (Lync certified), doesn't know if it happens with others too.
    Please advise if there's a solution, I have to disconnect from Lync every time I'm in a conf call using another software like Cisco Webex.
    Quite annoying and very embarassing sometimes...
    Thanks

    Hi,
    When Lync change the status of Mute/Un-Mute, it change the Audio value with the following path: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio
    Please check if Cisco Webex also use the same parameter for Mute\Un-Mute. If the two use the same parameter, it can cause the issue.
    Also, if the re-connection issue only happen to you, please try to update Lync to the latest version and then test again.
    If the re-connection issue happen for multiple users, please check the Lync Server performance and network situation as well.
    Best Regards,
    Eaosn Huang
    Eason Huang
    TechNet Community Support

  • Where do i go to find out about this undocumented feature?

    If I open a PDF's Document Properties and click the Additional Metadata button, it brings up a new dialog for entering metadata. All the metadata fields, there, have down arrows on the right side, presumably to enable someone to choose from a pick list of possible entries. But how does one populate those lists of possible entries?  This appears to be an undocumented feature...or at least it's so cleverly hidden that it's very difficult to find. They  logically appear to prpvode a place where users might be able to store a bunch of common entries for the team, to enable consistent team usage.  This would be especially useful with regard to the Keyword field.  It isn't much help if everyone  types in randomly-conceived key words on the fly; that results in a chaos of misspellings, mis-phrasings, etc. What work teams need is a consistent list of key words that can be agreed upon, loaded for team usage, and accessible/assignable within any PDF document so that all the team's PDFs are tagged correctly.

    Thanks for pointing that out but, unfortuately, that response doesn't address the question.
    Creating a custom property has nothing to do with building a list of values in the keywords field's dropdown picklist menu.
    And adding a custom tag doesn't help because the tag you create doesn't appear in the 'additional metadata' window.
    This whole area of Acrobat seems not to be documented....or if it is,  the documentation is too hard to find.
    But thanks for pointing out the custom tag names function...i just wish it told us how and why to use it.

  • Bug Or Undocumented Limitation

    Hello, i want to report a bug, or undocumented limitation
    if we use shader for the blend shader, the extra input (third input, forth input, so on) can't be used, it showed a plain color (maybe the first color in the input)
    it doesn't happen if we use shader for the fills or use it with shader job (dunno with filters, haven't tried)
    so it's annoying
    thanks,
    alijaya

    I do not like Vivek's workaround. "Use HTML report"  is not acceptable when the question is about Standard report. People may want to use Standard report and there is a reason it is called standard.
    Anyway one solution is to size the image to most optimum size - as large as possible but retaining the graphical quality. This will still leave you with large white spaces around your graph object.
    Second solution that I am using is to Put the graph object and any other elements that I want on my report on a Front panel of a VI. Size the objects and front panel and objects appropriately and then use Print Panel to Printer method to Print the whole VI front panel. In my app. This VI which mimics the report is called from my app and is called Print Preview.  There is even a Vi that allows you to choose the printer. http://zone.ni.com/devzone/cda/epd/p/id/1327
    I am attaching a Sample Report and Code Snippet to look at.
    Good Luck!
    Mache
    Attachments:
    Labview Document.pdf ‏21 KB
    Print Code.jpg ‏30 KB

  • Undocumented features of the expression node

    After investigating expression nodes in detail here, I stumbled on some undocumented features that could give your UIs some interesting new twists (if used in moderation!).
    I have not fully explored all possibilities, so there might be more.
    I have tested in it LabVIEW 4.0 through 2013SP1 and it seems to work everywhere. (Versions below 6i show some slight pixelation artifacts, but that can be ignored)
    Look what it can do!!!!
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    HiddenExpressions.png ‏8 KB

    Hornless.Rhino wrote:
    Hey wow, you can see through to the block diagram. Better put a perspex plate over that, you don't want animals getting in there and gnawing on the wires.
    Just duplicating the myRIO design, where you can see the "circuits" under a glass cover.
    LabVIEW Champion . Do more with less code and in less time .

  • Bug,exploit or feature?

    One thing I have notice is that when I lock my phone by pressing power button the screen turns off but the touch still works for couple of seconds. (e.g. Press power button and swipe from top to bottom and press power button again and you will see that notification panel is active, same goes with camera and call feature in lockscreen). I am not sure if this is a bug or a feature available, but i do believe is when the screen is off the touch shouldn't be active.

    Quester wrote:
    Couldn't replicate this on my Z3 Dual running Lollipop, most probably it's a bug. A PCC phone repair should fix it.I tried repair as well as flashing rom with flash tool but its still there. Its not a big problem though. 

  • CLI and undocumented features ...

    ... or confessions of an Xsan Newbie .... OK, so I've been using Xsan for six months now and trying my hardest not to use CLI and all that tricky Unix stuff .... finally realized that CLI might be the best friend an inexperienced Xsan Administrator could have ... so question becomes .... apart from the Man pages that are installed in the Xsan server folder (is it me, or this the most difficult technical document in the world to navigate around?) and the highly comprehensive descriptions (not) of the CLI commands in the Xsan Admin Guide .... where do you find good documentation on how to use the CLI? Which Unix commands are useful for managing Xsan?
    Plus, I get the feeling from reading some of the StorNext documentation that there is much more to SNFS than meets the eye or that Apple is letting on. Is there anything that covers the undocumented features of Xsan that would be easy to understand by a simpleton like me?
    Thanks,
    Neil
    Hollywood-DI

    Hi Neil,
    There is a 3-day stornext course which I found very usefull.
    For day to day use, the cvadmin command is your friend. So I suggest with studying on the man page for it. when you want to create and change volumes, you need more commands: cvlabel, cvmkfs, cvupdatefs, cvfsck.
    These manpages are actualy acurate. I can imagine to be overwhelmed with all the options. At first you need to understand the context. The mentioned course will help you with this. This is complex material. You have to dive into it. There is no shortcut.
    For tuning and creating a new volume the cvfs_config manpage is usefull.
    For unix I suggest a good book and a course. Commands I use frequently:
    + mount -t acfs <volname> /Volumes/<volname>
    + umount /Volumes/<volname>
    + du -hs /Volumes/<volname> | sort -nr # to see the fillers of a volume
    + df -h # to see how full the volume is
    + grep # selecting specific info from a bunch of data
    + cat # display the content of a file
    + vi/pico # unix text editors
    Also, check articles from apple.com and xsanity.com. There are loads of info there.
    One major part of the xsan is the FC environment. You need to study that too. Qlogic has good pdf's. Setting up the nicknames and zoning right, is a must!
    HTH
    Donald

  • Undocumented feature aka bug

    If you try to move a list of files in Finder from a folder to another folder and one of those files is locked then all the files you are moving will be copied instead of moving just the files that can be moved and copying the file that is locked.

    If you wish to file a report then use Feedback. This is just a users' site.

  • Is this a bug or a feature in JDeveloper 11.1.1.4?

    Hello everybody,
    when I try to create a new "Reusable Process" with the composite editor in Jdeveloper, nothing happens on in the composite design view! I can see the process in the file structure and I can also edit the process in the bpm editor, but I can't see it on the composite.
    This looks like a bug to me. Can anybody confirm this?
    Best regards, Chris
    Windows 7 (64 bit)
    JDK 1.6.0_24 (64 bit)
    JDeveloper Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923
    BPMN Editor 11.1.1.4.0.5682
    SOA Composite Editor 11.1.1.4.0.56.82

    it's a feature of cource. all bugs in 11g are features!

  • ServerSocket bind, bug or windows feature

    I wanted to check if a TCP socket was already bound before attempting to use it.
    I had my own ideas, but looked for other ideas as well.
    While testing these other ideas I stumbled on the following issue.
    On Windows XP(SP3), its the work platform of choice, I noted the following from a netstat:
    $ netstat -an|grep 139
    TCP 10.11.13.98:139 0.0.0.0:0 LISTENING
    TCP 192.168.56.1:139 0.0.0.0:0 LISTENING
    TCP 192.168.113.1:139 0.0.0.0:0 LISTENING
    TCP 192.168.231.1:139 0.0.0.0:0 LISTENING
    Note that this is the Windows 'NETBIOS Session Service' of course and that it is bound to all my machines interfaces except for the loopback.
    If I execute the following call:
    ServerSocket anyAddressSocket = new ServerSocket(139, 2, null);
    I will not get java.net.BindException thrown.
    I will see a new listener bound to port 139 and the 'any address' as follows:
    $ netstat -an|grep TCP|grep 139
    TCP 0.0.0.0:139 0.0.0.0:0 LISTENING
    TCP 10.11.13.98:139 0.0.0.0:0 LISTENING
    TCP 192.168.56.1:139 0.0.0.0:0 LISTENING
    TCP 192.168.113.1:139 0.0.0.0:0 LISTENING
    TCP 192.168.231.1:139 0.0.0.0:0 LISTENING
    But if I replicate the situation using Java on a different arbitrary port as follows:
    List<ServerSocket> sockets = new ArrayList<ServerSocket>();
    Enumeration<NetworkInterface> enumOfNetworkInterfaces =
    NetworkInterface.getNetworkInterfaces();
    while(enumOfNetworkInterfaces.hasMoreElements())
    NetworkInterface networkInterface = enumOfNetworkInterfaces.nextElement();
    List<InterfaceAddress> addrs = networkInterface.getInterfaceAddresses();
    for(int idx = 0; idx < addrs.size(); idx++)
    InterfaceAddress intFace = addrs.get(idx);
    if (!networkInterface.isLoopback())
    ServerSocket socket = new ServerSocket(7777, 2, intFace.getAddress());
    sockets.add(socket);
    // At this point, netstat shows the same output as the first port 139 output above.
    ServerSocket brokenSocketNo = new ServerSocket(7777, 2, null);
    I will get the expected exception:
    "java.net.BindException: Address already in use: JVM_Bind"
    I am testing this with Java 6u6 which I know is old, but is what is required to be used for this product.
    Is this a bug in the JVM implementation? I cannot find any reference to such in the bugs DB.
    Is this a feature of Windows TCP stack?
    I have not tried this on a linux platform because I am really trying to understand the issue as exhibited on the MS platform.
    Any insight into this would be helpful.
    Cheers Mark

    Hello EJP.
    Thanks for that pointer.
    I tried it as you indicated and inside the loop using the following:
    ServerSocket socket = new ServerSocket();
    socket.setReuseAddress(true);
    socket.bind(new InetSocketAddress(intFace.getAddress(), 7777), 2);
    Each ServerSocket is now listening on a specific interface using the 'setReuseAddress(true);' call.
    This by itself did not change the effect I see when I then make the call 'new ServerSocket(7777, 2, null)' which succeeded with port 139 but not with my port 7777 test.
    If I changed the call for the for the 'wild card' address to also use 'setReuseAddress(true);' then all succeeds, but this is not the situation that succeeded with the port 139 test.
    I think I am still attempting to solve the issue as a bug or a 'windows XP feature', but I am leaning more about the intricacies of sockets.
    I will follow your suggestion and have a look at 'Stevens' 3rd Edition.
    Cheers Mark

  • Bug or Lost Feature in new Quicktime?

    Not sure if the following is a bug but we have lost an important feature with the new updated release of QuickTime Pro.
    I draw your attention to the three buttons at the top left hand side of a program window - RED Yellow GREEN.
    With the latest QT update in place select any compatible movie or video to play. It opens in original size. Prior to this update you could expand it easily to fit your desktop by clicking on the green button. Now the green button is disabled and does not work upon original opening of a media file.
    Go to the Menu and select "Fit to screen" or hit Control 3 and the video will expand to fit the screen. Hit the green button and it will return to its normal size. Hit the green button again and it will expand to fit the screen.
    Prior to this update once you opened a media file with QuickTime Pro and clicked the green button it would automatically expand to fit the screen. That no longer happens. Apple has either disabled it or it is a missed bug.
    All other OSX media players (RealTime, VLC, NicePlayer, etc) will immediately expand the video window to fit the screen when their green button is selected.
    Apple please fix this right away. Without this feature many who use that green button (especially those of us with 30" Cinema monitors) will avoid QuickTime Pro and opt for one of the other more compatible/feature rich media players.
    Tim...

    Well, for now I'll drop QuickTime Pro and make other video players the default. If I have no alternative I'll convert the MP4 or MOV to another format like MPG or AVI and play it under VLC or RealPlayer.
    I can't be the only user who is going to be doing this - dropping use of QTPro in favor of other more reliable and feature-rich Mac video players.
    Tim...
    3Ghz Mac Pro w/8GRam, 3TeraHD, 2 SupDrives; 13" BlackBook; 80G iPod, 8G iPhone Mac OS X (10.4.9) 30" Cinema, HPColorLJ Printer, LaCie 600Gig External & LaCie DVDRW/CDRW Drives

  • Using TFS and email for bug reports or feature requests

    We've just rolled out a beta of our website and are soliciting feedback from external customers.  We set up a distribution list in Exchange where those emails all come to, but it's not practical.  It's difficult to track, it's non threaded and
    we have different people responding and testing the same items.
    We recently installed TFS 2010 to give it a trial run (nobody has ever used TFS before at all nor is anyone really familiar with it) and I have to imagine that you can use TFS to provide this sort of functionality.  Is there a paper or website out there
    that discussion doing this via TFS?  Basically what I'm looking for is:
    1. User is presented with a webform, fills it out, clicks submit which generates an email sent to us (done)
    1b. An auto response message is sent to the user who submits the form (not done as Exhchange distro wont do this without going the public folder route)
    2. Instead of the email coming to us, it would go to TFS which would auto-open a ticket
    3. All of us would have access to the ticket queue and be able to do the following
    a. ask further questions to the end user, have it sent to them automatically, update the ticket with the emails so we can all follow the thread
    b. able to reassign the ticket to a backlog, or as a bug to a current iteration or simply close it
    I'm an IT guy/project manager rather than a developer but I'm pretty good at following documentation if I can find it for what I'm trying to do.  Thanks for any pointers.

    Ahh, thanks for the extra details and clarification.  The features that you are asking for are definitely not provided out of the box, but are implementable using the TFS SDK.  Inlining a suggestion of one way your developers could
    implement this:
    1. User is presented with a webform, fills it out, clicks submit which generates an email sent to us (done)
    Have the code for the webform make a call to TFS to add a new work item with a special iteration path, e.g. "UnconfirmedCustomerRequests" or a special field like "ActiveCustomerRequest" set to true.  You can add a potentially add customer
    email address field to the work item template to keep track of the email address.  Then send the email out, and include the TFS bug id (and a link to the bug in TFS web access, if desired) in the email.
    1b. An auto response message is sent to the user who submits the form (not done as Exhchange distro wont do this without going the public folder route)
    Why can't the code for your web form take care of that?
    2. Instead of the email coming to us, it would go to TFS which would auto-open a ticket
    Taken care of in step 1
    3. All of us would have access to the ticket queue and be able to do the following
    a. ask further questions to the end user, have it sent to them automatically, update the ticket with the emails so we can all follow the thread
    You can write a web service that listens for notifications from TFS when certain work items are changed.  Updating the work item from customer replies may be trickier without writing another web form that talks to TFS or an email
    parser.
    b. able to reassign the ticket to a backlog, or as a bug to a current iteration or simply close it.

  • N95 undocumented features list

    Now it may just be that I'm suffering from a combination of new hardware and software aligned with the reduced service from Vodafone network in recent years(since PAYG) but is anyone else getting all of these issues?
    1. When pressing cancel on phone trying to make a wireless (802.x) connection the phone re-sets every time.
    2. Phone re-sets at any time going to first start screen - i.e. "Would you like a tour of your new phone" 500 times.
    3. When using GPS, phone turns itself off at any time.
    4. When using GPS, application hangs requiring removal of battery to restart device.
    5. PC Suite does not recognise phone each time is plugged in and creates a new modem, com port and connection.
    6. PC Suite refuses to connect to internet with 'unable to connect to device' even though it sees phone and has previously. (Up until today this was the only feature that functioned without fault)
    7. In some cases, it is possible to make a connection to the internet with the dial up access when PC suite fails to see phone is connected to the PC at all.
    8. When sat in a 3G full signal area and not moving, internet connection will drop or phone will re-set back to the good old 'Would you like a tour' page.
    9. When driving through Dorset the phone obviously lost signal. It did not regain it at all into the next day and needed rebooting to obtain a signal again.
    10. When making a telephone call (yes it apparently is supposed to be able to!) phone re-sets back to the wonderful 'Would you like a tour' screen.
    Now of course new technology is buggy, if you buy at first generation the product has been rushed to market without proper testing. We all know this is the way IT/Technology companies survive, people like us find the bugs and save them R&D costs.
    HOWEVER, it would be nice to be able to use the basic function of a phone that costs arounf £450 and be able to use it as a phone at the least.
    I am currently having to return the phone time and time again to Vodafone in order to get a replacement which I know will have the same bugs and sometimes new ones.
    Perhaps Nokia could provide help to 3rd parties and end users of these phones to allow for the development of an N95 that actually functions as it would then be quite a good device to use.
    Annoying more so as I was hoping to ditch the N73 I got last year as it keeps......... switching itself off for no reason.
    If only my P990i had the same features I'd not use a Nokia again. I mean, long battery life, a phone that doesn't crash every 5 minutes. Applications that stay running. Hmm.

    Not really sure if it's appropriate to discuss the benefits of another firms mobile phones in Nokia's end user forums but anyway...
    Some of Sony Ericsson's phones have comparible features as Nokia's such as the P and M range (I'm told the M600 is a good phone) but they too have their problems just like Nokia's (My p990i is a nightmare when it comes to the RAM usage, a common complaint and one a firmware update has not resolved). Also the version of Symbian they use is somewhat less capable as Series 60 in my opinion.
    Forget LG and Samsung if its a smartphone and features you want. Those phones are mostly designed for form over function and they aren't really smart (Although Samsung are about to release a Series 60 phone over here soon).
    Useful links: Phone firmware update | Nokia support site

Maybe you are looking for

  • [Solved] tun module was loaded but not in lsmod?

    Hi Everybody, I loaded the tun module with "sudo modprobe tun" without any error message but didn't see it anywhere in "sudo lsmod". What might be the problems? I'm using linux-ck and wondering if linux-ck does anything here. The reason I want to loa

  • HP Photosmart C7200 series will not install on HP TouchSmart PC windows 7

    I just bought a HP Touchsmart computer.  I have a HP Photosmart C7200 series printer.  The cd for this  printer will not install because it does not support windows 7.  Is there a fix for this.

  • DVD's read as blank even though they have been written.

    The problem is the following: DVD's that I burned using both Tiger and Leopard 10.5 (before 10.5.1) are not being recognized as blank. These discs are NOT blank and they display their contents in other Macs and PC's. When they are inserted in my driv

  • My iphone wont come out of dock mode

    I have an iphone 4S and this problem wants me to get rid of it! I cant listen to my music unless its in a doc or my earphones are plugged in. This happened to my first iphone (which was also a 4S) and apple couldn't figure it out. Any ideas how to fi

  • HELP! i cant get itunes because...

    it says it doesnt have a digital signature. how do i disable the setting that makes it have one or how do i get itunes another way?