Skip to content

Commit 4d75242

Browse files
authored
0.26.0
Path concat fix. Fix NPE in DSLink.shutdown().
1 parent dde5671 commit 4d75242

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'java'
22
apply plugin: 'maven'
33

44
group 'org.iot.dsa'
5-
version '0.25.0'
5+
version '0.26.0'
66

77
sourceCompatibility = 1.6
88
targetCompatibility = 1.6

dslink-core/src/main/java/org/iot/dsa/dslink/DSLink.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,16 @@ public void save() {
356356
*/
357357
public void shutdown() {
358358
stop();
359-
if (runThread == null) {
359+
Thread thread = runThread;
360+
if (thread == null) {
360361
return;
361362
}
362-
synchronized (runThread) {
363-
try {
364-
runThread.join();
365-
} catch (Exception x) {
366-
fine(x);
363+
try {
364+
synchronized (thread) {
365+
thread.join();
367366
}
367+
} catch (Exception x) {
368+
fine(x);
368369
}
369370
}
370371

dslink-core/src/main/java/org/iot/dsa/node/DSPath.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ public static StringBuilder concat(String leading, String trailing, StringBuilde
5656
}
5757
if (leading.charAt(leading.length() - 1) == '/') {
5858
if (trailing.charAt(0) == '/') {
59-
bucket.append(trailing.substring(1));
59+
return bucket.append(trailing.substring(1));
6060
}
6161
} else {
6262
if (trailing.charAt(0) != '/') {
6363
bucket.append('/');
64-
bucket.append(trailing);
6564
}
6665
}
67-
return bucket;
66+
return bucket.append(trailing);
6867
}
6968

7069
/**

dslink-java-v2-poc/src/main/java/org/iot/dsa/dslink/test/MainNode.java renamed to dslink-java-v2-poc/src/main/java/org/iot/dsa/dslink/poc/MainNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.iot.dsa.dslink.test;
1+
package org.iot.dsa.dslink.poc;
22

33
import org.iot.dsa.DSRuntime;
44
import org.iot.dsa.dslink.DSMainNode;

0 commit comments

Comments
 (0)