Yicong-Huang opened a new issue, #4818:
URL: https://github.com/apache/texera/issues/4818
### What happened?
`amber/src/main/scala/org/apache/texera/amber/engine/architecture/messaginglayer/AmberFIFOChannel.scala::getPortId`
does `this.portId.get` on an `Option[PortIdentity]` that defaults to `None`.
Calling `getPortId` before `setPortId` therefore throws a bare
`NoSuchElementException` with no contextual message — quite different from a
guard-and-raise (`require(...)`, `assert(...)`) that would point the caller at
the missing setup step.
`portId` is also untyped at the API level (the public getter declares
`PortIdentity`, not `Option[PortIdentity]`), so callers cannot pattern-match
safely; their only options today are blind `.get` access or wrapping in a
try/catch.
### How to reproduce?
```scala
import org.apache.texera.amber.core.virtualidentity.{ActorVirtualIdentity,
ChannelIdentity}
import
org.apache.texera.amber.engine.architecture.messaginglayer.AmberFIFOChannel
val ch = new AmberFIFOChannel(
ChannelIdentity(ActorVirtualIdentity("from"), ActorVirtualIdentity("to"),
isControl = false)
)
ch.getPortId
// java.util.NoSuchElementException: None.get
```
### Version
1.1.0-incubating (Pre-release/Master)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]