Skip to content

Commit

Permalink
X.26 common compile flags (#865)
Browse files Browse the repository at this point in the history
* Initial branch of x.26

* Error on deprecated (#862)

* Review deprecated methods, change build to error on deprecation

* <release>8</release>

* Fix compilation on Java 21

* Don't use UnsafeText here

* Don't use UnsafeText here

* Use release 8 only for Java 11+

* MacOSX issue on modification date

* Clarify why the @deprecated is commented out.

* Clarify why the @deprecated is commented out.

* Use a common configuration for the compiler-plugin where deprecation warnings cause the build to fail
  • Loading branch information
peter-lawrey committed Apr 15, 2024
1 parent bca9e5e commit 03f3fb5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
19 changes: 2 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>net.openhft</groupId>
<artifactId>java-parent-pom</artifactId>
<version>1.25.4</version>
<version>1.26.0-SNAPSHOT</version>
<relativePath/>
</parent>

Expand All @@ -42,7 +42,7 @@
<dependency>
<groupId>net.openhft</groupId>
<artifactId>third-party-bom</artifactId>
<version>3.25.2</version>
<version>3.26.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -228,21 +228,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:deprecation,-options</arg>
<arg>-parameters</arg>
</compilerArgs>
<source>8</source>
<target>8</target>
<encoding>UTF-8</encoding>
<failOnWarning>true</failOnWarning>
</configuration>
</plugin>
<!--
generate maven dependencies versions file that can be used later
to install the right bundle in test phase.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ public class VanillaMethodWriterBuilder<T> implements Builder<T>, MethodWriterBu
Serializable.class,
CharSequence.class,
Comparable.class,
Comparator.class,
Observer.class
Comparator.class
);

// Flag to indicate if the proxy generation is disabled
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/openhft/chronicle/wire/Wires.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public enum Wires {
if (tClass == Marshallable.class)
interfaces = new Class[]{Marshallable.class};
try {
@SuppressWarnings("deprecation")
Class<?> proxyClass = Proxy.getProxyClass(tClass.getClassLoader(), interfaces);
Constructor<?> constructor = proxyClass.getConstructor(InvocationHandler.class);
constructor.setAccessible(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public class ChronicleContext extends SimpleCloseable {
// URL for the Chronicle context
private final String url;
private String name;
@SuppressWarnings("deprecation")
private transient URL _url;

// Socket Registry for handling socket related operations
Expand Down Expand Up @@ -131,6 +132,7 @@ public static ChronicleContext newContext(String url) {
* @return the URL parsed from the string.
* @throws IORuntimeException if the string cannot be parsed as a URL.
*/
@SuppressWarnings("deprecation")
public static URL urlFor(String spec) throws IORuntimeException {
try {
if (spec.startsWith("internal:"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void file() throws IOException {
// Write expected messages to the file specified in the URL and verify its content
public void file(String query, String expected) throws IOException {
final File file = new File(OS.getTarget(), "tmp-" + System.nanoTime());
@SuppressWarnings("deprecation")
final URL url = new URL("file://" + file.getAbsolutePath() + query);
writeMessages(url);
final Bytes bytes = BytesUtil.readFile(file.getAbsolutePath());
Expand Down Expand Up @@ -117,6 +118,7 @@ public void http() throws IOException, InterruptedException {
server.createContext("/echo", new Handler(queue));
server.start();
try {
@SuppressWarnings("deprecation")
final URL url = new URL("http://localhost:" + port + "/echo");
writeMessages(url);
assertEquals(
Expand All @@ -142,6 +144,7 @@ public void http2() throws IOException, InterruptedException {
server.createContext("/echo", new Handler(queue));
server.start();
try {
@SuppressWarnings("deprecation")
final URL url = new URL("http://localhost:" + port + "/echo/append");
writeMessages(url);
assertEquals(
Expand All @@ -166,6 +169,7 @@ public void httpBinary() throws IOException, InterruptedException {
server.createContext("/echo", new Handler(queue));
server.start();
try {
@SuppressWarnings("deprecation")
final URL url = new URL("http://localhost:" + port + "/echo");
writeMessages(url, WireType.BINARY_LIGHT);
} finally {
Expand Down Expand Up @@ -229,6 +233,7 @@ public void init(JLBH jlbh) {
server = HttpServer.create(new InetSocketAddress(PORT), 50);
server.createContext("/bench", new BenchHandler());
server.start();
@SuppressWarnings("deprecation")
final URL url = new URL("http://localhost:" + PORT + "/bench");
MarshallableOut out = MarshallableOut.builder(url).wireType(WireType.JSON_ONLY).get();
timed = out.methodWriter(Timed.class);
Expand Down

0 comments on commit 03f3fb5

Please sign in to comment.