Bug 231515 - BUG in checkArgumentCount Validation Operation
Summary: BUG in checkArgumentCount Validation Operation
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Adolfo Sanchez-Barbudo Herrera CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-12 06:06 EDT by Adolfo Sanchez-Barbudo Herrera CLA
Modified: 2013-05-17 15:37 EDT (History)
2 users (show)

See Also:


Attachments
fixing patch. (1.14 KB, patch)
2008-05-12 06:06 EDT, Adolfo Sanchez-Barbudo Herrera CLA
wayne.beaton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adolfo Sanchez-Barbudo Herrera CLA 2008-05-12 06:06:47 EDT
Created attachment 99666 [details]
fixing patch.

Hi Christian,

While adopting M7, some NPE's are thrown in my testCases due to an OperationCallExp didn't have a reference to the Operation.

The cause is that OperationCallExpOperations.checkArgumentCount doesn't check if the referred operation is null.

Maybe this restriction should n't checked if there is no referredOperation. Maybe another kind of error could be thrown. Take into account that OCL's AS says that the referredOperation is optional. 

At least a null-safe check is needed when checking checkArgumentCount restriction. That is what the attatched patch does....

Cheers,
Adolfo.
Comment 1 Christian Damus CLA 2008-05-12 10:35:10 EDT
Patch committed to CVS HEAD (1.2 branch).

Thanks for the contribution!

BTW, I also added a new JUnit test case for operation-call expressions without operations to the ExpressionsValidatorTest class.  Patches including JUnit tests will be even more appreciated than patches with fixes  :-)
Comment 2 Adolfo Sanchez-Barbudo Herrera CLA 2008-05-12 11:09:35 EDT
Ok

As far as possible, I will try to attatch JUnit test cases. I hope not getting lost in all that amount of test cases you have, and create them in the proper place ;).

Cheers,
Adolfo.
Comment 3 Ed Willink CLA 2011-05-27 02:49:15 EDT
Closing after over 18 months in resolved state.