Skip to content

Commit

Permalink
Set javac source/target and scalac release to 21.
Browse files Browse the repository at this point in the history
  • Loading branch information
robby-phd committed Aug 27, 2024
1 parent 5551ec8 commit bcd6e66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/jvm/src/main/scala/org/sireum/Os_Ext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ object Os_Ext {
java.net.CookieHandler.setDefault(cookieManager)

def fetch(loc: Predef.String): java.net.HttpURLConnection = {
val c = new java.net.URL(loc).openConnection().asInstanceOf[java.net.HttpURLConnection]
val c = new java.net.URI(loc).toURL.openConnection().asInstanceOf[java.net.HttpURLConnection]
c.setInstanceFollowRedirects(false)
c.setUseCaches(false)
val responseCode = c.getResponseCode
if (301 <= responseCode && responseCode <= 303 || responseCode == 307 || responseCode == 308) {
var newLoc = c.getHeaderField("Location")
if (newLoc.startsWith("/")) {
val locUrl = new java.net.URL(loc)
val locUrl = new java.net.URI(loc).toURL
newLoc = s"${locUrl.getProtocol}://${locUrl.getHost}$newLoc"
}
fetch(newLoc)
Expand Down Expand Up @@ -541,7 +541,7 @@ object Os_Ext {

def readIndexableCPath(path: String): Indexable.Pos[C] with AutoCloseable = readIndexableC(Some(toUri(path)), new FR(path.value))

def readIndexableCUrl(url: String): Indexable.Pos[C] with AutoCloseable = readIndexableC(Some(url), new ISR(new java.net.URL(url.value).openStream()))
def readIndexableCUrl(url: String): Indexable.Pos[C] with AutoCloseable = readIndexableC(Some(url), new ISR(new java.net.URI(url.value).toURL.openStream()))

def readIndexableC(uriOpt: Option[String], reader: java.io.Reader): Indexable.Pos[C] with AutoCloseable = new Indexable.Pos[C] with AutoCloseable {
import org.sireum.U32._
Expand Down

0 comments on commit bcd6e66

Please sign in to comment.