From 1f626d3458898f0e34cb6d9dbc861648c434ddc5 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 3 Dec 2015 01:45:06 -0500 Subject: [PATCH] forbidden third-party-signatures -> core-signatures This is a relic from shading where it was trickier to implement. Third party signatures are already in e.g. the test list, there is no reason to separate them out. Instead, we could have a third party signatures that does something different... like keep tabs on third party libraries. --- .../gradle/precommit/PrecommitTasks.groovy | 4 +--- .../resources/forbidden/core-signatures.txt | 9 +++++++ .../forbidden/third-party-signatures.txt | 24 ------------------- 3 files changed, 10 insertions(+), 27 deletions(-) delete mode 100644 buildSrc/src/main/resources/forbidden/third-party-signatures.txt diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy index 8b1a98139ba..04878d979e9 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy @@ -68,9 +68,7 @@ class PrecommitTasks { if (mainForbidden != null) { mainForbidden.configure { bundledSignatures += 'jdk-system-out' - signaturesURLs += [ - getClass().getResource('/forbidden/core-signatures.txt'), - getClass().getResource('/forbidden/third-party-signatures.txt')] + signaturesURLs += getClass().getResource('/forbidden/core-signatures.txt') } } Task testForbidden = project.tasks.findByName('forbiddenApisTest') diff --git a/buildSrc/src/main/resources/forbidden/core-signatures.txt b/buildSrc/src/main/resources/forbidden/core-signatures.txt index 0f54946ea37..c6ab430595c 100644 --- a/buildSrc/src/main/resources/forbidden/core-signatures.txt +++ b/buildSrc/src/main/resources/forbidden/core-signatures.txt @@ -90,3 +90,12 @@ org.elasticsearch.common.io.PathUtils#get(java.net.URI) @defaultMessage Don't use deprecated Query#setBoost, wrap the query into a BoostQuery instead org.apache.lucene.search.Query#setBoost(float) + +@defaultMessage Constructing a DateTime without a time zone is dangerous +org.joda.time.DateTime#() +org.joda.time.DateTime#(long) +org.joda.time.DateTime#(int, int, int, int, int) +org.joda.time.DateTime#(int, int, int, int, int, int) +org.joda.time.DateTime#(int, int, int, int, int, int, int) +org.joda.time.DateTime#now() +org.joda.time.DateTimeZone#getDefault() diff --git a/buildSrc/src/main/resources/forbidden/third-party-signatures.txt b/buildSrc/src/main/resources/forbidden/third-party-signatures.txt deleted file mode 100644 index 93e0eb043b5..00000000000 --- a/buildSrc/src/main/resources/forbidden/third-party-signatures.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to Elasticsearch under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch 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. - -@defaultMessage Constructing a DateTime without a time zone is dangerous -org.joda.time.DateTime#() -org.joda.time.DateTime#(long) -org.joda.time.DateTime#(int, int, int, int, int) -org.joda.time.DateTime#(int, int, int, int, int, int) -org.joda.time.DateTime#(int, int, int, int, int, int, int) -org.joda.time.DateTime#now() -org.joda.time.DateTimeZone#getDefault()