Closed josepowera closed 2 years ago
I could not reproduce warnings relating to the Aerospike Record class. I installed java 17 and maven 3.8.5 and changed the java version in pom.xml.
<java.version>17</java.version>
I also added showWarnings to the compiler plugin in client and examples pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
I did receive new warnings in ResultSet.java and Buffer.java which will be fixed in the next release.
[WARNING] aerospike-client-java/client/src/com/aerospike/client/query/ResultSet.java:[33,43] Integer(int) in java.lang.Integer has been deprecated and marked for removal
[WARNING] aerospike-client-java/client/src/com/aerospike/client/command/Buffer.java:[382,32] Long(long) in java.lang.Long has been deprecated and marked for removal
[WARNING] aerospike-client-java/client/src/com/aerospike/client/command/Buffer.java:[386,32] Long(long) in java.lang.Long has been deprecated and marked for removal
[WARNING] aerospike-client-java/client/src/com/aerospike/client/command/Buffer.java:[400,24] Long(long) in java.lang.Long has been deprecated and marked for removal
I did not receive any warnings related to the Record class. I even added a java "record" to the examples project and called it from an example that uses an Aerospike Record:
public record Person (String name, String address) {}
private void runMultiBinTest(AerospikeClient client, Parameters params) throws Exception {
Person person = new Person("My name", "My address");
System.out.println(person);
...
Record record = client.get(params.policy, key);
...
}
$ java --version
java 17.0.3 2022-04-19 LTS
Java(TM) SE Runtime Environment (build 17.0.3+8-LTS-111)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.3+8-LTS-111, mixed mode, sharing)
$ mvn --version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /opt/maven
Java version: 17.0.3, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-17
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.19.0-14-amd64", arch: "amd64", family: "unix"
How are you getting Record warnings?
Now that Record is defined in plain java (and also historically in aerospike client) it would be probably great to rename com.aerospike.client.Record to com.aerospike.client.AerospikeRecord since otherwise Java in new versions gives many "ambigious warnings".