Skip to content
Permalink
Browse files
Add support for Java 11
  • Loading branch information
davecromberge committed Jun 17, 2021
1 parent 4379db0 commit 0f993f53a86a4e90c50ddb8d57dc71ea49ccbef2
Show file tree
Hide file tree
Showing 10 changed files with 399 additions and 41 deletions.
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-root</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>datasketches-memory-java11</artifactId>
<name>${project.artifactId}</name>

<properties>
<maven.install.skip>true</maven.install.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<java.version>11</java.version>
<jdk-toolchain.version>11</jdk-toolchain.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

</project>
@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.datasketches.memory.internal;

/**
* Extracts version-dependent field names into standalone class.
* Some field names in the VM internal class have changed in
* later versions. The appropriate class will be loaded by the class loader
* depending on the Java version that is used.
*
* For more information, see:
* https://openjdk.java.net/jeps/238
*/
class NioBitsFields {
static String COUNT_FIELD_NAME = "COUNT";
static String RESERVED_MEMORY_FIELD_NAME = "RESERVED_MEMORY";
static String TOTAL_CAPACITY_FIELD_NAME = "TOTAL_CAPACITY";
}
@@ -0,0 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.datasketches.memory.internal;
@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<html>
<head>
</head>
<body>
<h2>Memory</h2>
<h3>Overview</h3>

<p><b><a href="org/apache/datasketches/memory/package-summary.html">Memory Package Overview</a></b></p>

<p>Note: If the requirements or promises of any method's contract are not fulfilled (that is, if there is a bug in either the method or its caller), then an unchecked exception will be thrown. The precise type of such an unchecked exception does not form part of any method's contract.</p>
</body>
</html>
@@ -43,9 +43,9 @@

<profile>
<id>strict</id>
<!-- The error prone compiler is currently disabled for compilation in JDK 9+ -->
<!-- The error prone compiler is only currently supported for compilation in JDK 8 -->
<activation>
<jdk>1.8</jdk>
<jdk>[1.8, 1.9],8</jdk>
</activation>
<build>
<pluginManagement>
@@ -74,7 +74,7 @@ final class NioBits {

} catch (final ClassNotFoundException | NoSuchMethodException | IllegalAccessException
| IllegalArgumentException | SecurityException | NoSuchFieldException e) {
throw new RuntimeException("Could not acquire java.nio.Bits class: " + e.getClass());
throw new RuntimeException("Could not acquire java.nio.Bits class: " + e.getClass() + "exception: " + e.getMessage());
}
}

0 comments on commit 0f993f5

Please sign in to comment.