Sun Java Solaris Communities My SDN Account Join SDN
 
FAQ

MIDlet Suite Versioning

 
By Richard Marejka, December 2004  
 
Question

What is the correct form of a MIDlet suite version number?


Answer

In testing a MIDlet suite recently some inexplicable errors occurred. Sometimes the MIDlet suite would install and run successfully, sometimes it would fail to install. The only clear pattern was that failures were more likely on more recent devices. The failures were not specific to one manufacturer or to one version of the profile, MIDP 1.0 or MIDP 2.0.

After some review, conjecture, and further testing the failure was traced to the value of the MIDlet-Version attribute. When the original value ".8" was changed to "0.8", the suite installed and ran fine on all devices tested.

This experience led to a more detailed investigation into the question: What is a valid version number? The MIDP 1.0 specification (on page 45) and MIDP 2.0 (on page 434) provide the same definition of version number. To quote from the MIDP 2.0 document:

Version numbers have the format Major.Minor[.Micro] (X.X[.X]), where the Micro portion MAY be omitted. (If the .Micro portion is not omitted then it defaults to zero.) In addition, each portion of the version number is allowed a maximum of two decimal digits (i.e. 0-99).

What's missing is an explicit statement of the minimum length of each portion. The note in parentheses "(i.e. 0-99)," is used to support the statement of maximum length.

So what have we learned?

  • The correct syntax of a MIDlet-Version, expressed in yacc grammar, is:

    	Version	: Major '.' Minor
    		| Major '.' Minor '.' Micro
    		;
    
    	Major	: number ;
    	Minor	: number ;
    	Micro	: number ;
    
    	number	: [0-9]
    		| [0-9][0-9]
    		;
    

    That is, a version number is two one- or two-digit numbers separated by a period, or three one- or two-digit numbers separated by periods.
  • Natural language is sometimes difficult to parse.
  • Unspecified items are just that: unspecified, and subject to implementation-specific interpretation.