Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Null Pointer Exception when invoking .asOrderedSet in EOL query(Null Pointer Exception when invoking .asOrderedSet in EOL query)
Null Pointer Exception when invoking .asOrderedSet in EOL query [message #490339] Thu, 08 October 2009 12:06 Go to next message
Sajit  is currently offline Sajit Friend
Messages: 6
Registered: October 2009
Junior Member
Hello Dimitris,

The query in EOL File is:

operation InitialisationDataSet getTimeslotsNot TransmittableTo(other:InitialisationDataSet) : OrderedSet(TimeslotBlock) {
var myTxBs: OrderedSet(TimeslotBlock) := self.getTimeslotBlocks().select(b|b.isExplicitTransmit());
var allTransmittableBs: OrderedSet(TimeslotBlock) := self.getAllTimeslotsTransmittableTo(other);
myTxBs.println();
allTransmittableBs.println();
return myTxBs.reject(b|allTransmittableBs.includes(b));
}


The statement to execute query using EOL is:

timeslots := ids1.getTimeslotsNotTransmittableTo(ids2).asOrderedSet();
timeslots.println();

The above statement gives the required output. But when executed in Java it throws null pointer exception.

The code in Java is:

EolOperation getAllTimeslotsNotTransmittableTo = module.getOperations().getOperation("getAllTimeslotsNotTransmittableTo ");
List idsList = new ArrayList();
idsList.add(ids2);
EolOrderedSet timeSlots = (EolOrderedSet) getAllTimeslotNotTransmittableTo.execute(ids1, idsList, module.getContext());

The above line gives null pointer exception.

Thanks,

Sajit
Re: Null Pointer Exception when invoking .asOrderedSet in EOL query [message #490368 is a reply to message #490339] Thu, 08 October 2009 13:16 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Sajit,

Could you please check if getAllTimeslotNotTransmittableTo is null? If
so this may be due to the extra space in

getOperation("getAllTimeslotsNotTransmittableTo "); <-

Cheers,
Dimitris

Sajit wrote:
> Hello Dimitris,
>
> The query in EOL File is:
>
> operation InitialisationDataSet getTimeslotsNot
> TransmittableTo(other:InitialisationDataSet) : OrderedSet(TimeslotBlock) {
> var myTxBs: OrderedSet(TimeslotBlock) :=
> self.getTimeslotBlocks().select(b|b.isExplicitTransmit());
> var allTransmittableBs: OrderedSet(TimeslotBlock) :=
> self.getAllTimeslotsTransmittableTo(other);
> myTxBs.println();
> allTransmittableBs.println();
> return myTxBs.reject(b|allTransmittableBs.includes(b));
> }
>
>
> The statement to execute query using EOL is:
>
> timeslots := ids1.getTimeslotsNotTransmittableTo(ids2).asOrderedSet();
> timeslots.println();
>
> The above statement gives the required output. But when executed in Java
> it throws null pointer exception.
>
> The code in Java is:
>
> EolOperation getAllTimeslotsNotTransmittableTo =
> module.getOperations().getOperation("getAllTimeslotsNotTransmittableTo ");
> List idsList = new ArrayList();
> idsList.add(ids2);
> EolOrderedSet timeSlots = (EolOrderedSet)
> getAllTimeslotNotTransmittableTo.execute(ids1, idsList,
> module.getContext());
>
> The above line gives null pointer exception.
>
> Thanks,
>
> Sajit


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: Null Pointer Exception when invoking .asOrderedSet in EOL query [message #490408 is a reply to message #490368] Thu, 08 October 2009 14:52 Go to previous messageGo to next message
Sajit  is currently offline Sajit Friend
Messages: 6
Registered: October 2009
Junior Member
Hi Dimitris,

Thanks for your reply.
Yes, the error was due to incorrect name of function called.
It was "getTimeslotsNotTransmittableTo" and not "getAllTimeslotsNotTransmittableTo".

Thanks again,

Sajit
Re: Null Pointer Exception when invoking .asOrderedSet in EOL query [message #490416 is a reply to message #490408] Thu, 08 October 2009 15:04 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Sajit,

Glad it wasn't something more complicated. Thanks for the update!

Cheers,
Dimitris

Sajit wrote:
> Hi Dimitris,
>
> Thanks for your reply.
> Yes, the error was due to incorrect name of function called.
> It was "getTimeslotsNotTransmittableTo" and not
> "getAllTimeslotsNotTransmittableTo".
>
> Thanks again,
>
> Sajit


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: Null Pointer Exception when invoking .asOrderedSet in EOL query [message #581740 is a reply to message #490368] Thu, 08 October 2009 14:52 Go to previous message
Sajit  is currently offline Sajit Friend
Messages: 6
Registered: October 2009
Junior Member
Hi Dimitris,

Thanks for your reply.
Yes, the error was due to incorrect name of function called.
It was "getTimeslotsNotTransmittableTo" and not "getAllTimeslotsNotTransmittableTo".

Thanks again,

Sajit
Re: Null Pointer Exception when invoking .asOrderedSet in EOL query [message #581751 is a reply to message #581740] Thu, 08 October 2009 15:04 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Sajit,

Glad it wasn't something more complicated. Thanks for the update!

Cheers,
Dimitris

Sajit wrote:
> Hi Dimitris,
>
> Thanks for your reply.
> Yes, the error was due to incorrect name of function called.
> It was "getTimeslotsNotTransmittableTo" and not
> "getAllTimeslotsNotTransmittableTo".
>
> Thanks again,
>
> Sajit


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Previous Topic:Explicit invocation of ETL rule
Next Topic:Visibility of link when i click group element in the diagram
Goto Forum:
  


Current Time: Fri Mar 29 09:45:15 GMT 2024

Powered by FUDForum. Page generated in 0.03088 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top