This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 72527 - Lazy initialised off doesn't work - wrong code generated
Summary: Lazy initialised off doesn't work - wrong code generated
Status: CLOSED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Kaspar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-10 15:06 UTC by andersborg
Modified: 2008-09-10 16:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andersborg 2006-02-10 15:06:04 UTC
To get cleaner code (yet not necessarily memory efficient) I've sometimes turned
off lazy initialisation on "everything" to see the program logic better. If I do
that the simulator simply can't run the application. Is this at all supposed to
work based on the way that pre-init, post-init is auto-generated when using VMD?
Not a major issue though.

Where I've used lazy initialization turned off successfully is for e.g. alerts
that I place on the VMD diagram but don't connect to anything, as the intention
is to control display via my software (e.g. debug alerts etc). In that case it
saves on coding to have them pre-initalized.
Comment 1 Martin Ryzl 2006-02-10 16:47:42 UTC
I can confirm that. Here a fragment of code which causes the problem:

        helloStringItem = new StringItem("Hello", "Hello, World!");
        helloForm = new Form(null, new Item[] {helloStringItem});
        helloForm.addCommand(exitCommand);
        helloForm.setCommandListener(this);
        exitCommand = new Command("Exit", Command.EXIT, 1);

exit command added before created.
Comment 2 Martin Ryzl 2006-02-10 17:20:55 UTC
Anders Borg wrote:

> Seems to fit the bill.
> 
> I also wanted a global off switch for lazy initialization, but if it doesn't
> work as intended (at all) then that would be no point asking for.
> 
> I use lazy on everything now, which is not a problem. Doesn't matter that
> much except the code gets a bit bigger (yet data hopefully becomes smaller).
> 
> All pre/post-init/action code I make as method calls to code elsewhere. That
> way I don't have to see that much of the auto-generated code. The stability
> of the code generation from VMD diagrams seems to be very high overall.
Comment 3 Lukas Hasik 2006-02-11 08:50:36 UTC
the generated code is wrong -> increasing priority to P2
Comment 4 David Kaspar 2006-02-13 14:44:39 UTC
The problem is in topological sort while resolving non-lazy-initialized components.
Fixed in main trunk.
Comment 5 Lukas Hasik 2006-03-15 15:20:26 UTC
reopening, I'm unable to don't use the lazy initialization in HelloMidlet.
Unselect Lazy intitialize on the helloForm and switch to Source. there is a
warning that it forced the lazy initialization on again.
Comment 6 David Kaspar 2006-03-16 11:12:57 UTC
Fixed in trunk
Comment 7 Fabiola Rios 2006-03-29 10:54:37 UTC
Lazy initialised doesn't work for wait screen, when WS success or failed
transition is going to directly the same WS, it force me to use LI.

TYPO in the warning Dialog.
Comment 8 David Kaspar 2006-03-29 13:09:52 UTC
Fixed in trunk.

Self-references are removed from dependency map. Typo is fixed too.
Comment 9 Fabiola Rios 2006-04-18 16:20:50 UTC
verified with branch build 200604180200
Comment 10 Lukas Hasik 2006-04-25 15:48:16 UTC
v
Comment 11 Ivan Sidorkin 2008-09-10 16:07:24 UTC
close old issues