From f5c3f884d4db8ed36d45ecf7bc4704dbe349672e Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 3 Jun 2020 19:58:09 +0200 Subject: [PATCH] Fix commons-io signatures that fail in commons-io v2.7 (#169) 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 (a new abstract class that caused this issue). In a later version of forbiddenapis there will be a more robust fix for this (resolving virtual methods during signatures parsing) --- .../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..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 @@ -23,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() 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()