Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public SourceVersion getSupportedSourceVersion()
* Update latest_tested to be the latest Java release on which this
* annotation processor has been tested without problems.
*/
int latest_tested = 23;
int latest_tested = 24;
int ordinal_9 = SourceVersion.RELEASE_9.ordinal();
int ordinal_latest = latest_tested - 9 + ordinal_9;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2020 Tada AB and other contributors, as listed below.
* Copyright (c) 2016-2025 Tada AB and other contributors, as listed below.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the The BSD 3-Clause License
Expand All @@ -15,6 +15,8 @@
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.MalformedURLException;

Expand Down Expand Up @@ -100,9 +102,11 @@ public class UDTScalarIOTest implements SQLData
s_utfgedicht = new byte[bb.limit()];
bb.get(s_utfgedicht);

s_url = new URL("http://tada.github.io/pljava/");
s_url = new URI("http://tada.github.io/pljava/").toURL();
}
catch ( CharacterCodingException | MalformedURLException e )
catch (
CharacterCodingException |
URISyntaxException | MalformedURLException e )
{
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class Backend
public static final boolean WITHOUT_ENFORCEMENT =
"disallow".equals(System.getProperty("java.security.manager"));

@SuppressWarnings("deprecation") // Java >= 10: .feature()
static final int JAVA_MAJOR = Runtime.version().major();

static
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.MalformedURLException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
Expand Down Expand Up @@ -182,9 +183,10 @@ public static String hello(
{
try
{
new URL("sqlj:x"); // sqlj scheme must exist when reading policy
// sqlj scheme must exist when reading policy
new URI("sqlj", "x", null).toURL();
}
catch ( MalformedURLException e )
catch ( MalformedURLException | URISyntaxException e )
{
throw new SecurityException(
"failed to create sqlj: URL scheme needed for security policy",
Expand Down Expand Up @@ -269,6 +271,7 @@ private static void setPolicyURLs()
prevURL = Security.getProperty( "policy.url." + prevIndex);
if ( null == prevURL )
{
@SuppressWarnings("deprecation") // Java >= 10: feature()
boolean hint =
(2 == urlIndex) && 24 <= Runtime.version().major();

Expand Down Expand Up @@ -332,6 +335,7 @@ private static void beginEnforcing() throws SQLException
}
}

@SuppressWarnings("deprecation") // Java >= 10: feature()
int major = Runtime.version().major();

if ( 17 <= major )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2020 Tada AB and other contributors, as listed below.
* Copyright (c) 2004-2025 Tada AB and other contributors, as listed below.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the The BSD 3-Clause License
Expand Down Expand Up @@ -848,7 +848,9 @@ else if(cls == URL.class && value instanceof String)
{
try
{
return (T)new URL((String)value);
@SuppressWarnings("deprecation") // PL/Java major rev or forever
T result = (T)new URL((String)value);
return result;
}
catch(MalformedURLException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ public URL readURL() throws SQLException
{
try
{
return new URL(this.readString());
@SuppressWarnings("deprecation") //'til PL/Java major rev or forever
URL u = new URL(this.readString());
return u;
}
catch( Exception e )
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 Tada AB and other contributors, as listed below.
* Copyright (c) 2018-2025 Tada AB and other contributors, as listed below.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the The BSD 3-Clause License
Expand Down Expand Up @@ -209,6 +209,7 @@ protected SQLXMLImpl(V backing)
@Override
public void free() throws SQLException
{
@SuppressWarnings("unchecked") // javac 24 first to warn here
V backing = (V)s_backingVH.getAndSet(this, null);
if ( null == backing )
return;
Expand Down Expand Up @@ -290,6 +291,7 @@ public <T extends Result> T setResult(Class<T> resultClass)

protected V backingIfNotFreed() throws SQLException
{
@SuppressWarnings("unchecked") // javac 24 first to warn here
V backing = (V)s_backingVH.getAcquire(this);
if ( null == backing )
throw new SQLNonTransientException(
Expand Down Expand Up @@ -397,6 +399,7 @@ protected String toString(Object o)
{
if ( null == o )
o = this;
@SuppressWarnings("unchecked") // javac 24 first to warn here
V backing = (V)s_backingVH.getAcquire(this);
if ( null != backing )
return backing.toString(o);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ static void addClassImages(int jarId, String urlString)
{
try
{
@SuppressWarnings("deprecation") // until next PL/Java major rev
URL url = new URL(urlString);
URLConnection uc = url.openConnection();
uc.setRequestProperty("Accept",
Expand Down
5 changes: 4 additions & 1 deletion pljava/src/main/java/org/postgresql/pljava/sqlj/Loader.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ public static ClassLoader getSchemaLoader(Identifier.Simple schema)
{
while(rs.next())
{
@SuppressWarnings("deprecation") // until PL/Java major rev
URL jarUrl = new URL("sqlj:" + rs.getString(2));
CodeSource cs = new CodeSource(jarUrl, (CodeSigner[])null);

Expand Down Expand Up @@ -353,12 +354,14 @@ private static URL entryURL(int entryId)
{
try
{
return doPrivileged(() -> new URL(
@SuppressWarnings("deprecation") // Java >= 20: URL.of(uri,handler)
URL u = doPrivileged(() -> new URL(
"dbf",
"localhost",
-1,
"/" + entryId,
EntryStreamHandler.getInstance()));
return u;
}
catch(MalformedURLException e)
{
Expand Down
Loading