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 119996 - Converted Midlet contains error in guarded block
Summary: Converted Midlet contains error in guarded block
Status: RESOLVED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Visual Designer (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: David Kaspar
URL:
Keywords:
Depends on:
Blocks: 111624
  Show dependency tree
 
Reported: 2007-10-25 09:44 UTC by lauri
Modified: 2007-10-26 10:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Java file resulting from conversion (4.43 KB, text/plain)
2007-10-25 10:09 UTC, lauri
Details
VMD file from conversion (162.14 KB, text/plain)
2007-10-25 10:09 UTC, lauri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lauri 2007-10-25 09:44:26 UTC
Converted NB 5.5 midlet (visual editor) contains following error in guarded code block:

   //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">                               
              
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from
<code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then
<code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {                                            
        // write pre-switch user code here
        Display display = getDisplay();                                               
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }                                             
        // write post-switch user code here
    }                                   
    //</editor-fold>                                 


Used versions: 
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)

netbeans version was 6.0 beta 2.
Comment 1 David Kaspar 2007-10-25 09:57:26 UTC
Where exactly is the error?
This code fragment is added there in NetBeans 6.0 since it allows you and IDE to have better control over switching
between displayables. It is used by the rest of the generated code instead of calling "getDisplay().setCurrent(...)"
directly.

Leaving Opened with INCOMPLETE keyword.
Comment 2 lauri 2007-10-25 10:02:37 UTC
Sorry, I forgot to add that :)

Reported problem is lack of getDisplay() method.

regards
Lauri
Comment 3 lauri 2007-10-25 10:09:05 UTC
Created attachment 51649 [details]
Java file resulting from conversion
Comment 4 lauri 2007-10-25 10:09:51 UTC
Created attachment 51650 [details]
VMD file from conversion
Comment 5 David Kaspar 2007-10-25 10:26:05 UTC
I am unable to open your "ConvertedGOWriteMIDlet2" design since it requires a "util.SplashScreen" component which I do
not have.

Anyway from the files I see that the design has been converted but the source code was not generated. This could be
caused by:
1) You have opened the design but did not save it.
2) Or very likely there is a bug during the convertion (not related to the "getDisplay" issue).

Please, could you attach your original .java and .mvd files? Thanks.
Comment 6 lauri 2007-10-25 10:28:11 UTC
Thanks for quick responses!

Is it ok, if I send you whole project by email?
ZIPed project is <600K in size.

Even though application is freeware, I would not like to attack source here at then moment.
Comment 7 David Kaspar 2007-10-25 10:32:35 UTC
Yes, of course - you can send it to me directly.
Comment 8 David Kaspar 2007-10-26 10:32:32 UTC
There were 3 issues discovered during the GoWriteMIDlet2 design file conversion.
1) Item.defaultCommand property was incorrectly set.
2) Decrypting of String array was unable to handle "null" value.
3) Converter did not pass conversion of custom component derived from commands, ticker, svg components and build-in
components, therefore they have not been fully converted.

All issues above has been fixed in main trunk - see commit log below. Now the design can be converted without an error.

Commit log:

Checking in midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterBuilt.java;
/cvs/mobility/designer2/midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterBuilt.java,v  <-- 
ConverterBuilt.java
new revision: 1.7; previous revision: 1.6
done
Checking in midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterCustom.java;
/cvs/mobility/designer2/midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterCustom.java,v  <-- 
ConverterCustom.java
new revision: 1.5; previous revision: 1.4
done
Checking in midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterItems.java;
/cvs/mobility/designer2/midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterItems.java,v  <-- 
ConverterItems.java
new revision: 1.6; previous revision: 1.5
done
Checking in midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterUtil.java;
/cvs/mobility/designer2/midpconverter/src/org/netbeans/modules/vmd/midp/converter/wizard/ConverterUtil.java,v  <-- 
ConverterUtil.java
new revision: 1.8; previous revision: 1.7
done