diff options
author | Petre Eftime <[email protected]> | 2016-04-18 17:50:11 +0300 |
---|---|---|
committer | Petre Eftime <[email protected]> | 2016-04-18 17:50:11 +0300 |
commit | c108364e5a477438cb22760d81b29eacdf321185 (patch) | |
tree | 2d8792d50f94711c4ec017bf66af4e8bfeb0d77f | |
parent | 0797a6a2cc629a108d63d1f653bec0484a5f3544 (diff) |
java: Remove duplicated code in constructor and finalizev0.4.1
Signed-off-by: Petre Eftime <[email protected]>
-rw-r--r-- | java/BluetoothAdapter.java | 8 | ||||
-rw-r--r-- | java/BluetoothDevice.java | 8 | ||||
-rw-r--r-- | java/BluetoothGattCharacteristic.java | 8 | ||||
-rw-r--r-- | java/BluetoothGattDescriptor.java | 8 | ||||
-rw-r--r-- | java/BluetoothGattService.java | 8 | ||||
-rw-r--r-- | java/BluetoothObject.java | 2 |
6 files changed, 1 insertions, 41 deletions
diff --git a/java/BluetoothAdapter.java b/java/BluetoothAdapter.java index 6aa73316..5b96c5bd 100644 --- a/java/BluetoothAdapter.java +++ b/java/BluetoothAdapter.java @@ -33,8 +33,6 @@ import java.time.Duration; */ public class BluetoothAdapter extends BluetoothObject { - private long nativeInstance; - public native BluetoothType getBluetoothType(); public native BluetoothAdapter clone(); @@ -182,11 +180,5 @@ public class BluetoothAdapter extends BluetoothObject private BluetoothAdapter(long instance) { super(instance); - nativeInstance = instance; - } - - protected void finalize() - { - delete(); } } diff --git a/java/BluetoothDevice.java b/java/BluetoothDevice.java index ef10517a..96b63290 100644 --- a/java/BluetoothDevice.java +++ b/java/BluetoothDevice.java @@ -33,8 +33,6 @@ import java.time.Duration; */ public class BluetoothDevice extends BluetoothObject { - private long nativeInstance; - public native BluetoothType getBluetoothType(); public native BluetoothDevice clone(); @@ -206,11 +204,5 @@ public class BluetoothDevice extends BluetoothObject private BluetoothDevice(long instance) { super(instance); - nativeInstance = instance; - } - - protected void finalize() - { - delete(); } } diff --git a/java/BluetoothGattCharacteristic.java b/java/BluetoothGattCharacteristic.java index a1b019de..b8582768 100644 --- a/java/BluetoothGattCharacteristic.java +++ b/java/BluetoothGattCharacteristic.java @@ -33,8 +33,6 @@ import java.time.Duration; */ public class BluetoothGattCharacteristic extends BluetoothObject { - private long nativeInstance; - public native BluetoothType getBluetoothType(); public native BluetoothGattCharacteristic clone(); @@ -127,11 +125,5 @@ public class BluetoothGattCharacteristic extends BluetoothObject private BluetoothGattCharacteristic(long instance) { super(instance); - nativeInstance = instance; - } - - protected void finalize() - { - delete(); } } diff --git a/java/BluetoothGattDescriptor.java b/java/BluetoothGattDescriptor.java index 8356ca14..8a0f89f6 100644 --- a/java/BluetoothGattDescriptor.java +++ b/java/BluetoothGattDescriptor.java @@ -32,8 +32,6 @@ import java.util.*; */ public class BluetoothGattDescriptor extends BluetoothObject { - public long nativeInstance; - public native BluetoothType getBluetoothType(); public native BluetoothAdapter clone(); @@ -73,11 +71,5 @@ public class BluetoothGattDescriptor extends BluetoothObject private BluetoothGattDescriptor(long instance) { super(instance); - nativeInstance = instance; - } - - protected void finalize() - { - delete(); } } diff --git a/java/BluetoothGattService.java b/java/BluetoothGattService.java index 732e8972..bcc4d428 100644 --- a/java/BluetoothGattService.java +++ b/java/BluetoothGattService.java @@ -33,8 +33,6 @@ import java.time.Duration; */ public class BluetoothGattService extends BluetoothObject { - private long nativeInstance; - public native BluetoothType getBluetoothType(); public native BluetoothAdapter clone(); @@ -97,11 +95,5 @@ public class BluetoothGattService extends BluetoothObject private BluetoothGattService(long instance) { super(instance); - nativeInstance = instance; - } - - protected void finalize() - { - delete(); } } diff --git a/java/BluetoothObject.java b/java/BluetoothObject.java index d1445357..d1ab0c76 100644 --- a/java/BluetoothObject.java +++ b/java/BluetoothObject.java @@ -28,7 +28,7 @@ import java.util.*; public class BluetoothObject implements Cloneable { - long nativeInstance; + protected long nativeInstance; static { try { |