From fbee7ef94210ba78058819910d07c7ab08cad50c Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 12 Jul 2013 09:35:40 +0000 Subject: [PATCH] Refactor forbidden-apis a bit to make it easier to add new signatures, no need to have so many files slowing down the build; add Properties file rules git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1502493 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/analysis/stempel/pom.xml.template | 3 +-- .../maven/lucene/benchmark/pom.xml.template | 3 +-- .../maven/lucene/core/src/java/pom.xml.template | 3 +-- dev-tools/maven/lucene/demo/pom.xml.template | 3 +-- dev-tools/maven/lucene/facet/pom.xml.template | 3 +-- dev-tools/maven/lucene/misc/pom.xml.template | 3 +-- dev-tools/maven/lucene/pom.xml.template | 6 ++---- .../maven/lucene/queryparser/pom.xml.template | 3 +-- .../lucene/test-framework/pom.xml.template | 3 +-- .../maven/solr/core/src/java/pom.xml.template | 3 +-- .../maven/solr/core/src/test/pom.xml.template | 3 +-- dev-tools/maven/solr/pom.xml.template | 6 ++---- .../maven/solr/solrj/src/java/pom.xml.template | 3 +-- .../maven/solr/solrj/src/test/pom.xml.template | 3 +-- .../maven/solr/test-framework/pom.xml.template | 3 +-- lucene/build.xml | 3 +-- .../forbiddenApis/{executors.txt => base.txt} | 13 ++++++++----- lucene/tools/forbiddenApis/chars.txt | 17 ----------------- solr/build.xml | 3 +-- 19 files changed, 27 insertions(+), 60 deletions(-) rename lucene/tools/forbiddenApis/{executors.txt => base.txt} (58%) delete mode 100644 lucene/tools/forbiddenApis/chars.txt diff --git a/dev-tools/maven/lucene/analysis/stempel/pom.xml.template b/dev-tools/maven/lucene/analysis/stempel/pom.xml.template index 89c77c61d39..acc5c7eabba 100644 --- a/dev-tools/maven/lucene/analysis/stempel/pom.xml.template +++ b/dev-tools/maven/lucene/analysis/stempel/pom.xml.template @@ -95,8 +95,7 @@ jdk-deprecated - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/benchmark/pom.xml.template b/dev-tools/maven/lucene/benchmark/pom.xml.template index ec3eace25ed..03ab8a9818b 100755 --- a/dev-tools/maven/lucene/benchmark/pom.xml.template +++ b/dev-tools/maven/lucene/benchmark/pom.xml.template @@ -141,8 +141,7 @@ - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/core/src/java/pom.xml.template b/dev-tools/maven/lucene/core/src/java/pom.xml.template index d1af906f0a5..22f01c6f3e6 100644 --- a/dev-tools/maven/lucene/core/src/java/pom.xml.template +++ b/dev-tools/maven/lucene/core/src/java/pom.xml.template @@ -86,8 +86,7 @@ jdk-deprecated - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/demo/pom.xml.template b/dev-tools/maven/lucene/demo/pom.xml.template index b46698a2f60..30c778152aa 100644 --- a/dev-tools/maven/lucene/demo/pom.xml.template +++ b/dev-tools/maven/lucene/demo/pom.xml.template @@ -112,8 +112,7 @@ - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/facet/pom.xml.template b/dev-tools/maven/lucene/facet/pom.xml.template index 6fc88720beb..a6df1f5f7c8 100755 --- a/dev-tools/maven/lucene/facet/pom.xml.template +++ b/dev-tools/maven/lucene/facet/pom.xml.template @@ -97,8 +97,7 @@ jdk-deprecated - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/misc/pom.xml.template b/dev-tools/maven/lucene/misc/pom.xml.template index b816a7c9c34..795e19704cd 100644 --- a/dev-tools/maven/lucene/misc/pom.xml.template +++ b/dev-tools/maven/lucene/misc/pom.xml.template @@ -85,8 +85,7 @@ jdk-deprecated - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/pom.xml.template b/dev-tools/maven/lucene/pom.xml.template index cbdbf07e304..f4dc978f1b5 100644 --- a/dev-tools/maven/lucene/pom.xml.template +++ b/dev-tools/maven/lucene/pom.xml.template @@ -77,8 +77,7 @@ jdk-system-out - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt @@ -96,8 +95,7 @@ ${top-level}/lucene/tools/forbiddenApis/tests.txt - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/queryparser/pom.xml.template b/dev-tools/maven/lucene/queryparser/pom.xml.template index bf91090e8ce..fd4d4a1f556 100644 --- a/dev-tools/maven/lucene/queryparser/pom.xml.template +++ b/dev-tools/maven/lucene/queryparser/pom.xml.template @@ -100,8 +100,7 @@ jdk-deprecated - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/lucene/test-framework/pom.xml.template b/dev-tools/maven/lucene/test-framework/pom.xml.template index f31c7284f58..a9e962b5f5c 100644 --- a/dev-tools/maven/lucene/test-framework/pom.xml.template +++ b/dev-tools/maven/lucene/test-framework/pom.xml.template @@ -104,9 +104,8 @@ jdk-deprecated + ${top-level}/lucene/tools/forbiddenApis/base.txt ${top-level}/lucene/tools/forbiddenApis/tests.txt - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt diff --git a/dev-tools/maven/solr/core/src/java/pom.xml.template b/dev-tools/maven/solr/core/src/java/pom.xml.template index dee48c7f7eb..9e9885994c3 100644 --- a/dev-tools/maven/solr/core/src/java/pom.xml.template +++ b/dev-tools/maven/solr/core/src/java/pom.xml.template @@ -391,9 +391,8 @@ commons-io-unsafe-${commons-io.version} - ${top-level}/lucene/tools/forbiddenApis/executors.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt ${top-level}/lucene/tools/forbiddenApis/servlet-api.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt diff --git a/dev-tools/maven/solr/core/src/test/pom.xml.template b/dev-tools/maven/solr/core/src/test/pom.xml.template index 18f300424cf..1b2fa8e1c3f 100644 --- a/dev-tools/maven/solr/core/src/test/pom.xml.template +++ b/dev-tools/maven/solr/core/src/test/pom.xml.template @@ -278,9 +278,8 @@ commons-io-unsafe-${commons-io.version} + ${top-level}/lucene/tools/forbiddenApis/base.txt ${top-level}/lucene/tools/forbiddenApis/servlet-api.txt - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt diff --git a/dev-tools/maven/solr/pom.xml.template b/dev-tools/maven/solr/pom.xml.template index 1b35e2b540e..7cc15da457d 100644 --- a/dev-tools/maven/solr/pom.xml.template +++ b/dev-tools/maven/solr/pom.xml.template @@ -148,8 +148,7 @@ jdk-deprecated - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt @@ -169,8 +168,7 @@ ${top-level}/lucene/tools/forbiddenApis/tests.txt - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/solr/solrj/src/java/pom.xml.template b/dev-tools/maven/solr/solrj/src/java/pom.xml.template index 5992d60bad5..1904208065e 100644 --- a/dev-tools/maven/solr/solrj/src/java/pom.xml.template +++ b/dev-tools/maven/solr/solrj/src/java/pom.xml.template @@ -154,8 +154,7 @@ commons-io-unsafe-${commons-io.version} - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt + ${top-level}/lucene/tools/forbiddenApis/base.txt diff --git a/dev-tools/maven/solr/solrj/src/test/pom.xml.template b/dev-tools/maven/solr/solrj/src/test/pom.xml.template index f0d0ebf9ebc..6af46535d1b 100644 --- a/dev-tools/maven/solr/solrj/src/test/pom.xml.template +++ b/dev-tools/maven/solr/solrj/src/test/pom.xml.template @@ -140,9 +140,8 @@ commons-io-unsafe-${commons-io.version} + ${top-level}/lucene/tools/forbiddenApis/base.txt ${top-level}/lucene/tools/forbiddenApis/tests.txt - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt diff --git a/dev-tools/maven/solr/test-framework/pom.xml.template b/dev-tools/maven/solr/test-framework/pom.xml.template index 4125238ac0f..37800a9f88a 100644 --- a/dev-tools/maven/solr/test-framework/pom.xml.template +++ b/dev-tools/maven/solr/test-framework/pom.xml.template @@ -128,10 +128,9 @@ commons-io-unsafe-${commons-io.version} + ${top-level}/lucene/tools/forbiddenApis/base.txt ${top-level}/lucene/tools/forbiddenApis/servlet-api.txt ${top-level}/lucene/tools/forbiddenApis/tests.txt - ${top-level}/lucene/tools/forbiddenApis/executors.txt - ${top-level}/lucene/tools/forbiddenApis/chars.txt diff --git a/lucene/build.xml b/lucene/build.xml index b02ec6e31dc..434845002d6 100644 --- a/lucene/build.xml +++ b/lucene/build.xml @@ -184,8 +184,7 @@ - - + diff --git a/lucene/tools/forbiddenApis/executors.txt b/lucene/tools/forbiddenApis/base.txt similarity index 58% rename from lucene/tools/forbiddenApis/executors.txt rename to lucene/tools/forbiddenApis/base.txt index a502959bdaf..b5e3f843b82 100644 --- a/lucene/tools/forbiddenApis/executors.txt +++ b/lucene/tools/forbiddenApis/base.txt @@ -13,11 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# see Solr's DefaultSolrThreadFactory -# see Lucene's NamedThreadFactory - -@defaultMessage spawns threads with vague names; use a custom thread factory and name threads so that you can tell (by its name) which executor it is associated with - +@defaultMessage Spawns threads with vague names; use a custom thread factory (Lucene's NamedThreadFactory, Solr's DefaultSolrThreadFactory) and name threads so that you can tell (by its name) which executor it is associated with java.util.concurrent.Executors#newFixedThreadPool(int) java.util.concurrent.Executors#newSingleThreadExecutor() java.util.concurrent.Executors#newCachedThreadPool() @@ -25,3 +21,10 @@ java.util.concurrent.Executors#newSingleThreadScheduledExecutor() java.util.concurrent.Executors#newScheduledThreadPool(int) java.util.concurrent.Executors#defaultThreadFactory() java.util.concurrent.Executors#privilegedThreadFactory() + +@defaultMessage Properties files should be read/written with InputStream/OutputStream for maximum compatibility, as it uses the official "properties file format" with unicode escapes and properly defined encoding +java.util.Properties#load(java.io.Reader) +java.util.Properties#store(java.io.Writer,java.lang.String) + +java.lang.Character#codePointBefore(char[],int) @ Implicit start offset is error-prone when the char[] is a buffer and the first chars are random chars +java.lang.Character#codePointAt(char[],int) @ Implicit end offset is error-prone when the char[] is a buffer and the last chars are random chars diff --git a/lucene/tools/forbiddenApis/chars.txt b/lucene/tools/forbiddenApis/chars.txt deleted file mode 100644 index a5679cb0629..00000000000 --- a/lucene/tools/forbiddenApis/chars.txt +++ /dev/null @@ -1,17 +0,0 @@ -# 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. - -java.lang.Character#codePointBefore(char[],int) @ Implicit start offset is error-prone when the char[] is a buffer and the first chars are random chars -java.lang.Character#codePointAt(char[],int) @ Implicit end offset is error-prone when the char[] is a buffer and the last chars are random chars diff --git a/solr/build.xml b/solr/build.xml index 0b28be408a3..a1c4e3ff1ba 100644 --- a/solr/build.xml +++ b/solr/build.xml @@ -265,8 +265,7 @@ - - +