10 messages in com.googlegroups.google-calendar-help-dataapiRe: Incompatible types in sample code...
FromSent OnAttachments
Andy21 Jul 2006 08:58 
Darren Hinderer23 Jul 2006 22:03 
Andy24 Jul 2006 00:53 
Sanjay24 Jul 2006 21:41 
Andy25 Jul 2006 00:32 
Derek25 Jul 2006 07:22 
Frank Mantek25 Jul 2006 07:31 
Andy25 Jul 2006 09:11 
Frank Mantek25 Jul 2006 09:25 
Andy25 Jul 2006 13:38 
Subject:Re: Incompatible types in sample code of Java Client Library
From:Darren Hinderer (hind@gmail.com)
Date:07/23/2006 10:03:59 PM
List:com.googlegroups.google-calendar-help-dataapi

Typecasting has been left out of the java examples for some reason, but I've never seen them work without it.

As far as I know you will have to cast myEntry to BaseEntry like so: EventEntry insertedEntry = myService.insert(postUrl,(BaseEntry) myEntry);

On 7/21/06, Andy <andr@gmail.com> wrote:

I have been trying out the Java Client Libary attempting to write to GCal, but I've been unsuccessful at getting rid of a build error "incompatible types" in the last line below.

EventEntry myEntry = new EventEntry(); URL postUrl = new URL("http://www.google.com/calendar/feeds/andxx...@gmai@ "); EventEntry insertedEntry = myService.insert(postUrl, myEntry);

I get:

found : com.google.gdata.data.BaseEntry required: com.google.gdata.data.extensions.EventEntry EventEntry insertedEntry = myService.insert(postUrl, myEntry); ^ 1 error

(The ^ is under postUrl)

When I look at the GoogleService class, the parameter types match what I'm sending. The only thing I can imagine is that it might be confusing the EventEntry type with it's parent type BaseEntry.

I have no experience with Java (I wish the Client Library were available in Python). Can anyone see anything missing? Or is there something wrong with the client library? Any insight would be most appreciated.