ArrayList clears when placed in HashMap

I have a series of ArrayLists (argValues), to be used as the values in a HashMap. They are not empty when they are placed in the table, but when I try to get one of them out, the ArrayList that is returned is empty. Here is the part of my code that has the problem. I'm parsing an XML file beforehand (doc_cmd is the Document into which the XML was parsed):
           NodeList nl_cmd = doc_cmd.getElementsByTagName("RFSW_CMD_PKT");
           if (doc_cmd != null) {
               for(int i = 0; i < nl_cmd.getLength(); i++) {
                    if (!nl_cmd.item(i).getNodeName().equals("#text")) {
                        String key = nl_cmd.item(i).getAttributes().getNamedItem("NAME").getNodeValue();
                        //   System.out.println(key);
                        Element currentCmd = (Element) nl_cmd.item(i);
                        NodeList nlChildren = currentCmd.getChildNodes();
                        ArrayList argValues = new ArrayList();
                        for (int j = 0; j<nlChildren.getLength(); j++) {
                            if (!nlChildren.item(j).getNodeName().equals("#text")) {
                                nodeName = nlChildren.item(j).getNodeName();
                                if (!nodeName.equals("BITFIELD") && !nodeName.equals("UNION"))
                                    argName = nlChildren.item(j).getAttributes().getNamedItem("NAME").getNodeValue();
                                else
                                    argName = "";
                                value = nodeName + "_" + argName;
                                argValues.add(value);
                        // THIS IS WHERE THE PROBLEM IS
                        System.out.println("ARGVALUES SIZE = " + argValues.size());
                        hashcmds.put(key, argValues);
                        argValues.clear();
                        ArrayList yo = (ArrayList)hashcmds.get(key);
                        System.out.println("SIZE = " + yo.size());

Note that you're calling the clear method on the
object you've inserted, not a copy of it. You should
clone() itIn this case I there is no point in cloning the ArrayList because it goes out of scope. He isn't resuing it and there was never a reason to clear it anyway. The solution is to just not clear the ArrayList.
If one were attempting to reuse it in that manner, cloning an ArrayList and clearing it to use again is less efficient than just creating a new one and letting the old one go out of scope.
The steps required to fill clone and reuse.
1. create new ArrayList
2. copy references
3. clear entries
4. insert n refereneces
The steps required to just create new
1. create new ArrayList
2. insert n references
By clearing the ArrayList here, you are just doing more work.

Similar Messages

  • When placing a png in indesign the png changes/loses its orginal color.

    When placing a png in indesign the png changes/loses its original color. Ex. the very clear blue that I am using turns dark and "dirty". ( my RGB is : 5,125, 255  -  when I type this I get a " out of gamut warning" a little yellow icon. When I click on it indesign automatically changes the RGB into: 67, 117, 187)
    I have worked with indesign for 6 years and never experienced this before. I am guessing it has something to due with that the png is in RGB and indesign in cmyk, but I have no idea what to do about it?

    Out of Gamut means the color cannot be printed in your current workspaces using CMYK inks. You would see a preview of the converted color if you move into Overprint Preview, use Proof Colors, or there is transparency and the blend space is set to CMYK.
    If this is destined for screen use, then the color doesn't matter, but you should be sure the blend space is set to RGB.

  • Illustrator CS4 Text & Shape logo is pixelated when placing as smart object in PS

    I made a Logo in Illustrator CS4 containing text & shape. The lines are crisp and clear at 100% & 200%+. I save my file as an ai and also another version as outlined. But when I copy & paste it into Photoshop CS4 as a smart object it becomes pixelated when I zoom in more than 100%. Is there a way to fix this?
    When I use to do this in CS3 it worked fine, but now it doesn't work. The Photoshop file, placed as a smart object is the one on the left at 200%. You can already tell the pixels are distorted. The one on the right side is Illustrator file at 800% and is still crisp & clean. I've saved as eps, tiff, jpeg from illustrator and when opening it in photoshop and zooming in it's pixelated....and yes AA is turned on in Illustrator and nothing happens when I view as overprint either.
    First, I'd like the logo in jpeg crisp and clear when zoomed in.
    Second, I'd like to resolve the smart object issue in PS. I know a smart object will hold it's quality no matter the resize of the image in PS, but I can't get it to work... Can someone offer any suggestions

    What is the ppi of the Photoshop file?
    And for what it's worth, any raster image will never be as crisp and clear as a vector image, smart object or otherwise. Photoshop shows raster previews even if the actual object is vector. If you zoom in on any raster iamge, you'll see pixelation.

  • In IMovie 11 the viewable area of the screen shrinks when placed in project editing. How do I keep this from happening?

    In IMovie 11the viewable area of the screen shrinks when placed in the project editing area.  How do I keep this from happening?  Thanks

    Mine doesn't show anything in the CSS Designer panel when I make a selection in Code Vew. It will only pop up the css set for a given element if I select that element in Design View first. If I drill down using the Sources and Selectors sub windows in the CSS Designer panel itself, it works the same in both. I pretty much never use it, but it doesn't do what you're explaining in my version of DWCC, so I'd guess you may have some slight corruption in the program.
    Unless, does it make a difference if you have Live View turned on or not?
    You could try clearing the program cache/personal config folder: Deleting a corrupted cache file
    Or restoring preferences if the cache doesn't do the trick: Restore preferences | Dreamweaver CS4, CS5, CS5.5, CS6http://helpx.adobe.com/dreamweaver/kb/restore-preferences-dreamweaver-cs4-cs5.html

  • Count down clock stops on ebay when placing bid in box,safari,ok opera,& firefox

    Safari,
    Count down clock stops when placing bid on Ebay, by clicking place bid box,have to use stop watch when getting to the last few seconds,ok on Opera,and Firefox,i have cleared cache,cookies and reset Safari.HELP please

    UPDATE: I had 36 Safari windows open and minimized on the dock from my last session; 20 of those windows failed to open b/c Safari "couldn't find the server"; I just went to the URL bar of all 20 pages and clicked return, and all 20 pages loaded perfectly, without dropping any images or losing formatting. This is a puzzle!!!

  • When placing a PDF created with Distiller, I only get Crop and Media as import options -- I need it to crop to the Trim! PLEASE HELP!

    I'm having a MAJOR problem placing PDF files in InDesign CS4...
    When I try to place a PDF that has been created in Distiller, the ONLY import options I can choose are CROP and MEDIA. I need it to crop to the TRIM, but that option is grayed out. The PDFs I'm trying to place were created in-house, and converted from Post Script files to PDFs using Distiller. We use PDF/X-1a equivalent settings when creating our PDFs.
    If I export the file as a PDF and then try to place it into a CS4 file, I am able to select Trim as an option.
    ALSO, if I open the Distiller PDF in Acrobat and then save it (without changing anything), I am able to select Trim as an option. A workaround I have found is to open all of the PDF files in Acrobat, save them to my desktop, and then save over the ones I need to place. Here's the problem with that: I work for a publishing company, and need to place hundreds of ads for each issue of our publications, and it adds a lot of time if I have to go and re-save everything just to be able to place all the ads. 
    Does anyone know how to fix this problem? I need to get this figured out so we can use CS4 for all of our publications again. -- We've gone back to using CS3 until I can get this figured out...
    - Valerie

    Steve,
    Thanks for the reply, but my PDFs all have trim boxes on them. If I try to place the same PDF in InDesign CS3, it gives me Trim as an option. Also, if I open the PDF and save a copy to my desktop, I am able to select Trim as an option when placing the PDF, and I didn't change anything about it.
    I've been trying to see if it's something with the Print Preset settings I'm using, but I can't find anything that seems like it would affect how InDesign would read the Trim area of the PDF.
    I've attached 2 PDF files. One that was created with Distiller, and one that was exported from InDesign CS4. The Distiller one doesn't show Trim as an option in CS4, but the exported one does.... but they started out as the same ad.  Ugh!  Help me please!
    - Valerie

  • Image cut out when Placed InDesign

    I don't quite know how to describe this, so I'm just going to include a screenshot. When placing an image in InDesign Creative Cloud (Only certain images, but all types of formats) the image gets cropped weirdly & pieces of it are missing. It looks like this particular one is cutout in the shape of the bag behind it, but it does it even when the image is merged (like with JPG) so I don't think the layers should be having an impact. When I view them in photoshop, they look whole, but when I place them, this happens. I've tried placing them as photoshop, JPG, PNG, GIF, etc. but it does it every time. Started last week after never having this problem before. Any idea what's going on? I tried updating, but that didn't help. So frustrated.

    Do you have a clipping path applied to the image? Open the image in Photoshop and check the Paths panel. If you see a clipping path in there you can remove it. InDesign will apply clipping paths automatically when placing if they're properly created in Photoshop.

  • Accounting document not cleared when billing document is cancelled.

    Hi,
    In ECC 6.0 when we cancel a billing document through vf11 in vfo3 we find the status as accounting document not cleared.
    The general process is manually going to f-23 and clear customer line items of that invoice. After doing this the status become accounting documet is cleared.
    My requirement is how to cancel the billing document without getting this message (accounting document not cleared) and not clearing the customer line items manually.
    Can it be done through user exit/enhancement or by copying requirement vofm.
    Please suggest.
    Thanks
    Edited by: sumesh on Jul 29, 2009 6:33 PM

    They directly want the accounting document to
       be cleared when billing document is cancelled.
    Though you can achieve this with the help of ABAPer, why dont you consider having a Posting block for your billing type so that as and when the billing documents are generated, you can release it via VFX3 in bulk or VF02 for individual billing document release to FI.
    In order to achieve this, go to VOFA, select your billing type and execute.  There you can see a field "Posting block" where maintain a tick there and save.  With this control, first of all, you can ensure that before releasing F2 billing documents to FI, it is not cancelled.
    thanks
    G. Lakshmipathi

  • Oversized text and lack of pages when placing a word document (.docx)

    I'm reposting this, since the last one seemed to get lost in the jumble:
    When placing text from a word document (.docx) indesign only gives me three pages for a 118 long document.  Also, those pages are blank, and to access the text, I have to delete a few blank lines.  When I do this however, the text is grossly oversized.  Changing the font does not help, as even on 6 pt, the text is much larger than it should be.  Help?  I've tweaked import options (although I may not know enough to diagnose the issue I am having), changed the format of the file (.doc, rtf) nothing seems to work.
    I am working in Indesign CS5.5 and here is a link to the document I am working with:
    https://docs.google.com/file/d/0BzA9ILF0ZW-aVmlCV0hvekhHYTQ/edit?usp=sharing
    Any help you could provide would be awesome.
    Thanks,
    -Julian Q.

    The problem is the page size. It's tiny lee than an inch wide and a bit over an inch tall. I'm not sure what you set up, but what you have now seems to have been made much smaller with the Page tool, perhaps.
    Set your ruler units in your prefs with nothing open to a system you are comfortable working in (the doc is set up in Picas, now. Do you know how to work in Picas?), then create a new file the size you really want.

  • Indesign crashes when placing pdf created in Xinet Fullpress.

    Indesign crashes when placing a pdf from Xinet Fullpress. Xinet thinks the problem is in inDesign.
    What to do?
    The pdf files works fine in acrobat and apple preview.

    Hi Peter, here is the link to the crashreport:
    http://pastebin.com/xzpp717i
    If you need the a test file that crashes, please download it on the attached link below.
    regard Martin
    Xinet pdf crash
    Hi, click on the link to download
    Tue Sep 18 2012, 15:47:53

  • Strange problem with image scaling when placed

    I'm currently running InDesign CS6 from the Creative Cloud, and it's version 8.0. I have a PC and am running Windows 8.
    I am experiencing a really odd problem when placing images, and it only recently (within the last two weeks perhaps?) has developed. I do ebook production for a publisher. I have an InDesign template (INDD file really, but "blank" and ready to be filled in, and as such I refer to it as a "template") that I use, and the cover for the book goes on the first page. The document is set to pixels as the ruler measurement, and the pages are 650 pixels wide by 800 pixels tall. The margins are all set at zero. The cover images are sent to me as JPEGs and always have the same size: 72dpi setting and 500 pixels wide by 750 pixels tall. This is chosen to be about the size of the full screen on most ereaders, or close enough to be so.
    So when working on a new book, I put my cursor in the blank line that is set up to take the cover as an inline image. I do control-D to place, select the file, and hit enter. This SHOULD place an image at that location that is 500 pixels wide and 750 pixels tall when looking at the InDesign page rulers. Instead, InDesign insists on placing this image at 50% scaling, so that it is only 250 pixels wide by 375 pixels tall. And in the link info panel, it shows the actual PPI as 72 and the effective PPI as 144. It does this no matter how many preference changes I try (including the ones under file handling and the import setting options).
    The strangest part is that if the file is just a tiny bit different than 500x750 @72dpi, then there is no problem. For example, if I open the JPEG in Photoshop and change the image settings to 500x750 @73dpi, then InDesign places it at 100% scale like I want. If I change the image to 499x749 @72dpi it also gets placed in InDesign at 100% scaling. I've tried this with various new INDD documents with settings in pixels, inches, or picas as the ruler amounts, and with different page or margin sizes (just in case the problem is with my template). I get the same result no matter what.
    It appears that InDesign somehow thinks that any image that is exactly 500x750 @72dpi should be scaled at 50% when placing it into an InDesign file. Has anyone else run across this? Is it a bug or something I'm doing wrong? I've been doing this exact procedure for over a year, first with CS5 and now CS6, and I've never had this happen until just recently. I suppose it COULD be an accidental change in settings or preferences. But if it is, I cannot figure out how to change it back.
    UPDATE: I installed the 8.0.1 update and it did not resolve the issue. I also tried more image options. It looks like this scaling to 50% upon placing ONLY happens when all three attributes match this: 500x750@72dpi. All of the following modifications to the exact same image placed in the exact same spot in the exact same document resolved the issue:
    501x750@72dpi
    499x750@72dpi
    500x751@72dpi
    500x749@72dpi
    500x750@71dpi
    500x750@73dpi
    But of course, I don't want to have to modify every cover image I'm sent in order to prevent this scaling issue.

    I just tried this and got the same results (CS6, 8.0.1, on WinXP SP3). One other tidbit: the same 500px × 750 px @ 72ppi image saved as TIFF instead of JPEG worked correctly (at least for me). I haven't tried any other image formats yet.
    This sounds like a good candidate for an official bug report: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    -Bill

  • I am getting interference on my Ipod touch on music that I sync from down loaded CDs to ITunes on my PC.  The music is clear when I play it on my PC but has the interference on the Ipod.  This just started recently.  Any thoughts?  Thanks.

    I am getting interference (scratching sound) on my Ipod touch on music that I sync from downloaded CDs to ITunes on my PC. The music is clear when I play it on my PC but has the interference on the Ipod.  This just started recently.  Any thoughts?

    Thank you so much for the reply.  I does not appear to be the headphones because I get the same interference sound from my Ihome radio when I dock by Ipod on it as well as when I connect the Ipod to the radio connection in the car.  I have isolated the issue to the Ipod because these same tunes play without interference on my PC so something is happening in the sync process.
    More thoughts?

  • PDFs missing bleed when placed

    I'm having an occasional weird problem in InDesign: I place an advertisement which has bleeds and cropmarks. These bleeds and cropmarks disappear in InDesign even though the frame is plenty large enough to show all of it. This happens occasionally both with ads I receive and with files that I create by exporting to PDF (the bleeds are there but don't show up when I place the PDF in another document). With my own files, I can ultimately print to PDF (instead of exporting) and get it to work, but I don't know what to do with this ad I just received:
    http://www.rotor.com/temp/LifePortAd.pdf
    The cropmarks and bleeds are always missing when placed -- whether it's a new document or an existing one. Are they somehow marked as non-printing in the PDF?
    Any ideas?
    Thanks, Phyllis

    Okay, I didn't notice that you could turn off the fixups (some of the profiles had specifically warned me that they were going to change the document). But most of those I'm not too sure about running anyhow. But the analysis ones look useful. "PDF analysis > List images below 250 ppi" seems like a very good one to run each time. I don't know what else I'd use. Ultimately I have to create a PDF with my printer's joboptions anyhow, but it'd be good to find out obvious problems from the start.
    Thanks!
    Phyllis

  • Cropped PDF's appear uncropped when placed in InDesign CS3

    I have an original PDF that I only needed a portion of. I cropped it in Acrobat 8, using the crop tool and resaved it as a new PDF document. But when I place the new PDF document in InDesign the entire original PDF document appears.
    Any suggestions,
    David

    Select show options when placing and choose crop as the crop to option.
    Bob

  • Sharp Photo When Placed in Indesign, Text becomes Blurry...

    I have a Photo (with Sharp Text) that when Placed in InDesign, the Text Becomes Blurry (as in Unreadable)...
    What's Up with that? And, more Importantly, what can I do to Correct?  Thanks (can attach if needed)

    Is this on screen or in print? Check Display Performance. Right-click on the image to change the display performance of only that image, or use the View menu to change the Display Performance of the document. Higher display quality generally slows the program down, although it can be slight. If the text is a text layer in Photoshop consider saving as Photoshop PDF. This will keep the file fully editable in Photoshop but the text will be vector paths in the PDF, rather then rendered raster art at the image's resolution.

Maybe you are looking for

  • Changing Expressions reference from relative to absolute?

    Is there an automated way to change an Expression's relative references (e.g., thisComp / thisLayer) to more absolute references like Comp("MyComp25").layer("MyLayer10.mov") When I copy and paste layers that reference other layers into new comps, the

  • BI 7 Printing

    Hi Everyone, We are currently implementing the BI 7 print to PDF functionality and it seems to be very good. We've managed so far to print data tables via the context menu and are aware that printing graphs with the data tables can also be achieve by

  • No Games for Brazil

    So I'm brazilian, and for some reason I can only buy apps that are in the "Brazil Store." And well, there are NO games in the app store. Everything BTW is in English, so why would they have a different store in the first place, and secondly, why woul

  • Convert a number spreadsheet to a PDF file

    how can I convert a numbers spreadsheet to a PDF file without scaling? (I would like to share it as a PDF not to print it) I have tried to do it several ways but I can't figure out how to do it good because automatically will Fit long sheet on one pa

  • Fuser error for HP Color LaserJet 3600 Series Printer

    My HP Color LaserJet 3600dn  Printer have  Fuser error message.  What is the problem ?