Unchecked invocation sort(list) error... please help.

this is the code I have problems with...
List contacts = Contact.search(searchParameters,
                              toContactTypeArray(
                                        contactSearchForm.getSelectedSearchLocations(),
                                        contactSearchForm.getContactTypeLocationDisplay()));
                         //todo alphabetize
                    Collections.sort(contacts);
the contact search was working fine until I added a sort to the code... now I get this message :
Type safety: Unchecked invocation sort(List) of the generic method sort(List<T>) of type
Collections
I am just taking over this project and It apears that the person before me used myEclipse to generate much of the code... I am having a hard time getting arround certain things like this.
Thanks for your help folks! Bryce.

Basically from what I read, your list needs to implement the Comparable class, and the elements in the list must all be comparable to each other (i.e. all strings, or all doubles, or all integers, or all a specific type of class or may have the same base class, etc.) If it's a custom list, try this (replace myContactTypeList with whatever your list class is named.)
List<myContactTypeList> contacts = Contact.search(searchParameters,
toContactTypeArray(
contactSearchForm.getSelectedSearchLocations(),
contactSearchForm.getContactTypeLocationDisplay()));
//todo alphabetize
Collections.sort(contacts);
You will pretty much always get a warning with generics. But, if you happen to do a clone of an ArrayList at any point, do this instead (it removes the warning, and should work...code hasn't been tested):
Iterator i = myOriginalList.iterator();
Double value; while((value = (Double) i.next()) != null) { DataList.add(value); }

Similar Messages

  • Message 3506-9 Price List Error - Please Help

    Thank you in advance for your help - here is my question:
    I am attempt to make a new price list using the following under Modules:
    Inventory --> Price Lists --> Price Lists
    When on the Price Lists Form, I right click on the last row and click on "Add Row".  I then add my new price list name, my Base Price List (same as the price list name), my factor (1), and my Rounding Method (no Rounding).  I am also using the "Update Entire Price List" option so I go ahead and click on "Update".
    Unfortunately, the next screen I receive is labeled as "Price Lists" and shows an error message as follows:
    "Variation between number of price lists and number of price lists for items [Message 3506-9]"
    I have checked the number of Distinct Price Lists in ITM1 and there are four. My current number of Price Lists in OPLN is four.  I do not understand what is causing this message and why it is preventing me from adding another price list.  Thank you for your advice on what this message means and if there are any solutions.
    Here is my SAP version information:
    SAP Business One 2007 A (8.00.177) SP:00 PL:38

    Hi Jeff Olmstead,
    We have investigated on the issue.
    This error message is related to price lists. Have you recently imported
    price lists or items into Business One?
    The problem is that the number of records in OITM does not match the
    number of records in ITM1. For every record in OITM
    there must be records in ITM1 according the number of price list in B1
    E.G. if I have 20 items and 10 price list I should have 200 records in
    ITM1. This situation can happen during import data from external
    application and not directly from B1.
    Please run the following queries to locate the problem:
    This will give you the number of items in your system:
    SELECT Count(T0.ItemCode) FROM OITM T0
    This will give you the number of price list in your system:
    SELECT Count (T0.ListNum) FROM OPLN T0
    Multiply the result of the two queries.
    This should match with the result of the following query:
    SELECT Count(T0.ItemCode) FROM ITM1 T0
    If this does not match this means that not all items are linked to all
    price lists, which in turn will not allow you to create or update
    an existing price list.
    There are 3 diffarent scenarios that can caouse this problem -
    1. Items exist in OITM and does not Exist in ITM1:
    To locate these items please execute the following query to find the
    items that are not linked.                                                              
           SELECT T0.ItemCode as 'OITM', T1.ItemCode as 'ITM1'
           FROM OITM T0
           LEFT OUTER JOIN ITM1 T1 ON T0.ItemCode = T1.ItemCode
           WHERE T1.ItemCode is NULL
    If you enter a price into the master data the link will be created. You
    can also enter the price in the pricelist.
    2. Items exist in ITM1 and does not Exist in OITM:
    To locate these items please execute the following query to find the
    items that are not linked.
           SELECT T1.ItemCode as 'OITM',  T0.ItemCode as 'ITM1'
           FROM ITM1 T0
           Left JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
           Where T1.ItemCode is NULL
    3. Items do not Exist in in all price lists (Records are missing in
    ITM1):
    To locate these items please execute the following query to find the
    items and price lists missing from ITM1.
          select itm1.itemcode,
               itm1.pricelist,
               a.listnum,
               a.itemcode,
               oitm.createdate
          from   itm1 right join
                (select itemcode, listnum from oitm, opln) as a
               on itm1.itemcode+ convert(nvarchar, itm1.pricelist) =
    a.itemcode+ convert(nvarchar, a.listnum )
               inner join oitm on a.itemcode  = oitm.itemcode
                 where  itm1.itemcode is null
                 order by 5,1, 4,3
    If the query retrieves any results, please contact your Support Center.
    Hope this helps.
    Best Regards,
    Summer Ding
    SAP Business One Forums Team

  • Sort a string :: Please help.

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
                   return str;
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

  • Windows - No Disk Error - Please help!

    Windows - No Disk Error - Please help!
    Hi,
    I have the following set up:
    * Lenovo T-61p
    * Windows XP Pro, SP 3
    * HP Photosmart 8250 printer (with nothing plugged into the various card readers, and USB slot in the printer)
    I am getting the following error:
    Windows - No Disk
    Exception Processing Message 0xc0000013 Parameters 0x75CE023C
    0x84C40C84 0x75CE023C
    I have done a lof experimenting and thru process of  elimination, and believe I have determined that this only happens when the HP Photosmart 8250 printer is plugged in to the USB slot of the computer.
    I can stop it from happening by safely removing hardware, and removing the drive that the 8250 creates on your computer when you plug it in.  In my case, this is drive E.  I'm guessing if there was something in the the various card readers, and USB slot in the printer, that's what those would be, but I don't those use those functions of the printer.
    I understand there is more at work than simply the printer, because I did not used to get this error, so some software changed as well, that is scanning all ports, and finding a drive that has no disk, and producing the error.
    A simple google search finds a lot people all over the world having this problem, and are solving it in different ways, because the suspected source is different: Norton, HP, etc.
    I have tried everything I have read, and the only thing that works was my own idea, of manually safely removing the drive the printer creates each time I plug in the printer.
    Anyone every any better, more permanent solutions?  Or know what the real root of the problem is?  What is scanning all the drives and being showing an error message because it found an empty drive?
    Thanks and Happy Holidays/New Year!

    I've been getting the same error on my 4G nano for the past week. I've had my nano for about a month and the first few weeks were fine. Tried it on 2 different computers (Vista and XP) and same problem. Tried it on a 3rd (XP) and it started ok. Problem started coming back after a day.
    I was able to find a quick fix though. I noticed that sometimes the message says something like "iexplore.exe... no disk..." even if I don't even use IE. What I do is end iexplore.exe on task manager before running iTunes and syncing my nano. I don't get the error whenever I do this, but one drawback is that the contents of my nano suddenly pops up in a window - even when disk use is not enabled.
    I've reset/restored my nano dozens and dozens of times to make sure it's clean. Leads me to believe it's a driver issue. Either that or I have a friggin malware problem I can't seem to find.
    I'll be posting updates every now and then. I'm no expert so I'm hoping an Apple expert also steps in to give some input.

  • My ipod generation 5 will not come out of recovery mode. i was simply updating my software and this happened. it will not let me restore it comes up with and error. please help, thanks.

    my ipod generation 5 will not come out of recovery mode. i was simply updating my software and this happened. it will not let me restore it comes up with and error. please help, thanks.

    Hey erinoneill24,
    Thanks for using Apple Support Communities.
    Sounds like you can't update your device. You don't mention an error that it gives you. Take a look at both of these articles to troubleshoot.
    iPod displays "Use iTunes to restore" message
    http://support.apple.com/kb/ts1441?viewlocale=it_it
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808?viewlocale=de_DE_1
    If you started your device in recovery mode by mistake, restart it to exit recovery mode. Or you can just wait—after 15 minutes the device will exit recovery mode by itself.
    Have a nice day,
    Mario

  • I cannot use iCloud on Windows 7, as it won't recognize my apple ID when i try to sign in to icloud it i get error saying "you can't sign in because of a server error (please help some one)

    I cannot use iCloud on Windows 7, as it won't recognize my apple ID when i try to sign in to icloud it i get error saying "you can't sign in because of a server error (please help some one)

    Although your message isn't mentioned in the symptoms, let's try the following document with that one:
    Apple software on Windows: May see performance issues and blank iTunes Store

  • HT201442 I did this but still i am getting the same error , please help me .

    I did this but still i am getting the same error , please help me .
    <Email Edited by Host>

    Look at http://support.apple.com/kb/ts4451
     Cheers, Tom

  • I am not able to update my iphone 4 ,when ever i tried to update it its show 1309 error...and at times 9006 error ,please help me ..

    i am not able to update my iphone 4 ,when ever i tried to update it its show 1309 error...and at times 9006 error ,please help me ..

    Hey alkarim2008,
    If you are having an issue with being unable to update or restore your iPhone, I would suggest that you troubleshoot using the steps in this article - 
    Resolve iOS update and restore errors in iTunes - Apple Support
    Thanks for using Apple Support Communities.
    Happy computing,
    Brett L 

  • My iphone won't pass the connect to itunes. when i try to restore is says that there is an error. please help!

    hi my iphone is broken. it won't pass the connect to itunes. when i try to restore is says that there is an error. please help!
    thanks,
    jg2013
    <Subject Edited by Host>

    Hello, 02633. 
    Thank you for visiting Apple Support Communities. 
    If your iPhone is disabled, you will need to process the steps in the article below.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Cheers,
    Jason H.

  • HT4623 I have updated my iphone with the current software but it is showing you need to connect to  of itunes to activate your phone, when i did that it is continuously showing an error.please help me to get through.

    I have updated my iphone with the current software but it is showing you need to connect to  of itunes to activate your phone, when i did that it is continuously showing an error.please help me to get through.
    Kindly Activate my phone.

    Rajan Gupta wrote:
    ...it is continuously showing an error.
    See here  >  http://support.apple.com/kb/TS3424
    Also see this discussion.
    https://discussions.apple.com/message/21189708

  • Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    - Try another payment method.
    - Contact iTunes
    Apple - Support - iTunes - Contact Us
    - Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • I need the drivers for earl 2011 macbook pro 13 inch i7 4 gigs for windows 7 64 bits i tried downloading with bootcamp butt it never completes allways ends up with an error please help

    i need the drivers for earl 2011 macbook pro 13 inch i7 4 gigs for windows 7 64 bits i tried downloading with bootcamp butt it never completes allways ends up with an error please help if any one has the drivers or knows were i can download them

    Doug...
    If you don't have it for reference, the manual might come in handy > US/Boot_Camp_Install-Setup.pdf
    After it loads, Command + F to find information regarding the drivers.

  • HT201210 hi i just bought my new iPhone 4s yesterday and when u opened it was not updated so when i tried SO MANY TIMES to update it on the devise and on my new mac it said that there was a unknown error please help me :)

    hi i just bought my new iPhone 4s yesterday and when u opened it was not updated so when i tried SO MANY TIMES to update it on the devise and on my new mac it said that there was a unknown error please help me

    Please tell us what kind of computer you have, what operating system and what version of iTunes. Not just "the latest version of iTunes", the exact version number.

  • I can't download the apple ios 5 for the ipad. after downloading around 10 % an error no. 3259 occurs. it's a network error. please help . it's urgent. i am having apple ipad 2 3G wifi

    i can't download the apple ios 5 for the ipad. after downloading around 10 % an error no. 3259 occurs. it's a network error. please help . it's urgent. i am having apple ipad 2 3G wifi.

    i switched off all the security settings and all the firewalls.
    i m unable to install any of the app on the ipad
    so i saw the apple support and it said to update the older version of my ipad.
    and niether am i able to download the update nor am i able to download any app and install it in my ipad2
    i also tried to download an .ipsw file (ios5 update) from torrentz bt i am also unable to install from that as itunes rjects that file and gives an error. and also tries to delete that file. plz anyone help urgently.

  • I have update my 3g software to 4.21 but its not working when it come to restoring firmware its show a error please help me out

    i have update my 3g software to 4.21 but its not working when it come to restoring firmware its show a error please help me out

    That error shows up when a phone is jailbroken or you are trying to downgrade the iOS version. Neither of which is supported by apple.

Maybe you are looking for

  • Which Makes Of DVD-Rs work?

    Hi Everyone I've been trying to burn a DVD to disc, but keep getting a message saying that 'this type of media is not supported'. From reading through the postings I gather that the G4 iMacs are pre-set to burn at X4 and can be temperamental with man

  • System Image Utility 10.4.11 Gather Image Fails

    Hello, I am having some issues with an XServe with 10.4.11 using System Image Utility to try and gather an image from a 10.4.11 computer. Can anyone help?

  • IOExceptions from java.io.File.getCanonicalFile()

    The javadoc for the java.io.File.getCanonicalFile() method says that it can fail with an IOException, saying: @ throws IOException If an I/O error occurs, which is possible because the construction of the canonical pathname may require filesystem que

  • Help in doing sum fields from tables

    HALLOW i have a table and i wont to add the tables line to one line , to do sum if date appear more then one time like in example. i give example date---- hours 01.01.2002 6.5 01.01.2002 2.5 02.01.2002 5 03.01.2002 3 03.01.2002 3 04.01.2002 4 06.01.2

  • FM for browsing the directory name in presentation server

    Hi All, Can somebody give me the FM for browsing the directory name (not the file name) in the presentation server so that the path comes automatically in the parameter. Thanks in advance. Regards, Arun Mohan