Skip to main content

System Properties: microedition.* --vs-- java.specification.*

No replies
mathisson
Offline
Joined: 2005-06-10
Points: 0

Hi all,

What is the preferred way, given an arbitrary VM, to figure out which Environment (Configuration, Profiles) I am dealing with?
I know there is more than one way to do it.
What I'd like to know is your thoughts on how it should be done _consistently_ in the future.

1. There is java.specification.{name,version}
The 'name' key used to hold a value like "J2ME Foundation Profile" in CVM, but in PhoneME Advanced it is now "$(J2ME_PROFILE_NAME) Specification" [build/share/defs.mk].
This is ok, but does not really qualify as a general scheme, because it (a) is not available on CLDC and (b) has no standard format, i.e. how to include more than one profile, which is necessary for coexisting profiles (but also nice to have in general: I can test for indexOf("Foundation-") without knowing all supersets).

2. There is microedition.{configuration,profiles}
For CLDC you actually get meaningful results here, but in PhoneME Advanced, it is hardcoded to "CLDC-1.1" and "" respectively, which is at least questionable.
As a result, the corresponding Code in src/share/native/java/lang/System.c is marked with "FIXME: should be in midp".
But I am not sure about this either, as it is not MIDP, but the CLDC-Spec that defines these Properties.
(According to CLDC-1.1 Section 6.2.10, microedition.configuration must be set to "CLDC-1.1", and microedition.profiles to a space seperated list of profiles.)

Now, the namespace of these Properties would suggests that it is used for JavaME-Type-Environments, which would include CLDC as well as CDC.
Unfortunately the CDC-Spec has no suggestions for these.

So, what do you plan to do about these Properties?
Not setting microedition.configuration at all?
(microedition.configuration="")
Then what about profiles?

Append CDC-1.1 although it was never planned to do so?
(microedition.configuration="CLDC-1.1 CDC-1.1")

Create new Properties?