diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2020-08-16 23:18:19 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2020-08-16 23:18:19 +0000 |
commit | b57da2dadafa52b0e1f93845d01e572f118c23d2 (patch) | |
tree | 4cc478eb183628ec6870d6c04dff0a5738df3ad9 /src/resources | |
parent | d6a97ce38d1fe4f266949110b76b38741149f2c3 (diff) | |
download | poi-b57da2dadafa52b0e1f93845d01e572f118c23d2.tar.gz poi-b57da2dadafa52b0e1f93845d01e572f118c23d2.zip |
#64036 - Replace reflection calls in factories for Java 9+
ImageRenderer implementation are now loaded via ServiceLoader
fixed the ServiceLoader.load invocations to pass a sensible ClassLoader as OSGi preparation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1880909 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/resources')
4 files changed, 59 insertions, 1 deletions
diff --git a/src/resources/devtools/forbidden-signatures.txt b/src/resources/devtools/forbidden-signatures.txt index facc47035f..dbe56c1022 100644 --- a/src/resources/devtools/forbidden-signatures.txt +++ b/src/resources/devtools/forbidden-signatures.txt @@ -136,4 +136,7 @@ java.lang.String#toString() #java.util.Hashtable
@defaultMessage DatatypeConverter is not available in Java 9+ without adding add-opens - use java.util.Base64
-javax.xml.bind.DatatypeConverter
\ No newline at end of file +javax.xml.bind.DatatypeConverter
+
+@defaultMessage don't rely on the threads ContextClassLoader - provide the classloader via load(Class, Classloader)
+java.util.ServiceLoader#load(java.lang.Class)
\ No newline at end of file diff --git a/src/resources/main/META-INF/services/org.apache.poi.sl.draw.ImageRenderer b/src/resources/main/META-INF/services/org.apache.poi.sl.draw.ImageRenderer new file mode 100644 index 0000000000..a911eb6cb4 --- /dev/null +++ b/src/resources/main/META-INF/services/org.apache.poi.sl.draw.ImageRenderer @@ -0,0 +1,18 @@ +# ==================================================================== +# 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. +# ==================================================================== + +org.apache.poi.sl.draw.BitmapImageRenderer
\ No newline at end of file diff --git a/src/resources/ooxml/META-INF/services/org.apache.poi.sl.draw.ImageRenderer b/src/resources/ooxml/META-INF/services/org.apache.poi.sl.draw.ImageRenderer new file mode 100644 index 0000000000..f5f7bb9556 --- /dev/null +++ b/src/resources/ooxml/META-INF/services/org.apache.poi.sl.draw.ImageRenderer @@ -0,0 +1,18 @@ +# ==================================================================== +# 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. +# ==================================================================== + +org.apache.poi.xslf.draw.SVGImageRenderer
\ No newline at end of file diff --git a/src/resources/scratchpad/META-INF/services/org.apache.poi.sl.draw.ImageRenderer b/src/resources/scratchpad/META-INF/services/org.apache.poi.sl.draw.ImageRenderer new file mode 100644 index 0000000000..c3149c3aa9 --- /dev/null +++ b/src/resources/scratchpad/META-INF/services/org.apache.poi.sl.draw.ImageRenderer @@ -0,0 +1,19 @@ +# ==================================================================== +# 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. +# ==================================================================== + +org.apache.poi.hwmf.draw.HwmfImageRenderer +org.apache.poi.hemf.draw.HemfImageRenderer |