mbeckerle commented on code in PR #990:
URL: https://github.com/apache/daffodil-vscode/pull/990#discussion_r1521575132
##########
debugger/src/main/scala/org.apache.daffodil.debugger.dap/DAPodil.scala:
##########
@@ -748,11 +748,24 @@ object DAPodil extends IOApp {
copy(value = value + (uri.normalize -> lines))
def contains(location: Location): Boolean =
- value.exists {
- // format: off
- case (uri, lines) =>
- uri == location.uri && lines.exists(_ == location.line)
- // format: on
+ value.exists { case (uri, lines) =>
Review Comment:
URIs are supposed to be "U" for universal.
If a URI like "file:/Users/user/path.file" is received it should be
rejected, not fixed up and made to work.
If you can't control where this broken URI is coming from, so you have no
choice in the matter, then this is a bug workaround and should be commented as
such.
If this seems like a permanent workaround or one that is likely to be needed
in more than one place in the code base, then we need an OS-dependent library.
So create:
daffodil-lib/src/main/scala/org/apache/daffodil/lib/util/Portability.scala
and put the fixup code there. Give it a name like "def
fixBrokenFileURI(...)".
There really should be exactly one place in the whole code base that calls
System.property("os.name")
Right now the only call to System.property("os.name") is in the CLI test
rig. Adding this second one requires centralizing this kind of thing. We have
other Java JVM versions and Scala version things creeping into the code base as
well, so it would be good to kick off the central place for this sort of thing.
--
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]