From adaa0da80667e480994ba24fdbaba2e1927f8129 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 1 Sep 2014 13:44:46 +0200 Subject: [PATCH] #107 - Removed custom library with a fake Optional type. Related ticket: DATACMNS-571. --- java8/pom.xml | 29 ------------- java8/src/main/java/java/util/Optional.java | 47 --------------------- pom.xml | 19 ++++----- 3 files changed, 9 insertions(+), 86 deletions(-) delete mode 100644 java8/pom.xml delete mode 100644 java8/src/main/java/java/util/Optional.java diff --git a/java8/pom.xml b/java8/pom.xml deleted file mode 100644 index 35726add..00000000 --- a/java8/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - 4.0.0 - spring-data-java8-stub - - - org.springframework.data.build - spring-data-build - 1.5.0.BUILD-SNAPSHOT - - - Spring Data Build - Java 8 Stubs - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.6 - 1.6 - - - - - - diff --git a/java8/src/main/java/java/util/Optional.java b/java8/src/main/java/java/util/Optional.java deleted file mode 100644 index 087a3456..00000000 --- a/java8/src/main/java/java/util/Optional.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2014 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 java.util; - -/** - * Stub implementation of JDK 8's {@link Optional}. - * - * @author Oliver Gierke - */ -@SuppressWarnings("unused") -public final class Optional { - - private static final Optional EMPTY = new Optional(null); - - private final T value; - - private Optional(T value) { - this.value = value; - } - - public static Optional of(T value) { - return new Optional(value); - } - - public static Optional ofNullable(T value) { - return value == null ? Optional. empty() : of(value); - } - - @SuppressWarnings("unchecked") - public static Optional empty() { - Optional t = (Optional) EMPTY; - return t; - } -} diff --git a/pom.xml b/pom.xml index bd14dd82..efaea521 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ Spring Data Build Modules to centralize common resources and configuration for Spring Data Maven builds. https://github.com/SpringData/spring-data-build - + Pivotal Software, Inc. http://www.spring.io @@ -18,11 +18,10 @@ resources - java8 parent bom - + ogierke @@ -36,20 +35,20 @@ +1 - + Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 Copyright 2010 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 @@ -59,16 +58,16 @@ - + https://github.com/SpringSource/spring-data-build scm:git:git://github.com/SpringSource/spring-data-build.git scm:git:ssh://git@github.com:SpringSource/spring-data-build.git - + GitHub https://github.com/SpringSource/spring-data-build/issues - +