fixing native non-static JSNI methods by making them final

This commit is contained in:
Axel Uhl committed 2014-10-10 22:26:53 +02:00
1 parent cc0b0deb0c
commit d43e8f37f1
2 files changed
+20 -12

No files matched your search

@@ -19,6 +19,10 @@ public class Storage extends JavaScriptObject {
registerAsStorageEventHandler();
}
protected Storage() {
super();
}
private static void registerAsStorageEventHandler() {
if (isSupported()) {
registerAsStorageEventHandlerImpl();
@@ -100,27 +104,27 @@ public class Storage extends JavaScriptObject {
return result;
}
public native void setItem(String key, String value) /*-{
public final native void setItem(String key, String value) /*-{
this.setItem(key, value);
}-*/;
public native String getItem(String key) /*-{
public final native String getItem(String key) /*-{
return this.getItem(key);
}-*/;
public native void removeItem(String key) /*-{
public final native void removeItem(String key) /*-{
return this.removeItem(key);
}-*/;
public native void clear() /*-{
public final native void clear() /*-{
this.clear();
}-*/;
public native String getKey(int index) /*-{
public final native String getKey(int index) /*-{
return this.key(index);
}-*/;
public native int getLength() /*-{
public final native int getLength() /*-{
return this.length;
}-*/;
}
@@ -12,31 +12,35 @@ import com.google.gwt.core.client.JavaScriptObject;
*
*/
public class StorageEvent extends JavaScriptObject {
protected StorageEvent() {
super();
}
public static interface Handler {
void onStorageChange(StorageEvent event);
}
public native String getKey() /*-{
public final native String getKey() /*-{
return this.key;
}-*/;
public native String getNewValue() /*-{
public final native String getNewValue() /*-{
return this.newValue;
}-*/;
public native String getOldValue() /*-{
public final native String getOldValue() /*-{
return this.oldValue;
}-*/;
public Storage getStorageArea() {
public final Storage getStorageArea() {
return getStorageAreaImpl().cast();
}
private native JavaScriptObject getStorageAreaImpl() /*-{
private final native JavaScriptObject getStorageAreaImpl() /*-{
return this.storageArea;
}-*/;
public native String getUrl() /*-{
public final native String getUrl() /*-{
return this.url;
}-*/;
}