Problem going over a Set  in java 5.0

Hi Guys!
I'm "translating" working code in NIO to the tiger version, and i'm having trouble with going over a Set returned from select().
Runing the following code fails on iter.remove() and i get a java.lang.UnsupportedOperationException. Couldn't find an example that work.
for (Iterator<SelectionKey> iter = connectionSelector.keys().iterator(); iter.hasNext();)
            SelectionKey key = iter.next();
            iter.remove();
            if (key.isAcceptable())
                handleAccept(key);
            else if (key.isReadable())
                handleRead(key);
}  Thanks for any help,
snayit

You will probably find that the collection is an unmodifiable version. From the 5.0 API
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html
Collections.unmodifiableCollection(Collection<? extends T> c)
Returns an unmodifiable view of the specified collection. This method allows modules to provide users with "read-only" access to internal collections. Query operations on the returned collection "read through" to the specified collection, and attempts to modify the returned collection, whether direct or via its iterator, result in an UnsupportedOperationException
Check the Set and Iterator implementing classes using:
System.out.println(mySet.getClass().getName());
System.out.println(mySet.iterator().getClass().getName());Cheers, Neil

Similar Messages

  • Setting up new iphone from a back up and it's trying to sync all apps, this is going over memory capacity.  it's also not bring over any of the music that i had on my old phone, any help greatly appreciated. thanks

    hi,
    i'm setting up new iphone from a back up and it's trying to sync all apps, this is going over memory capacity.  it's also not bring over any of the music that i had on my old phone, any help greatly appreciated. thanks

    Geesh - all this information and no  one has any clue to this? Not even someone from Apple?
    Can someone at least point me in the right direction?

  • [SOLVED] Image going over the size of my TV

    I just upgraded my TV to a 47'' panasonic SmartTV from my old LV 32'' one.
    I connect it via HDMI for video playback and xbmc use: The video card is a nVidia GT 240
    The problem I'm facing is, at 1080p @ 60Hz, the image goes over the edges of the TV, like is bigger than the tv itself, so you lose some inches from each side.
    At 720, the image looks to fit right but this is not the desired resolution.
    I use nvidia-settings in order to tweak xorg.conf, but I had to add some options by hand for the fonts to have 96dpi.
    Can anyone help me to find the solution for this?
    I have a windows partition for gaming and when I booted it up for testing i faced the same issues.....
    Thanks!!
    Last edited by Xi0N (2013-07-21 20:14:23)

    The problem is the TV itself. I have no idea why, but regular HD TVs usually cut a few pixels from each side, doing a slight zoom in. This is called overscan. You can usually disable this in the TV settings by setting the image size to "fullscreen" instead of 16/9.
    Some quick Googling gave me this article, it seems pretty detailed (I'm learning myself right now why all TVs do this).

  • If my machine goes over 100mbit it stops responding

    I recently converted a FreeBSD 7 machine to Arch Linux (2.6.35) and now whenever it goes over 100mbit it stops responding. I thought it might have just been network problems so I got KVM over IP from my datacenter and the console is frozen as well when it happens. No helpful errors in /var/log/* or on console either.
    /var/log/dmesg.log wrote:r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
    r8169 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
    r8169 0000:02:00.0: setting latency timer to 64
    r8169 0000:02:00.0: irq 42 for MSI/MSI-X
    r8169 0000:02:00.0: eth0: RTL8168c/8111c at 0xffffc9001027c000,
    00:1d:92:fc:e1:d6, XID 1c4000c0 IRQ 42

    Check if your network chipset isn't overheating (use your finger to see that... its easy to feel when there are problems ) My r8169 get's extremely hot and I now have an heatsink on it to help cooling (and the heatsink gets super hot to touch, imagine without it...).
    never had any network failure.
    Last edited by TigTex (2010-10-30 21:29:31)

  • HT202213 Home sharing problem: I have never set up home sharing but I feel I understand it.  I recently (last 2 months or so) deauthorized, first time ever, all computers with my iTunes account. I am trying to set up home sharing but get  iTunes says "You

    Home sharing problem: I have never set up home sharing but I feel I the concept and how it works.  I recently (last 2 months or so) deauthorized, first time ever, all computers with my iTunes account. I have 3 computers authorized.  I am trying to set up home sharing but get  iTunes says:
    "Home Sharing could not be activated because this computer is not authorized for the Apple Id "#########@###.com". Would you like to authorize now?"  I click "authorize" and get the next error " You cannont authorize more than 5 computers.  You have already authorized 5 computers with this Apple ID.  To authorize this computer you must first deauthorize one of the other computers."
    Can someone help or shed more light on my problem?
    Thanks,
    Richard

    Home Sharing is designed to work on your local network not across the internet/cloud.
    Stuff is accessed under the Computers column where your local iTunes library on a local computer would appear.
    Home Sharing would share your iTunes content (i.e. stuff stored in itunes on the computer, not in the cloud) with AppleTV or an iPad etc on the SAME network.
    AppleTV2 will not be able to see itunes content on the work computer over the internet.  It's not designed to.  if the work computer was on the home network it would.
    iCloud is in it's infancy and is not a mature product - iTunes TV Show purchases appear on AppleTV, but currently music does not unless you are subscribed to iTunes Match. I find this rather odd to be honest, along with the inability to buy music on AppleTV2.  Movies purchased in iTunes are not authorised for iCloud viewing currently either.
    Maybe it has something to do with iTunes Match 'getting in the way' - i think they assume you'll use that whereas you really want to be able to access Purchased music from the cloud without subscribing to itunes Match which is overkill for some.
    AC

  • The KitKat upgrade has been a disaster. home wireless is no longer recognized, even going through the set-up process.  It does not connect to the car through Bluetooth seamlessly--I have to add my phone as a new device each time I get in the car.  In atte

    My home wireless is no longer recognized, even going through the set-up process.  It does not connect to the car through Bluetooth seamlessly--I have to add my phone as a new device each time I get in the car.  In attempting to solve these problems I have gone to settings-phone-upgrade and it states that the upgrade is available-select to continue-(which I do)- it checks -please wait and it then states that update not available - try later.

    Maybe not too late to help you.
    For specifically fixing the Bluetooth, un-pair your phone with the car, and go through the process of repairing the two.
    In general, the KK update requires many of us (different phones) to perform a Factory Data Reset after we back up our personal content (pictures, music, movies, or other downloaded files) to a PC or MAC. This will result in you having to do a bit of work to setup icons for the programs you use, and maybe putting in the specifics again for email accounts and other specialized apps. So if you are going to do this sort of thing... copy important information/settings down on paper.
    HTH.

  • I want to know how to get the web addresses to go away that appear in the bottom left corner of the browser every time my mouse goes over a link

    Any time that my mouse goes over a link on a web page a little box in the bottom left corner of the browser pops up showing the web address for that link and it is really annoying, especially when i am on facebook because there are so many links on the home page i cant move my mouse anywhere without that box popping up and blocking part of my conversations. I was wondering if there was any way to turn this off. I've checked through the options and to my knowledge there is no way to turn it off. Just wondered if anyone else has had this problem or knew if there was a way to get that box to go away.

    Another option would be to use the following extension to push those messages into the status bar. It could be a convenient way to have your messages visible when you want them, but with less distraction.
    https://addons.mozilla.org/en-US/firefox/addon/status-4-evar/
    If you try it, let us know what you think.

  • Quite often when I plug in my iPad 2, iTunes goes to the "Set Up Your iPad" screen and makes me restore it. Any way to stop this?

    I have had my iPad 2 since the start of June 2011. There are a lot of times when it works great, but I have had trouble sometimes when I sync. Prior problems were with SQLite3.dll, but got help copying that file to the right place. I have also completely uninstalled and re-installed iTunes. However, my biggest problem is that sometimes when I plug it in to sync with iTunes, it automatically goes to the "Set Up Your iPad" screen. It only allows me to set it up as a new iPad, or restore it from a backup. This is happening more and more. So much so that everytime I plug it in and it actually does work, before disconnecting I will right click on the iPad on the left hand bar and do a backup. This is really starting to get on my nerves. I'm not doing anything out of the ordinary with my iPad. Just playing some games and having a few other apps. It's so hard when playing some games like Angry Birds, getting 3 stars in all levels, only to plug the iPad in again to sync and have to restore it and lose all progress! Does anyone know why it goes to this screen? It doesn't happen all the time, but I'd say once every 4 times I connect. Also, I'm using Windows 7, and yes, all windows updates are done, and iTunes always is on the most up-to-date version. Thanks for any help!

    Normally, I would suggest restoring the iPad and uninstall and reinstall iTunes but you have done both of those things - more times than you ever imagined!
    Have you thought about turning auto syncing off?
    Without connecting your iPad to your laptop, start iTunes. Click on Edit. Click on Preferences. Click on Devices. Check the box next to "Prevent your iPod etc. from automatically syncing." Click OK.
    If you do this you can backup the iPad right away before it syncs. You may want to go into all of the iTunes tabs and just make sure that all of the current content on the iPad is selected to sync before you actually do sync.
    This doesn't solve the problem, but it would prevent the automatic sync and erasing content. Hopefully, in the next few days- when iOS 5 is released - you will also be relieved of this weird iPad behavior - since the iOS devices are supposed to become PC free.
    BTW - and this is no excuse for what you are experiencing, but I have found that some of the game apps that I had on my iPad turned out to be quite troublesome and after I removed them, my problems went away. I know that is almost sacrilege with regard to the Angry Birds addiction .... But I'm just saying ...

  • Satellite C660 - Touchpad highlighting everything it goes over

    I have a problem with my Satellite C660 with the Synaptics touchpad V7.2 sensitivity. The cursor keeps highlighting everything it goes over and dragging the files or programmes or opening them.
    It's driving me mad and restoring it to a previous date doesn't stop it, nor does clicking the tapping function off in the Synaptics properties box or reverting to default.
    Anyone out there able to help?

    Hi
    Try to install the Synaptics latest driver from the Synaptics driver page:
    http://www.synaptics.com/en/drivers.php
    Furthermore you can adjust the touchpad settings in control panel -> mouse -> device settings -> settings button
    Here you would find lot of different options which would improve the touchpad functionality.

  • Anyone going over their Data now that they have a Samsung S5?

    I just recently (3 weeks) purchased a Samsung S5 and it shows I am using Data when I am positive I am connected to WIFI (such as I am at home and I know our WIFI is working). We're going over our data limit for the first time ever. It even shows data usage this morning while I was at home and again...the wifi is working at home. Anyone have any answers?

    Go into Settings ... Data Usage, and look at your Mobile data and wifi usage.  Which apps are using the mobile data? 
    We have 4 lines on our family plan, and over the years have had several smartphones (iPhones, Blackberry, Android and Windows phones, various models).  Only once did I see a data "spike", when my daughter first got her iPhone 5C.  It was gobbling data, till she went into her app list and shut off the data for lots of things. 
    Whenever we get a new (smart) phone, I typically don't activate it until I have used wifi to download all my apps and get my email hooked up.  Once it all works on wifi, then I'll activate the new phone.  I make sure my apps are set to update over wifi only (it may be a setting within each app), and my photos are backing up over wifi only.  Facebook now auto plays videos, and you need to change the setting to play videos on wifi only.  Same with email - set it to down load attachments over wifi only.
    There are lots of ways data your device can use data; finding out which apps and what processes are the culprits (by looking at the data usage on the phone) can help you to use your data allotment most effectively.

  • I am trying to sync my music library to my new iPhone 5C and cannote seem to get the music to sync.  It is in the library but isn't going over to my phone.

    I am trying to sync my music library to my new iPhone 5C and cannot seem to get the music to sync.  It is in the library but isn't going over to my phone.
    I must be doing something wrong during the sync (something checked when it should not bet, etc)  Need some help.  Thanks!!

    Manually manage music is NOT checked.  I backed up all my phone information from my old 3GS phone to my computer, then connected my new phone to sync.  Everything else seems ok but music won't transfer.  It is set to automatically sync when connected.

  • [svn] 3127: Updating asdoc to replace the avmplus call with new set of java files.

    Revision: 3127
    Author: [email protected]
    Date: 2008-09-05 14:16:53 -0700 (Fri, 05 Sep 2008)
    Log Message:
    Updating asdoc to replace the avmplus call with new set of java files.
    Removing all files related to asdochelper.
    QA: Yes, also please test on non windows platform.
    Doc:
    Tests: checkintests, asdoc
    Reviewed by: Pete Farland
    Modified Paths:
    flex/sdk/trunk/asdoc/templates/ASDoc_Config_Base.xml
    flex/sdk/trunk/asdoc/templates/asdoc-util.xslt
    flex/sdk/trunk/modules/compiler/build.xml
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocAPI.java
    Added Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsClass.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocHelper.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/QualifiedNameInfo.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/SortComparator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va
    Removed Paths:
    flex/sdk/trunk/asdoc/templates/asDocHelper
    flex/sdk/trunk/asdoc/templates/asDocHelper.linux
    flex/sdk/trunk/modules/compiler/asdoc/

    I had a generic record class that has a HashMap to hold the data fields (...)
    method called createRecord() for each record type which would populate the HashMap with the correct data fieldsI'm not sure I understand: are the contents of this field map the same between two records of the same type? Then yes, you don't need to clone the map per record instance.
    one thing that needs fixing is the fact that each time the createRecord() method is called I'm creating a new fieldMap to define the dataFields in the record class.Probably, but that will only get you a little bigger files; you won't gain an order of magnitude on the size of files. The problem for huge files is that as soon as their content is bigger than the available memory, you'll run into problems. A more radical approach if you need to address huge files is to process the records on the fly, and not load all records in memory. Of course not all algorithms or business logic can afford that...
    I know I could rewrite the code and create a class for each record type and declare the fieldMap static but I was wondering if anyone had any better suggestions The Record instance could receive and keep a reference to its RecordType instance, and ask the RecordType instance the DataType for a field's name. That way the RecordType encapsulates the map, and there's less risk that a clumsy other class modifies the static map.
    before I go rewriting a load of code.A load of code?!? Even with the idea of the static map, you only have to edit the enum type (well more accurately, each RecordType enumerated constant's createRecord() method).

  • Problem with updating oracle DB with java date thru resultset.updateDate()

    URGENT Please
    I am facing problem in updating oracle database with java date through resultset.updateDate() method. Can anybody help me please
    following code is saving wrong date value (dec 4, 2006 instead of java date jul 4, 2007) in database:
    ResultSet rs = stmt.executeQuery("SELECT myDate FROM myTable");
    rs.first();
    SimpleDateFormat sqlFormat = new SimpleDateFormat("yyyy-mm-dd");
    java.util.Date myDate = new Date();
    rs.updateDate("myDate", java.sql.Date.valueOf(sqlFormat.format(myDate)));
    rs.updateRow();

    I believe you should use yyyy-MM-dd instead of yyyy-mm-dd. I think MM stands for month while mm stands for minute as per
    http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    (If this works, after spending so much of your time trying to solve it, don't hit yourself in the head too hard. I find running out of the room laughing hysterically feels better).
    Here is a more standard(?) way of updating:
    String sqlStatement=
    "update myTable set myDate=? where personID=?"
    PreparedStatement p1= connection.prepareStatement(sqlStatement);
    p1.setDate(1,new java.sqlDate());
    p1.setInt(2, personID);
    p1.executeUpdate();

  • TS3989 photos from my iphone are not going over in icloud to my ipad? both have photostream on any ideas?

    photos from my iphone are not going over in icloud to my ipad? both have photostream on any ideas?

    Are these photos that were on your iphone before you set up photo stream?  If so, too late.  Only photos taken after setting up photo stream are synced.

  • Mobility manager doesn't work when going over ICT

    Mobility manager is working properly if a phone on the same call manager or a phone through the PSTN calls but does not work if the call goes over the SIP trunk.  We can make it work by checking the MTP required on the ICT but this results in video calls that do not work.
    When I call a person across the ICT both devices ring, his desk and his mobile.  If he answers on his mobile, he gets dead air and his desk phone just sits there, does not get a red light as it normally does.  My call continues ringing and then after about 10 seconds goes to a fast busy, any thoughts on what I should check?

    I am having the same problem, any help?

Maybe you are looking for

  • Streaming video from Macbook Pro to 46 inch LCD

    I am trying to stream video from my 13 inch Macbook Pro to my 46 inch Samsung LCD TV. I am using a HDMI cable to a DVI cable to attach the computer. When I play videos from iTunes, the picture looks great, however when I am streaming video from an in

  • Multiple Blob downloads in one report cell

    Hi all, I want to create an interactive report. This report is based on 2 tabled that are joined. one table has topics in it the other documents attached to the topics. the problem i'm facing is that a topic can have multiple docs attached to it. At

  • Publishing WEBI report in Portal

    Hi I am trying to publish a WEBI report in our portal. I initially tried using the BusinessObjects Enterprise Integration Kit - IView Template, but have since been told via my OSS call that is the incorrect template to use, as that is for Crystal Rep

  • How can I size a TIFF in Lightroom?

    How can I size a TIFF in Lightroom to 50 MB? It's so easy in ACR. Thanks Dennis Hallinan

  • Rotating 3-D emitter

    Hi, I've got a 3-D emitter: 3D checked, emitter = sphere, arrangement= outline, birthrate 0, velocity 0, initail number = high enough to spread a particles over the surface to clearly indicate a sphere. When I scrub through the y-rotation (of the emi