Results 1 to 3 of 3
  1. #1
    jackrush is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default int cannot be dereferenced

    Hi!

    While compiling from jdk1.4 to jdk1.6, I'm getting the following error. Can you please help

    [javac] C:\JBOSSCLIENTJDK1.6\Axiom\OMSClient\src\com\mss\o msClient\ClientController.java:951: boolean cannot be dereferenced

    Eg:

    if (authenitcationObj.getAuthenticated().booleanValue ()) {
    _userLoginID = authenitcationObj.getUserId();
    }

    [javac] C:\JBOSSCLIENTJDK1.6\Axiom\OMSClient\src\com\mss\o msClient\ClientController.java:1088: incomparable types: int and <nulltype>

    Eg:
    if (orders[i].getShowOnlyAmount() != null) {
    orderAmount = orders[i].getShowOnlyAmount().intValue();
    }

    [javac] C:\JBOSSCLIENTJDK1.6\Axiom\OMSClient\src\com\mss\o msClient\ClientController.java:1089: int cannot be dereferenced

    Eg:
    if (orders[i].getShowOnlyAmount() != null) {
    orderAmount = orders[i].getShowOnlyAmount().intValue();
    }

  2. #2
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    I don't think its a JDK thing. Looks like an Integer array got changed to an int array, and a Boolean value got changed to boolean. Switching the types back to Integer[] and Boolean[] should fix all of the problems.

    If you can't switch them back, removing the booleanValue() and intValue() calls should fix the 1st and 3rd problems. The second one depends on what getShowOnlyAccount() does. You might be able to get away with removing the if statement altogether, depending on what the getShowOnlyAmount() actually does. If you post the code for that method, I might be able to give you more help for that. However, my suggestion is to switch the types back to Integer[] and Boolean.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default

    What do those methods return?
    Like getShowOnlyAmount(), and getAuthenticated()?

Similar Threads

  1. How can I solve "void cannot be dereferenced" error?
    By fervent07 in forum New To Java
    Replies: 2
    Last Post: 04-05-2010, 09:54 PM
  2. Long Cannot Be Dereferenced?
    By caps_lock in forum New To Java
    Replies: 1
    Last Post: 01-18-2009, 02:49 AM
  3. Replies: 2
    Last Post: 11-30-2008, 04:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •