How to get rid of "unchecked or unsafe operation" in J2SE 5.0?

There is always such inofmration after I compile the code. How can I check if the code contains unchecked or unsafe operation"?

There is always such inofmration after I compile the
code. How can I check if the code contains unchecked
or unsafe operation"?javac -source 1.4 xyz.java

Similar Messages

  • Unchecked or unsafe operations in db connection pooling

    In db connection poolong ,
    connections are kept in hash table.Iam getting error as unchecked or unsafe operations.
    can you rectify this
    regards
    preethi

    malcolmmc wrote:
    You don't necessarilly have to install retro compilers - you can set the source and target levels on the compiler command line e.g.
    javac -source 1.3 -target 1.3 ....That does not however prevent you from using methods (and I think classes) that don't exist in 1.3, only language features.
    It's especially nasty when dealing with new overloaded methods, where it will allow you to use new overloaded versions that don't exist in the old language version when compiling, and will allow them to be used when running against a 1.5 JVM, but when run against a 1.3 JVM you get exceptions because the method doesn't exist there.
    So be extremely careful using those flags, and test everything thoroughly against a 1.3 JVM (which kinda defeats the purpose of the flags, as it means you need one installed anyway so why not use that to compile in the first place?).

  • Uses unchecked or unsafe operations with deserialization

    Ive read a lot of posts and they all seem to say it something wrong with my generics and / or casting of them and I can't figure out what's wrong?
    First I created a Map as follows:
    Map<String, Map<String, Integer>> map = new HashMap<String, Map<String, Integer>>();
    String a = "A";
    Map<String, Integer> nodesA = new HashMap<String, Integer>();
    nodesA.put("B", 6);
    nodesA.put("H", 10);
    String b = "B";
    Map<String, Integer> nodesB = new HashMap<String, Integer>();
    nodesB.put("A", 6);
    nodesB.put("H", 2);
    String c = "C";
    Map<String, Integer> nodesC = new HashMap<String, Integer>();
    nodesC.put("B", 9);
    nodesC.put("D", 2);
    nodesC.put("F", 7);
    nodesC.put("G", 6);
    nodesC.put("H", 5);
    String d = "D";
    Map<String, Integer> nodesD = new HashMap<String, Integer>();
    nodesD.put("C", 2);
    nodesD.put("F", 2);
    String e = "E";
    Map<String, Integer> nodesE = new HashMap<String, Integer>();
    nodesE.put("D", 4);
    nodesE.put("F", 1);
    String f = "F";
    Map<String, Integer> nodesF = new HashMap<String, Integer>();
    nodesF.put("C", 7);
    nodesF.put("D", 2);
    nodesF.put("E", 1);
    String g = "G";
    Map<String, Integer> nodesG = new HashMap<String, Integer>();
    nodesG.put("C", 6);
    nodesG.put("F", 8);
    nodesG.put("H", 3);
    String h = "H";
    Map<String, Integer> nodesH = new HashMap<String, Integer>();
    nodesH.put("A", 10);
    nodesH.put("C", 5);
    nodesH.put("G", 3);
    map.put(a, nodesA);
    map.put(b, nodesB);
    map.put(c, nodesC);
    map.put(d, nodesD);
    map.put(e, nodesE);
    map.put(f, nodesF);
    map.put(g, nodesG);
    map.put(h, nodesH);Then I serialized the map as follows:
    FileOutputStream fos = new FileOutputStream("data");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(map);
    oos.close();
    fos.close();Then, in a different program, I tried to create a new map, set it to null to make 100% sure it was empty, and load in the map that I had saved, but when I try to compile this, I constantly get that uses unchecked or unsafe operations. I've tried all sorts of casting and such, and I can't figure out what it wants?
    Map<String, Map<String, Integer>> map = new HashMap<String, Map<String, Integer>>();
    map = null;
    output.println(map); 
    FileInputStream fis = new FileInputStream("data");
    ObjectInputStream ois = new ObjectInputStream(fis);
    map = (Map<String, Map<String, Integer>>) ois.readObject();
    ois.close();
    output.println(map); 

    The code you posted is correct, just add a @SuppressWarning("unchecked:). readObject returns an Object so you must cast and casting to a generic type will always produce a warning as the generic type information is erased (not available) at run time.
    You can read the warning in this case as 'possible class cast exception', which the compiler doesn't generate and you know that it shouldn't happen.

  • A line appeared in the backdrop, how to get rid of it?  (and how did it get there?)

    the site was published and everything looked great, except we had to make several changes to the content and somehow along the way a line appeared on the master page (hence appearing on all pages).  i can't figure out how to get rid of it, and it's driving me nuts.  any advice would be much appreciated.
    thank you in advance for you help!

    Hello,
    Are you talking about the Shadow effect on the page : http://trainingwebcom.worldsecuresystems.com/SachinFTP/2013-12-05_1415.png
    Or is it about the line on the homepage : http://trainingwebcom.worldsecuresystems.com/SachinFTP/2013-12-05_1416.png
    In case it is about the shadow, please go to Master page, click on some blank area and check in the toolbar at the top if there is some effect applied to page : http://trainingwebcom.worldsecuresystems.com/SachinFTP/2013-12-05_1417.png
    It can be Shadow, Bevel or Glow effect applied. You can uncheck it and it should be good.
    Let us know if it helps or not.
    Regards,
    Sachin

  • How to get rid of widescreen

    I use a miniDV camcorder in a 4:3 format. It has a widescreen feature, but all it does is to crop top and the bottom of the picture and replace them with letterbox. It is not a natural widescreen.
    Any clip I import into iMovie gets stretched out into wide screen. When I export into iWeb, movie is also stretched out. I have to do a custom export and give it proper size. That would not be the major problem
    The major problem is that if the movie is stretched out in iMovie and i import any pictures from iPhoto (pillarboxing makes no difference here!!!!!!) the picture is correct, while the movie is stretched out. Now, if I happen to export it into 4:3 format, the movie becomes natural 4:3 again, but the picture is now very narrow (squeezed). So, I have to go to Photoshop, stretch the picture into anticipated widescreen import into iMovie and pray that the movie and the picture will eventually be rendered in a correct ratio in the end. that's NOT acceptable.
    Is there any way as to how to get rid of widescreen adn work in 4:3 ratio? I would appreciate it. Spending 3k on a widescreen hd cam? sorry, but I'm not that **** bent on doing digi video........
    iMovie is a great app with tons of features, but combining a 4:3 video with pictures in 4:3 format doesn't mix together. Again: pillarboxing preference checkbox makes ZERO difference on the imported clip - it's still stretched out. Am I missing something?

    Also make sure to uncheck the "iMovie HD/Preferences.../Import/Automatic DV Pillarboxing & Letterboxing" if you still have problems.
    http://www.sjoki.uta.fi/~shmhav/iMovieHD_6_bugs.html#pillar_letterboxingpref

  • My 2nd generation Nano indicates that about half of the space is 'other'. Anyone know what that means and how I get rid of it? All I've ever downloaded is music.

    My 2nd generation Nano indicates that about half the space is 'other'. Anyone know what that means and how I get rid of it? All I've ever downloaded is music.

    gomeznoles wrote:
    My 2nd generation Nano indicates that about half the space is 'other'. Anyone know what that means and how I get rid of it? All I've ever downloaded is music.
    The Other data on your iPod is album art, file allocation structures, your main library file, and any other data that the iPod uses to read its songs. 
    You can have it removed by going to your itunes and plugging your ipod back into it.   Click the device then click the music tab then uncheck box that says include album artwork.. then sync again.. this time the OTHER stuff will now be removed.

  • How to get rid off yahoo search?

    when i search something from google search (in a webpage) it goes to the yahoo search website and show the results!
    1.) there is no extension on add-ons, anything to do with search or yahoo
    2.) i have tried reset the keyword.url from configuration
    3.) i also tried to remove yahoo search engine from searchbar (didn't help)
    This article didn't help either (same as above though): https://support.mozilla.org/en-US/kb/remove-toolbar-has-taken-over-your-firefox-search?esab=a&as=aaq
    And i have avast and malware-program and those doesn't find anything.
    No help. Everytime i search something in google, it goes to the yahoo search webpage! how to get rid of this yahoo rubbish?
    I have no idea how it came. Maybe something to do with vlc codec pack? "Myfreecodec" that i tried to use when trying to play some mp4-file... i think i haven't installed anything else lately... And i always uncheck the "add this one on your browser..."

    Where in my control panel can I find this and uninstall it? I do not see it in programs. Thanks. (I have the same problem and it is making me crazy)

  • How to get rid of 'other' data

    I have masses and masses of 'other' data on my iphone. I have stripped it of all music (500 songs) and it has made no difference. I understand the data is most likely old apps etc not deleted properly, like a ghost trail. I have deleted all unnecessary texts, voicemails, calls, photos, internet history, etc. I have nothing left to delete data-wise. Does anyone know how to get rid of this 'other' data? It was literally taking 6.8gb of my 8gb phone, i have halved that by checking and unchecking 'automatically sync' in itunes, but still can't shift the rest. Really slowing my phone down

    Most of the "other data" on my phone is the forced IOS 7 upgrade from Apple.
    They push the upgrade(around 850 mb) and also reserve another huge chunk of space on the phone  to do a backup and install on the phone (mine is about 2.5 gigs after some manipulation).
    If you do not want the upgrade, it just sits there on the phone.
    You can not remove it.
    Apple will not sign and allow you to restore IOS 6 to your IOS 6 phone.
    If you ever need to do a restore of the OS, you will be forced into IOS 7.
    When a new upgrade is pushed to your phone, the amount of confiscated storage will accumulate with each subsequent release.
    Apple can't be bothered to delete the older/outdated upgrade file being replaced by the new, hence the "other data" just grows over time. I have seen mine get to almost  6 gigs.
    You can use Itunes on your computer to "download only/ not install" the newest update, then do a restore of your data and a sync. This appears to remove all the outdated updates from the phone.
    You will however, still have about 2 gigs of your storage space still hijacked by Apple to store the most recent forced upgrade.
    I am still on IOS 6 and plan on sticking with it simply for personal preference and vision reasons, as that is my prerogative.
    It does perplex me why Apple refuses to make IOS 7 optional for users that have always had IOS 6. I can fully understand insisting that new devices run IOS 7, and obviously many IOS 6 users would have jumped anyway.
    Apple needs to add an asterisk to word *adoption rate of IOS 7 in their corporate guidance statements.
    They knowingly mislead given the current reality that ultimately no one can opt not to adopt it.
    Hotel Cupertino, "You can check out, but you may never leave"

  • I logged onto my MacBook Air and it is asking me for my "local items" keychain password for several different things. I do not know what this is or how to get rid of it. Please help. Thanks.

    I logged onto my MacBook Air and it is asking me for my "local items" keychain password for several different things. I do not know what this is or how to get rid of it. Please help. Thanks.

    There are several possible causes for this issue. Please take each of the following steps that you haven't already tried, testing after each one, until it's resolved. Back up all data before making any changes.
    Step 1
    Follow the directions in this support article.
    Step 2
    Open the iCloud preference pane and uncheck the Keychain box. You'll be prompted to delete the local iCloud keychain. Confirm. Then re-check the box. Follow one of the procedures described in this support article to set up iCloud Keychain on an additional device.
    Step 3
    Open the Keychains folder as in Step 1. There should be a file in that folder with the name "login.keychain". If there is also a file iwith the name "login_renamed_1.keychain", then please do as follows:
    Rename login.keychain to "login-old.keychain".
    Rename login_renamed_1.keychain to "login.keychain".
    You can then close the folder.
    Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    Delete the login keychain from the keychain list. Choose Delete References when prompted, not Delete References & Files.
    Select
    File ▹ Add Keychain...
    from the menu bar. Add back the file now named "login.keychain". If any of your needed keychain items are missing from it, also add back the file now named "login-old.keychain". I suggest you transfer any needed items from that keychain to the login keychain, then delete it. The transfers are made by drag-and-drop in Keychain Access. You'll need to enter your password for each item transferred.
    Select
    Keychain Access ▹ Keychain First Aid
    from the menu bar and repair the keychain. Quit Keychain Access.

  • I cant update nor download any applications. My password was always invalid. And other username is prompted richardca0521@yahoo.ca which is not my account. How to get rid of this apple id and use my account for download? I have registered this to itunes.

    I can't update nor download any apps in itunes. Prompted invalid password, upon checking the apple id was not mine. The id was [email protected] whic is not mine. Pls. Help how to get rid of this. Thank you.

    try and delete the apps and re-add them

  • I have a new iPhone 5S.  While trying to learn about it, I accidentally recorded a voice memo with no content.  I cannot now figure out how to get rid of it.  There is a banner across the top of my phone with this memo which I don't want.  Help!

    I have a new iPhone 5S.  While trying to learn about it, I accidentally recorded a voice memo with no content.  I cannot now figure out how to get rid of it.  There is a banner across the top of my phone with this memo which I don't want.  I have deleted it from iTunes but cannot get it off the phone.  Help!

    The banner usually indicates that the memo is "Paused." If you go back into voice memos, touch the word "Done" beside the big red pause button, give it a name, then it will show in a list. Touch the memo in the list then touch the trash can icon that should appear.

  • How to get rid of Safari !!!!!

    I must have missed the message to install Safari during one of the many iTunes updates and now I'm stuck with it on my computer taking up 60GB of space! I've tried removing it through Control Panel -> Uninstall Programs, but get the message that I don't have administrator privilages - which I do. Thinking I may have had this installed while I was logged in under my main administrator name, I logged off and logged back in under my only other user name and tried again - same message. So I went to the Safari folder and changed all security privilages to full access for both accounts and it still won't uninstall. How can this program claim I don't have administrator privilages when I used the only two user accounts on my computer?? So in a fit of defiance and desperation, I deleted the Safari folder and then ran the name "safari" in Vista's search box under the Start menu (I even included the wildcard .* to catch all examples). Guess what? Rather than find all traces of safari on my computer so I could delete them manually, Safari started running again!! I cancelled the program before it finished loading and went to recheck the Program Files folder and Safari was back there with a full 60GB of files again! I CAN'T GET RID OF IT!!
    Safari is a malicious software program as bad as any Malware or Adware I have ever seen! How can I get rid of it??
    (and no, I really do not want Safari - I don't care if you think its the greatest thing since sliced bread - I make the choices on my computer, not some software engineer or marketing division and I DON'T WANT SAFARI!!)
    Any suggestions on how to get rid of it? Did I miss something?
    Thanks all,
    LH

    The Safari update is not clear what it is and provided no explanation of what it was - it simply states "Safari". For all I know it could have been an indexing file for iTunes. There was no explanation as to what is was and the install checkbox was already checked so the unsuspecting may quickly and accidentaly hit install along with the iTunes update, thinking it was a required part of iTunes. Regardless of how it got there, I'm trying to get rid of it and it won't uninstall.
    Now you may fancy yourself as some kind of wunderkind software expert, but you apparently do not know Vista because it really does take up 60 GB and every time I delete it, it tries to reinstall itself. These are not multiple installations and I am the only user on this computer. You haven't offered me any help - only insults. If you aren't willing or able to offer help or assistance in the most sincerest form this request was intended, than stay out of this thread. Your actions and insults reinforce the prevailing belief that Apple users are unkind, rude, self-important snobs.

  • HT5622 how to get rid of an old apple ID on my iphone 5 . the ID belongs to a store where I bought my phone ,and it's in a different country ??

    How to get rid of an old Apple ID on my iphone 5 ? The ID belongs to a store I bought my iphone from ,and it's in another country.

    You can't.  That's the new security feature of iOS7 that users (and others) requested to prevent stolen devices from being restored by theives and reused.  Contact the "store" you purchased your phone from and see what they say.

  • When I try to buy something, I get an Apple-ID which is not the one I want to use, and I don't know how to get rid of it either, so that I can use my ID, which is in Mail, Contacts etc. The ID I get, I can't find, so that I can delete it. What to do?

    When I try to buy something, I get an Apple-ID which is not the one I want to use, and I don't know how to get rid of it either, so that I can replace it with my ID in Mail, contacts etc. The ID I get without wanting it, I can't find anywhere. I have to delete it. How do I solve this problem, anyone?

    My content was obtained through another ID, which popped up earlier. Now this one doesn't pop up, and my current ID doesn't pop up either, but another one. How do you find an ID which is not in the store, and not in Mail, contacts etc. either?
    Or is it possible to write the ID yourself when you want to buy something, not only to have it popped up being unable to be changed?

  • I have very thin, colored lines running vertical on my desktop monitor screen.  I don't know where they come from or how to get rid of them.  I started with one and now have three.  Can anyone give me some insight about what to do in getting rid of them?

    I have very thin, colored lines that have shown up on my IMac monitor screen.  I don't know where they came from or how to get rid of them.  I'm concerned now because I started with one and now have three.  Does any know why this occurs or how to get rid of them?

    I got an address from Applecare, although I can't place my hand on it right now. I didn't bother persuing the letter route myself as I didn't expect much. I know that the location was Cork, Ireland though as that where the UK Applecare is based as far as I'm aware. The best thing to do is to call Applecare (if it's free) and discuss the issue. State that you are not happy wit the fact that you will have to pay to have the problem resolved especiiay if it is an ongoing problem that has not been resolved. I ended up speaking to a senior manager of the Applecare team who then proceeded to tell me about mailing in my grievence to customer services division or something like that.
    If I can find the address I may post it if I'm allowed.
    In the case of age, Schools usually have a 5-year life-cycle as they tend to be used differently than consumer machines, i.e. being used constantly on a daily basis for at least 12 hours with no break. you would expect issues to appear after a few years, but I expect problems that arise through defects to be resolved and stay resolved. As I mentioned we had machines for around 2 years before the lines appeared and sent them to be repaired. I'm happy with that. What I am unhappy about is the fact that the problem has reappeared exactly in the same way and now I'm left with around 7 machines that I either pay loads to repair or, the more likely replace the machines with newer ones since the age is now big enough to warrant the replacement.
    Sorry for the lengthy moan, but these are the reasons I purchased Apple ahrdware in the first place to avoid the "not our problem" stance some PC vendors  usually take, similar to the Dell monitors thread mentioned in here somewhere.

Maybe you are looking for

  • Insufficient privileges when creating user logged in as SYS

    Hi, I'm working on 11.1.0.6.0 Enterprise Edition, Advanced Security options, Label Security a and Database Vault installed. (for testing purposes) I'm creating a new user being logged as SYS using this sentence: CREATE USER "HR_DIRECTOR" PROFILE "DEF

  • Problem with deep structure in Adobe Forms

    Hi , I am converting smartform into adobe forms. While converting the program code in the code initialization of the smart forms also get transformed to adobe forms the problem is my internal table is of type deep structure while passing it through t

  • Installed mac osx10.4 now my computer wont start!!

    installed mac osx 10.4 on my powerbook G4 now my mac wont work when it starts up it gets stuck on the starting mac osx scren the bar across the screan only loads about 1cm accross the scren then frezzes PLEASE HELP powerbook G4   Mac OS X (10.4)  

  • New AJA Kona drivers for CS6

    New AJA  Kona drivers for CS6 are posted for download. Link to PC version. http://www.aja.com/en/support/kona/pc/kona-3/ Link to Mac version http://www.aja.com/en/support/kona/mac/kona-3/

  • OWB repository

    Hi all, I'm doing a fresh installation of OWB. I have 2 servers and I want to install the OWB in one server and OWB Repository in the other. There is any way to do this? I'm using 11g R2. Thanks!