diff --git a/spring-boot-parent/pom.xml b/spring-boot-parent/pom.xml index 447426bbcc..8034a8c5db 100644 --- a/spring-boot-parent/pom.xml +++ b/spring-boot-parent/pom.xml @@ -294,7 +294,7 @@ org.codehaus.mojo animal-sniffer-maven-plugin - 1.14 + 1.15 org.codehaus.cargo diff --git a/spring-boot-tools/spring-boot-loader-tools/pom.xml b/spring-boot-tools/spring-boot-loader-tools/pom.xml index 6b8986c423..fa5721943d 100644 --- a/spring-boot-tools/spring-boot-loader-tools/pom.xml +++ b/spring-boot-tools/spring-boot-loader-tools/pom.xml @@ -132,8 +132,10 @@ org.codehaus.mojo animal-sniffer-maven-plugin - - true + + org.springframework.boot.loader.tools.UsesUnsafeJava + org.springframework.lang.UsesJava7 + diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java index f00b7c5ee9..a0eb52b018 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java @@ -42,6 +42,8 @@ import java.util.jar.Manifest; import java.util.zip.CRC32; import java.util.zip.ZipEntry; +import org.springframework.lang.UsesJava7; + /** * Writes JAR content, ensuring valid directory entries are always create and duplicate * items are ignored. @@ -86,6 +88,7 @@ public class JarWriter { this.jarOutput = new JarOutputStream(fileOutputStream); } + @UsesJava7 private void setExecutableFilePermission(File file) { try { Path path = file.toPath(); diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.java index ad2c0c6db2..699fe2f1de 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.java @@ -26,6 +26,7 @@ import sun.misc.SignalHandler; * @since 1.1.0 */ @SuppressWarnings("restriction") +@UsesUnsafeJava public final class SignalUtils { private static final Signal SIG_INT = new Signal("INT"); diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/UsesUnsafeJava.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/UsesUnsafeJava.java new file mode 100644 index 0000000000..102e87a5fc --- /dev/null +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/UsesUnsafeJava.java @@ -0,0 +1,34 @@ +/* + * Copyright 2012-2015 the original author or authors. + * + * Licensed 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.springframework.boot.loader.tools; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicates that the annotated element uses unsafe Java calls. + * + * @author Phillip Webb + */ +@Retention(RetentionPolicy.CLASS) +@Target({ ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE }) +@Documented +@interface UsesUnsafeJava { +}