UF.MICRO
UF (Use Freed) issues are reported when there is an attempt to use resources after they were released. The UF.MICRO warning indicates an attempt to use Java Micro Edition object after it was closed.
Example 1
Copy
class DBTestMidlet extends MIDlet {
private Display display;
private int nextRecordId;
public DBTestMidlet() {
display = Display.getDisplay(this);
RecordStore store = null;
try {
store = RecordStore.openRecordStore("TestStore", true);
nextRecordId = store.getNextRecordID();
} catch (RecordStoreException e) {
handleException(e);
if (store != null) {
try {
store.closeRecordStore();
} catch (RecordStoreException e1) {
// ignore
}
}
}
try {
final String name = store.getName();
display.setCurrent(new TextBox("", "Connected to database: " + name, 6000, TextField.ANY));
} catch (Exception e) {
handleException(e);
}
}
private void handleException(Exception e) {
display.setCurrent(new TextBox("Error", e.toString(), 60000, TextField.ANY));
}
public void startApp() {
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
UF.MICRO is reported for the snippet on line 44: There is attempt to get the name of the Java Micro Edition record store which is closed on line 36 in case if RecordStoreException is thrown on line 31.