Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bad operand types for binary operator '!=' Error

Johannes KernJul 29 2015 — edited Jul 30 2015

Hi,

I'm getting the following compilation error:

bad operand types for binary operator '!=';  first type:  oracle.jbo.domain.Date;  second type: <null type>

when I try to compare a Date object with null, for example:

    public static Calendar jboDateToCalendar(Date d) {

        if (d != null && d.getValue() != null) {

            Calendar c = Calendar.getInstance();

            c.setTime(d.getValue());

            return c;

        }

        return null;

    }

I'm using JDev 12.1.3. running with Java 1.7.0_75.

Does anyone have an idea? Never saw this error before.

Brackets don't help btw.

Thanks

Johannes

This post has been answered by Johannes Kern on Jul 30 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2015
Added on Jul 29 2015
8 comments
1,429 views