Skip to content

Remove Some Port Exceptions - #181

Merged
tresf merged 11 commits into
java-native:masterfrom
Vzor-:exceptions
Jan 29, 2025
Merged

tresf merged 11 commits into
java-native:masterfrom
Vzor-:exceptions

Conversation

@Vzor-

@Vzor- Vzor- commented Jan 6, 2025

Copy link
Copy Markdown
Collaborator

Removed port exceptions from closePort and closePort. This brings their behavior in line with the existing documentation.

Fixes #107

Comment thread src/main/java/jssc/SerialPort.java Resolved
@tresf
tresf merged commit 5c79ff3 into java-native:master Jan 29, 2025
pietrygamat pushed a commit to pietrygamat/jssc that referenced this pull request Oct 17, 2026
One test per mistake that reached users before, so each fails if it
comes back (JOURNAL.md now maps lesson -> test):

- java-native#113 baud rate truncated by a cast: set every standard rate and read
  it back with stty (verified: reintroducing a (jbyte) cast fails it)
- java-native#192 0-byte reads on a real open port
- java-native#86/java-native#181 event carries its port; removeEventListener true, then false
- java-native#107/java-native#181 closePort after the device vanished does not throw
- java-native#90 a port opened above fd 1024 still reads (poll on Linux)
- java-native#80 the library loads under a Turkish default locale
- java-native#160 exceptions stay IOExceptions
- java-native#51/java-native#65 tests load the native library just built, not another copy
- java-native#110 class files have the configured target version
- java-native#179/java-native#180/java-native#182 Linux port names incl. Moxa, and getPortNames(Pattern)

VirtualPortRule gets unplug() (stop socat) and one executor per rule:
the shared static executor was shut down after the first test, so a
class could only hold one socat test.

Two tests found open bugs, recorded in BACKLOG:
- reading from an unplugged port hangs on Linux because read() returns
  0 after a hangup and the native loop retries (B-04); that test is
  @ignore'd until the fix
- an incremental build without clean leaves Java 9 class files, because
  the second compiler pass sees up-to-date classes (new B-25)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPFQMyWmP4EyGx33gCHP2r
pietrygamat pushed a commit to pietrygamat/jssc that referenced this pull request Oct 17, 2026
One test per mistake that reached users before, so each fails if it
comes back (JOURNAL.md now maps lesson -> test):

- java-native#113 baud rate truncated by a cast: set every standard rate and read
  it back with stty (verified: reintroducing a (jbyte) cast fails it)
- java-native#192 0-byte reads on a real open port
- java-native#86/java-native#181 event carries its port; removeEventListener true, then false
- java-native#107/java-native#181 closePort after the device vanished does not throw
- java-native#90 a port opened above fd 1024 still reads (poll on Linux)
- java-native#80 the library loads under a Turkish default locale
- java-native#160 exceptions stay IOExceptions
- java-native#51/java-native#65 tests load the native library just built, not another copy
- java-native#110 class files have the configured target version
- java-native#179/java-native#180/java-native#182 Linux port names incl. Moxa, and getPortNames(Pattern)

VirtualPortRule gets unplug() (stop socat) and one executor per rule:
the shared static executor was shut down after the first test, so a
class could only hold one socat test.

Two tests found open bugs, recorded in BACKLOG:
- reading from an unplugged port hangs on Linux because read() returns
  0 after a hangup and the native loop retries (B-04); that test is
  @ignore'd until the fix
- an incremental build without clean leaves Java 9 class files, because
  the second compiler pass sees up-to-date classes (new B-25)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPFQMyWmP4EyGx33gCHP2r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SerialPort.closePort not calling native interface on Windows when USB serial adapter is disconnected

2 participants