Elffuss BraidHub

kikocis/java-driver public

JAVA-1136: Enable JDK signature check in module driver-extras.

The animal-sniffer plugin is now configured to run twice: once against JDK6 (excluding classes in jdk8 package),
then against JDK8 (nothing excluded).
Changesetbd350391f78d832ffa6bf8c6e074251908160d5e5650acf1431bec4f8eae90df
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2016-03-24 17:02 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2016-04-20 18:01 +02:00
Parents6e44dad32a41

Browse the files at this changeset

9 files changed

modified changelog/README.md +1 −0
@@ -9,6 +9,7 @@
99 - [bug] JAVA-1074: Fix documentation around default timestamp generator.
1010 - [improvement] JAVA-1109: Document SSLOptions changes in upgrade guide.
1111 - [improvement] JAVA-1065: Add method to create token from partition key values.
12+- [improvement] JAVA-1136: Enable JDK signature check in module driver-extras.
1213
1314 Merged from 2.1 branch:
1415
modified driver-extras/pom.xml +33 −12
@@ -142,18 +142,39 @@
142142 <plugin>
143143 <groupId>org.codehaus.mojo</groupId>
144144 <artifactId>animal-sniffer-maven-plugin</artifactId>
145- <configuration>
146- <!--
147- There is no support for JDK 8 yet, see
148- https://github.com/mojohaus/animal-sniffer/issues/1
149- -->
150- <skip>true</skip>
151- <signature>
152- <groupId>org.codehaus.mojo.signature</groupId>
153- <artifactId>java18</artifactId>
154- <version>1.0</version>
155- </signature>
156- </configuration>
145+ <executions>
146+ <execution>
147+ <id>check</id>
148+ <phase>process-classes</phase>
149+ <goals>
150+ <goal>check</goal>
151+ </goals>
152+ <configuration>
153+ <signature>
154+ <groupId>org.codehaus.mojo.signature</groupId>
155+ <artifactId>java16</artifactId>
156+ <version>1.0</version>
157+ </signature>
158+ <annotations>
159+ <annotation>com.datastax.driver.extras.codecs.jdk8.IgnoreJDK6Requirement</annotation>
160+ </annotations>
161+ </configuration>
162+ </execution>
163+ <execution>
164+ <id>check-jdk8</id>
165+ <phase>process-classes</phase>
166+ <goals>
167+ <goal>check</goal>
168+ </goals>
169+ <configuration>
170+ <signature>
171+ <groupId>org.codehaus.mojo.signature</groupId>
172+ <artifactId>java18</artifactId>
173+ <version>1.0</version>
174+ </signature>
175+ </configuration>
176+ </execution>
177+ </executions>
157178 </plugin>
158179
159180 <plugin>
added driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/IgnoreJDK6Requirement.java +25 −0
@@ -0,0 +1,25 @@
1+/*
2+ * Copyright (C) 2012-2015 DataStax Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.datastax.driver.extras.codecs.jdk8;
17+
18+/**
19+ * Annotation used to mark classes in this package as
20+ * excluded from JDK signature check performed
21+ * by <a href="http://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/check-mojo.html">animal-sniffer</a>
22+ * Maven plugin as they require JDK 8 and not the usual JDK 6.
23+ */
24+@interface IgnoreJDK6Requirement {
25+}
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java +2 −1
@@ -47,7 +47,8 @@
4747 * @see ZonedDateTimeCodec
4848 * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">'Working with timestamps' section of CQL specification</a>
4949 */
50-public class InstantCodec extends TypeCodec<Instant> {
50+@IgnoreJDK6Requirement
51+public class InstantCodec extends TypeCodec<java.time.Instant> {
5152
5253 public static final InstantCodec instance = new InstantCodec();
5354
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalDateCodec.java +1 −0
@@ -33,6 +33,7 @@
3333 * {@link TypeCodec} that maps
3434 * {@link java.time.LocalDate} to CQL {@code date}.
3535 */
36+@IgnoreJDK6Requirement
3637 public class LocalDateCodec extends TypeCodec<LocalDate> {
3738
3839 public static final LocalDateCodec instance = new LocalDateCodec();
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/LocalTimeCodec.java +1 −0
@@ -30,6 +30,7 @@
3030 /**
3131 * {@link TypeCodec} that maps {@link LocalTime} to CQL {@code time} (long representing nanoseconds since midnight).
3232 */
33+@IgnoreJDK6Requirement
3334 public class LocalTimeCodec extends TypeCodec<LocalTime> {
3435
3536 public static final LocalTimeCodec instance = new LocalTimeCodec();
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/OptionalCodec.java +1 −0
@@ -30,6 +30,7 @@
3030 *
3131 * @param <T> The wrapped Java type
3232 */
33+@IgnoreJDK6Requirement
3334 public class OptionalCodec<T> extends MappingCodec<Optional<T>, T> {
3435
3536 private final Predicate<T> isAbsent;
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java +1 −0
@@ -53,6 +53,7 @@
5353 *
5454 * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">'Working with timestamps' section of CQL specification</a>
5555 */
56+@IgnoreJDK6Requirement
5657 public class ZonedDateTimeCodec extends TypeCodec.AbstractTupleCodec<ZonedDateTime> {
5758
5859 /**
modified pom.xml +1 −1
@@ -357,7 +357,7 @@
357357 <plugin>
358358 <groupId>org.codehaus.mojo</groupId>
359359 <artifactId>animal-sniffer-maven-plugin</artifactId>
360- <version>1.14</version>
360+ <version>1.15</version>
361361 <configuration>
362362 <signature>
363363 <groupId>org.codehaus.mojo.signature</groupId>