CLDC 1.1
From JopWiki
This page describes the port of the CLDC 1.1 API to JOP.
[edit] What is it?
Connected Limited Device Configuration (CLDC) is a specification made for devices with limited resources. Although it is not designed for real-time Java, most of the unnecessary resources have been removed from the API, which makes it a useful base JDK for JOP.
[edit] Structure
The currently implemented JDK is based on the phoneME project, which follows the CLDC 1.1 specification. The JDK is located in java/target/src/cldc11 and is split into 4 parts:
- cldc_orig - Contains files from the phoneME project which are unmodified.
- cldc_mod - Files from the phoneME project that had to be modified to work on JOP
- jdk_base_orig - These files are JOP specific and were copied from the jdk_base folder
- jdk_base_mod - Also files from jdk_base but had to be modified to comply with the CLDC
To use the CLDC JDK in JOP, modify the Makefile such that
CLDC11=true
[edit] Current Status
This sections lists incomplete implementations, errors and notes:
- Class methods - These are reflection methods and therefore have to be implemented in the JOP JVM.
- Object.getClass() - This method implementation is on hold until the Class(class) is working properly.
- WeakReference methods - Support for WeakReference must be implemented in the garbage collector.
- String.intern() - The JOP JVM needs to be updated when this method is implemented.
- Thread - The current Thread class methods are not implemented. The methods also need to be integrated with the JOP scheduler.
- System.arraycopy() does not properly work within String. This is caused by the JOP JVM treating the final char arrays within String differently from the char array arguments. The current solution is to use normal array copying, i.e.
char_array1[i] = char_array2[i].
- System.in is not a part of CLDC 1.1 but it is currently public for ease of use.
- When declaring an Integer
Integer i = 1;
the code is compiled such that Integer.valueof(int) is used, which is not a part of CLDC 1.1. This can be circumvented by compiling code with CLDC 1.1 compatibility.
