Null Pointer Exception when invoking .asOrderedSet in EOL query [message #581643] |
Thu, 08 October 2009 08:07  |
Eclipse User |
|
|
|
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 #581663 is a reply to message #581643] |
Thu, 08 October 2009 09:16  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.06117 seconds