Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/jssc/SerialNativeAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
public class SerialNativeAccess {
private int osType = -1;
private static SerialNativeInterface sni = new SerialNativeInterface();
private static SerialNativeAccess instance = null;

private static class LazyHolder {
private static final SerialNativeAccess INSTANCE = new SerialNativeAccess();
}

public static SerialNativeAccess getInstance() {
if (SerialNativeAccess.instance == null) {
SerialNativeAccess.instance = new SerialNativeAccess();
}
return SerialNativeAccess.instance;
return LazyHolder.INSTANCE;
}

public SerialNativeAccess() {
private SerialNativeAccess() {
String libFolderPath;
String libName;

Expand Down