Replace preprocessed files with unpreprocessed ones. Fixes #496.

This commit is contained in:
Marco Castelluccio 2014-10-27 23:52:32 +01:00
Родитель 003906c13e
Коммит 9b780a978a
19 изменённых файлов: 720 добавлений и 700 удалений

Просмотреть файл

@ -1204,6 +1204,7 @@ public abstract class AbstractPIMItem implements PIMItem {
/**
* Ensures that the underlying list is closed.
*/
// #ifdef ENABLE_CDC
protected void finalize() {
if (dummyList) {
try {
@ -1213,4 +1214,9 @@ public abstract class AbstractPIMItem implements PIMItem {
}
}
}
// #else
// #ifdef NATIVE_PIM
private native void finalize();
// #endif
// #endif
}

Просмотреть файл

@ -776,6 +776,7 @@ public abstract class AbstractPIMList implements PIMList {
/**
* Ensures that the underlying list is closed.
*/
// #ifdef ENABLE_CDC
protected void finalize() {
try {
close();
@ -783,4 +784,9 @@ public abstract class AbstractPIMList implements PIMList {
// Ignore silently
}
}
// #else
// #ifdef NATIVE_PIM
private native void finalize();
// #endif
// #endif
}

Просмотреть файл

@ -104,11 +104,11 @@ public class NativeInputMode implements InputMode {
/**
* Finalizer. Free the data structures allocated in initialize(int).
*/
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif
/**
* Input method identifier. For a given platform, this class may

Просмотреть файл

@ -39,9 +39,9 @@ import com.sun.midp.lcdui.GraphicsAccess;
import com.sun.midp.io.j2me.storage.File;
// #ifndef ENABLE_CDC
import com.sun.midp.main.MIDletSuiteUtils;
// #endif
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.Font;
@ -111,9 +111,9 @@ public class SkinResourcesImpl extends SkinResources {
resources = null;
skinData = null;
// #ifndef ENABLE_CDC
isAmsIsolate = MIDletSuiteUtils.isAmsIsolate();
// #endif
if (reload) {
if (Logging.REPORT_LEVEL <= Logging.CRITICAL) {
@ -487,11 +487,11 @@ final class LoadedSkinResources {
/** Loaded images */
Image[] images;
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif
}
@ -557,11 +557,11 @@ final class LoadedSkinData {
static byte STRING_ENCODING_UTF8 =
SkinResourcesConstants.STRING_ENCODING_UTF8;
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif
LoadedSkinData() {
properties = null;

Просмотреть файл

@ -65,10 +65,10 @@ public class EventQueue implements Runnable {
*/
static {
eventQueue = new EventQueue();
// #ifndef ENABLE_GCI
eventQueue.nativeEventQueueHandle =
eventQueue.getNativeEventQueueHandle();
// #endif ENABLE_GCI
eventQueue.start();
}
@ -104,7 +104,7 @@ public class EventQueue implements Runnable {
/** True, if the queue is alive. */
boolean alive; // = false
// #ifndef ENABLE_GCI
/** The thread running the native event monitor. */
Thread eventMonitorThread;
@ -114,7 +114,7 @@ public class EventQueue implements Runnable {
/** This is for the native finalizer to reset peer native queue. */
int nativeEventQueueHandle = -1;
// #endif ENABLE_GCI
/**
* Returns true if the current thread is the event queue dispatch
@ -171,36 +171,36 @@ public class EventQueue implements Runnable {
eventQueueLock = new Object();
// #ifndef ENABLE_GCI
pool = new NativeEventPool();
eventMonitorThread =
new Thread(
new NativeEventMonitor(eventQueueLock, this, pool));
// #endif ENABLE_GCI
}
// #ifdef ENABLE_GCI
/** Starts the event queue thread. */
void start() {
eventQueueThread.start();
}
/**
* Send a native event to a specific Isolate.
*
* @param event a native event
* @param isolateId ID of the receiving Isolate
*/
public void sendNativeEventToIsolate(NativeEvent event,
int isolateId) {
post(event);
}
// #else
/** Starts the event queue and event monitor threads. */
void start() {
@ -235,27 +235,27 @@ public class EventQueue implements Runnable {
*/
public native void sendNativeEventToIsolate(NativeEvent event,
int isolateId);
// #endif
/**
* Native finalizer to reset the native peer event queue when
* the Isolate ends.
*/
// #ifdef ENABLE_CDC
/**
* Queue a shutdown event to the native event queue.
*/
private void sendShutdownEvent() {
post(new Event(EventTypes.EVENT_QUEUE_SHUTDOWN));
}
// #else
/**
* Queue a shutdown event to the native event queue.
*/
private native void sendShutdownEvent();
private native void finalize();
// #endif
/**
* Register to preprocess and process events of single type.
@ -463,9 +463,9 @@ public class EventQueue implements Runnable {
}
}
}
// #ifndef ENABLE_GCI
resetNativeEventQueue();
// #endif ENABLE_GCI
}
/** Runs the event queue. See the class description for details. */
@ -517,11 +517,11 @@ public class EventQueue implements Runnable {
dispatchData.listener.process(event);
// #ifndef ENABLE_GCI
if (event instanceof NativeEvent) {
pool.putBack((NativeEvent)event);
}
// #endif
// IMPL_NOTE
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
@ -566,7 +566,7 @@ class DispatchData {
}
}
// #ifndef ENABLE_GCI
/**
* Runs in its own Java thread. Wait for set of native events to arrive and
* then post them as a set to the Java event queue.
@ -710,4 +710,4 @@ class NativeEventPool {
}
}
}
// #endif ENABLE_GCI

Просмотреть файл

@ -24,11 +24,11 @@
package com.sun.midp.io;
// #ifdef ENABLE_CDC
import com.sun.cdc.io.ConnectionBaseInterface;
// #else
import com.sun.cldc.io.ConnectionBaseInterface;
// #endif
import com.sun.midp.midlet.*;

Просмотреть файл

@ -1012,7 +1012,11 @@ public class Protocol extends ProtocolBase {
/**
* Native finalizer
*/
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif ENABLE_CDC
/**
* Native function to open sms connection

Просмотреть файл

@ -392,9 +392,9 @@ public class RandomAccessStream extends ConnectionBaseAdapter {
/**
* Ensures native resources are freed when Object is collected.
*/
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif
}

Просмотреть файл

@ -34,39 +34,39 @@ public final class JSRInitializer {
* Initializes JSRs.
*/
public static void init() {
// #ifdef ENABLE_JSR_75
com.sun.midp.jsr075.Initializer.init();
// #endif
// #ifdef ENABLE_JSR_82
com.sun.midp.jsr082.Initializer.init();
// #endif
// #ifdef ENABLE_JSR_184
com.sun.midp.jsr184.Initializer.init();
// #endif
// #ifdef ENABLE_JSR_211
// #ifdef ENABLE_NATIVE_APP_MANAGER
com.sun.midp.jsr211.Initializer.init();
// #endif ENABLE_NATIVE_APP_MANAGER
// #endif
// #ifdef ENABLE_JSR_226
com.sun.pisces.PiscesFinalizer.init();
// #endif
// #ifdef ENABLE_JSR_229
com.sun.midp.jsr229.Initializer.init();
// #endif
// #ifdef ENABLE_JSR_290
com.sun.midp.jsr290.Initializer.init();
// #endif
// #ifdef ENABLE_JSR_257
com.sun.midp.jsr257.Initializer.init();
// #endif
}
@ -74,8 +74,8 @@ public final class JSRInitializer {
* Finalizes JSRs.
*/
public static void cleanup() {
// #ifdef ENABLE_JSR_257
com.sun.midp.jsr257.Initializer.cleanup();
// #endif
}
}

Просмотреть файл

@ -36,7 +36,7 @@ import javax.microedition.lcdui.Graphics;
*/
public interface GraphicsAccess {
// #ifdef ENABLE_CHAMELEON
/**
* Return a romized image resource based on the identifier.
*
@ -47,7 +47,7 @@ public interface GraphicsAccess {
*/
public Image getRomizedImage(int imageDataArrayPtr,
int imageDataArrayLength);
//#endif
/**
* Resize Image optionally saving its content clipped according

Просмотреть файл

@ -44,7 +44,7 @@ class IsolateUtil {
*/
static void setProfile(Isolate isolate, String profileName) {
// #ifdef ENABLE_VM_PROFILES
//isolate.setProfile(profileName);
isolate.setProfile(profileName);
// #else
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_AMS,

Просмотреть файл

@ -654,11 +654,11 @@ public final class MIDletSuiteImpl implements MIDletSuite {
* Native finalizer
*
*/
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif
/**
* Unlocks the MIDletSuite.

Просмотреть файл

@ -450,9 +450,9 @@ class RecordStoreFile implements AbstractRecordStoreFile {
/**
* Ensures native resources are freed when Object is collected.
*/
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif
}

Просмотреть файл

@ -232,10 +232,10 @@ class RecordStoreSharedDBHeader {
/**
* Ensures native resources are freed when Object is collected.
*/
// #ifdef ENABLE_CDC
protected native void finalize();
// #else
private native void finalize();
// #endif
}

Просмотреть файл

@ -27,9 +27,9 @@ package com.sun.midp.security;
import com.sun.midp.log.Logging;
// #ifdef ENABLE_CDC
import com.sun.j2me.security.*;
// #endif ENABLE_CDC
/**
* A utility class that initializes internal security. Creates the internal
@ -95,14 +95,14 @@ public final class SecurityInitializer {
public static SecurityToken requestToken(
ImplicitlyTrustedClass trusted) throws SecurityException {
// #ifdef ENABLE_CDC
try {
AccessController.checkPermission("com.sun.midp");
return impl.internalSecurityToken;
} catch (SecurityException se) {
// fall through to request a token using the class list
}
// #endif ENABLE_CDC
return impl.requestToken(trusted);
}
@ -120,10 +120,10 @@ public final class SecurityInitializer {
internalSecurityToken);
com.sun.midp.midletsuite.MIDletSuiteStorage.initSecurityToken(
internalSecurityToken);
// #ifndef ENABLE_CDC
com.sun.midp.io.j2me.push.PushRegistryInternal.initSecurityToken(
internalSecurityToken);
// #endif ENABLE_CDC
}
/**
@ -149,29 +149,29 @@ public final class SecurityInitializer {
// initialization over SecurityToken request
"com.sun.midp.main.AbstractMIDletSuiteLoader$SecurityTrusted",
// #ifdef ENABLE_CDC
"com.sun.midp.jump.isolate.MIDletContainer$SecurityTrusted",
// #endif ENABLE_CDC
// #ifdef ENABLE_NATIVE_APP_MANAGER
// The main security token consumer in the case of native AMS
"com.sun.midp.main.NativeAppManagerPeer$SecurityTrusted",
"com.sun.midp.installer.InstallerPeerMIDlet$SecurityTrusted",
// #endif ENABLE_NATIVE_APP_MANAGER
// #ifdef ENABLE_NAMS_TEST_SERVICE
"com.sun.midp.main.NamsTestServiceMidlet$SecurityTrusted",
// #endif ENABLE_NAMS_TEST_SERVICE
"com.sun.midp.main.TrustedMIDletIcon$SecurityTrusted",
// #ifdef ENABLE_CHAMELEON
"com.sun.midp.chameleon.skins.resources.SkinResourcesImpl$SecurityTrusted",
// #endif ENABLE_CHAMELEON
// #ifndef ENABLE_CHAMELEON
"javax.microedition.lcdui.AlertLFImpl$SecurityTrusted",
// #endif ENABLE_CHAMELEON
"javax.microedition.rms.RecordStore$SecurityTrusted",
"javax.microedition.midlet.MIDlet$SecurityTrusted",
@ -179,99 +179,101 @@ public final class SecurityInitializer {
"com.sun.midp.io.j2me.http.Protocol$SecurityTrusted",
"com.sun.midp.io.j2me.datagram.Protocol$SecurityTrusted",
// #ifdef ENABLE_SSL
"com.sun.midp.io.j2me.https.Protocol$SecurityTrusted",
"com.sun.midp.io.j2me.ssl.Protocol$SecurityTrusted",
// #endif ENABLE_SSL
// #ifdef ENABLE_JSR_120
"com.sun.midp.io.j2me.ProtocolBase$SecurityTrusted",
// #endif ENABLE_JSR_120
// #ifdef ENABLE_PUBLICKEYSTORE
"com.sun.midp.publickeystore.WebPublicKeyStore$SecurityTrusted",
// #endif ENABLE_PUBLICKEYSTORE
// #ifdef ENABLE_JSR_177
"com.sun.satsa.security.SecurityInitializer$SecurityTrusted",
// #endif ENABLE_JSR_177
// #ifdef ENABLE_JSR_179
"com.sun.j2me.location.LocationPersistentStorage$SecurityTrusted",
// #endif ENABLE_JSR_179
// #ifdef ENABLE_JSR_180
"com.sun.cdc.io.j2me.sip.ProtocolBase$SecurityTrusted",
// #endif ENABLE_JSR_180
// #ifdef ENABLE_JSR_75
"com.sun.j2me.pim.PIMDatabase$SecurityTrusted",
"javax.microedition.io.file.FileSystemEventHandlerBase$SecurityTrusted",
// #endif ENABLE_JSR_75
// #ifdef ENABLE_JSR_82
"com.sun.jsr082.security.SecurityInitializer$SecurityTrusted",
// #endif ENABLE_JSR_82
// #ifdef ENABLE_JSR_234
"com.sun.amms.AMMSMPEventListener$SecurityTrusted",
// #endif ENABLE_JSR_234
// #ifdef ENABLE_JSR_238
"com.sun.midp.jsr238.SecurityInitializer$SecurityTrusted",
// #endif ENABLE_JSR_238
// #ifdef ENABLE_JSR_229
"com.sun.j2me.payment.CldcPaymentModule$SecurityTrusted",
"com.sun.j2me.payment.PaymentModule$SecurityTrusted",
// #endif ENABLE_JSR_229
// #ifdef ENABLE_JSR_226
"com.sun.perseus.platform.ResourceHandler$SecurityTrusted",
// #endif ENABLE_JSR_226
// #ifdef ENABLE_JSR_256
"com.sun.javame.sensor.NativeSensorRegistry$SecurityTrusted",
// #endif ENABLE_JSR_256
// #ifdef ENABLE_JSR_211
"com.sun.jsr211.security.SecurityInitializer$SecurityTrusted",
"com.sun.j2me.content.CHManagerImpl$SecurityTrusted",
// #endif ENABLE_JSR_211
// #ifdef ENABLE_JSR_290
"com.sun.fluid.FluidMidpEventDispatcher$SecurityTrusted",
"com.sun.j2me.dom.DOMFactory$SecurityTrusted",
// #endif ENABLE_JSR_290
// Pass the security token to the i3 test framework.
// #ifdef ENABLE_I3_TEST
"com.sun.midp.i3test.TestCase$SecurityTrusted",
"com.sun.midp.i3test.SelfTest$TestRequestSecurityToken$SecurityTrusted",
"com.sun.midp.suspend.test.TestUtil$SecurityTrusted",
"com.sun.midp.services.SecurityTokenProvider$SecurityTrusted",
// IMPL NOTE: PauseTest is temporarily disabled.
// Pass the security token to the standalone pause test.
// "com.sun.midp.internal.test.PauseTest",
// #endif ENABLE_I3_TEST
// #ifdef ENABLE_MULTIPLE_ISOLATES
"com.sun.midp.util.isolate.SecurityTokenProvider$SecurityTrusted",
"com.sun.midp.io.j2me.pipe.SecurityTokenProvider$SecurityTrusted",
// #endif
// MMAPI event handler stabbed in MIDP in the case of no JSR 135/234
"com.sun.mmedia.MMEventHandler$SecurityTrusted",
// #ifdef ENABLE_MULTIPLE_ISOLATES
"com.sun.midp.main.AmsUtil$SecurityTrusted",
"com.sun.midp.io.j2me.pipe.Protocol$SecurityTrusted",
"com.sun.midp.installer.AutoTester$SecurityTrusted",
// #endif
// #ifdef ENABLE_ON_DEVICE_DEBUG
// #ifdef ENABLE_MULTIPLE_ISOLATES
"com.sun.midp.odd.ODTEngine$SecurityTrusted",
// #endif
// #endif
"com.sun.midp.suspend.AbstractSubsystem$SecurityTrusted",
"com.sun.midp.io.j2me.socket.Protocol$SecurityTrusted",

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -27,9 +27,9 @@
package javax.microedition.lcdui;
import javax.microedition.lcdui.game.GameCanvas;
// #ifdef ENABLE_CHAMELEON
import com.sun.midp.chameleon.MIDPWindow;
// #endif
/**
* Class to access extended Image and Graphics functionality needed to
@ -38,7 +38,7 @@ import com.sun.midp.chameleon.MIDPWindow;
*/
class GraphicsAccessImpl implements com.sun.midp.lcdui.GraphicsAccess {
// #ifdef ENABLE_CHAMELEON
/**
* Return a romized image resource based on the identifier.
*
@ -53,7 +53,7 @@ class GraphicsAccessImpl implements com.sun.midp.lcdui.GraphicsAccess {
return Image.getRomizedImage(
imageDataArrayPtr, imageDataArrayLength);
}
// #endif
/**
* Resize Image optionally saving its content clipped according
@ -94,12 +94,12 @@ class GraphicsAccessImpl implements com.sun.midp.lcdui.GraphicsAccess {
public int getGraphicsWidth(Graphics g) {
Object creator = g.getCreator();
if (creator != null) {
// #ifdef ENABLE_CHAMELEON
if (creator instanceof Display) {
MIDPWindow window = ((Display)creator).getWindow();
return window.getBodyAnchorX() + window.getBodyWidth();
}
// #endif
if (creator instanceof GameCanvas) {
return ((GameCanvas)creator).getWidth();
}
@ -118,12 +118,12 @@ class GraphicsAccessImpl implements com.sun.midp.lcdui.GraphicsAccess {
public int getGraphicsHeight(Graphics g) {
Object creator = g.getCreator();
if (creator != null) {
// #ifdef ENABLE_CHAMELEON
if (creator instanceof Display) {
MIDPWindow window = ((Display)creator).getWindow();
return window.getBodyAnchorY() + window.getBodyHeight();
}
// #endif
if (creator instanceof GameCanvas) {
return ((GameCanvas)creator).getHeight();
}

Просмотреть файл

@ -29,9 +29,9 @@ package javax.microedition.lcdui;
import com.sun.mmedia.MIDPVideoPainter;
import com.sun.mmedia.MMHelper;
import java.util.Vector;
// #ifdef ENABLE_CHAMELEON
import com.sun.midp.chameleon.MIDPWindow;
// #endif
/**
* This is a helper class to communicate between the LCDUI canvas and
@ -157,7 +157,7 @@ final class MMHelperImpl extends MMHelper {
*/
public boolean isDisplayOverlapped(Graphics g) {
boolean isOverlapped = false;
// #ifdef ENABLE_CHAMELEON
Object creator = g.getCreator();
if (creator != null) {
if (creator instanceof Display) {
@ -165,7 +165,7 @@ final class MMHelperImpl extends MMHelper {
isOverlapped = window.systemMenuUp();
}
}
// #endif
return isOverlapped;
}

Просмотреть файл

@ -38,8 +38,10 @@ public interface MessageConnection extends javax.microedition.io.Connection {
// JAVADOC COMMENT ELIDED
public static final String BINARY_MESSAGE = "binary";
// #ifdef ENABLE_JSR_205
// JAVADOC COMMENT ELIDED
public static final String MULTIPART_MESSAGE = "multipart";
// #endif ENABLE_JSR_205
// JAVADOC COMMENT ELIDED
public Message newMessage(String type);