From 3f0d86ad11afe3ad43ee58a87b0778dbd42b4aa5 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 3 Jun 2020 17:30:03 +0200 Subject: [PATCH 1/2] Fix #168: Commons-IO signatures fails to resolve in commons-io v2.7, as there was an incompatible change; This also adds signatures for version 2.7. TODO: Scan for other API differences (new methods) in 2.7 vs. 2.6 --- .../signatures/commons-io-unsafe-1.0.txt | 2 ++ .../signatures/commons-io-unsafe-2.7.txt | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-2.7.txt diff --git a/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt b/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt index 260b7730..e4e8f0a8 100644 --- a/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt +++ b/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt @@ -14,6 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +@ignoreUnresolvable + @defaultMessage Uses default charset org.apache.commons.io.CopyUtils#copy(byte[],java.io.Writer) org.apache.commons.io.CopyUtils#copy(java.io.InputStream,java.io.Writer) diff --git a/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-2.7.txt b/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-2.7.txt new file mode 100644 index 00000000..4f72c0dd --- /dev/null +++ b/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-2.7.txt @@ -0,0 +1,20 @@ +# (C) Copyright Uwe Schindler (Generics Policeman) and others. +# Parts of this work are licensed to the Apache Software Foundation (ASF) +# under one or more contributor license agreements. +# +# 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. + +@includeBundled commons-io-unsafe-2.6 + +@defaultMessage Uses default charset +org.apache.commons.io.output.AbstractByteArrayOutputStream#toString() From ecc7e6906d64fb6e58bf0c505baf3139ebf0b6f5 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 3 Jun 2020 17:37:53 +0200 Subject: [PATCH 2/2] Better fix: Move the ignoreUnresolvable to the end, so only the problematic method is affected --- .../forbiddenapis/signatures/commons-io-unsafe-1.0.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt b/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt index e4e8f0a8..49a98f05 100644 --- a/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt +++ b/src/main/resources/de/thetaphi/forbiddenapis/signatures/commons-io-unsafe-1.0.txt @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -@ignoreUnresolvable - @defaultMessage Uses default charset org.apache.commons.io.CopyUtils#copy(byte[],java.io.Writer) org.apache.commons.io.CopyUtils#copy(java.io.InputStream,java.io.Writer) @@ -25,4 +23,6 @@ org.apache.commons.io.IOUtils#toByteArray(java.io.Reader) org.apache.commons.io.IOUtils#toByteArray(java.lang.String) org.apache.commons.io.IOUtils#toString(byte[]) org.apache.commons.io.IOUtils#toString(java.io.InputStream) + +@ignoreUnresolvable org.apache.commons.io.output.ByteArrayOutputStream#toString()