eclipse-qvto / org.eclipse.qvto

Eclipse Public License 2.0
0 stars 0 forks source link

Report warning in case variable of Collection type is declared without explicit initialization #748

Open eclipse-qvt-oml-bot opened 1 day ago

eclipse-qvt-oml-bot commented 1 day ago

| --- | --- | | Bugzilla Link | 422511 | | Status | NEW | | Importance | P3 normal | | Reported | Nov 25, 2013 14:18 EDT | | Modified | Jun 06, 2014 20:13 EDT | | Reporter | Sergey Boyko |

Description

Collection variables are always initialized with non-null values (see Bug 388801).\ However it's not the case for Collection type (since it is an abstract type):\ var cls : Collection(EClass);

In such case warning like "Variable of an abstract type 'Collection' requires an explicit initialization" should be reproted.

eclipse-qvt-oml-bot commented 1 day ago

By Christopher Gerking on Feb 20, 2014 04:52

Also applies to mappings with Collection as result type. Should be handled like an abstract classifier, thus require at least an init section (which should hopefully contain the explicit initialization).

eclipse-qvt-oml-bot commented 1 day ago

By Alex Paperno on Jun 06, 2014 20:13

Created attachment 244056 The patch reports a warning if Collection is used for an out/return parameter of a mapping w/o 'init' section. Another warning is reported for usage of Collection in variable initialization.

:notepad_spiral: bug422511.patch

eclipse-qvt-oml-bot commented 1 day ago

By Alex Paperno on Jun 06, 2014 20:13

Created attachment 244057 A unit test for the patch

:notepad_spiral: bug422511_test.patch