tdf#42949 Fix IWYU warnings in jvmfwk/ & jvmaccess/

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I6c1041f261ba5a6f81efd3dcbc12baf2746e1839
Reviewed-on: https://gerrit.libreoffice.org/71217
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/jvmaccess/IwyuFilter_jvmaccess.yaml b/jvmaccess/IwyuFilter_jvmaccess.yaml
new file mode 100644
index 0000000..43e850e
--- /dev/null
+++ b/jvmaccess/IwyuFilter_jvmaccess.yaml
@@ -0,0 +1,6 @@
---
assumeFilename: jvmaccess/source/classpath.cxx
blacklist:
    jvmaccess/source/classpath.cxx:
    # Needed to inherit linker visibility from function declaration
    - jvmaccess/classpath.hxx
diff --git a/jvmaccess/source/classpath.cxx b/jvmaccess/source/classpath.cxx
index c1a0d16..b4d0ef3 100644
--- a/jvmaccess/source/classpath.cxx
+++ b/jvmaccess/source/classpath.cxx
@@ -27,8 +27,6 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarExpandUrlReference.hpp>
@@ -39,6 +37,8 @@

#include <jni.h>

namespace com::sun::star::uno { class XComponentContext; }

jobjectArray jvmaccess::ClassPath::translateToUrls(
    css::uno::Reference< css::uno::XComponentContext > const & context,
    JNIEnv * environment, OUString const & classPath)
diff --git a/jvmfwk/IwyuFilter_jvmfwk.yaml b/jvmfwk/IwyuFilter_jvmfwk.yaml
new file mode 100644
index 0000000..13097cc
--- /dev/null
+++ b/jvmfwk/IwyuFilter_jvmfwk.yaml
@@ -0,0 +1,33 @@
---
assumeFilename: jvmfwk/source/fwkbase.cxx
blacklist:
    jvmfwk/inc/fwkutil.hxx:
    # Needed on MACOSX
    - config_folders.h
    # Don't replace with URE impl. detail
    - rtl/byteseq.hxx
    jvmfwk/inc/vendorbase.hxx:
    # OSL_BIGENDIAN is being checked
    - osl/endian.h
    jvmfwk/source/framework.cxx:
    # Don't replace with URE impl. detail
    - osl/thread.hxx
    jvmfwk/source/fwkbase.cxx:
    # Don't replace with URE impl. detail
    - osl/thread.hxx
    jvmfwk/source/fwkutil.cxx:
    # Needed on WIN32
    - sal/log.hxx
    jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx:
    # Don't replace with URE impl. detail
    - rtl/byteseq.hxx
    jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx:
    # Needed on WIN32
    - o3tl/char16_t2wchar_t.hxx
    # Don't replace with URE impl. detail
    - osl/thread.hxx
    # Don't replace with bits/types, needed for sig_atomic_t
    - signal.h
    jvmfwk/plugins/sunmajor/pluginlib/util.cxx:
    # Needed on MACOSX
    - config_folders.h
diff --git a/jvmfwk/inc/elements.hxx b/jvmfwk/inc/elements.hxx
index 88a785a..2bdaf4a 100644
--- a/jvmfwk/inc/elements.hxx
+++ b/jvmfwk/inc/elements.hxx
@@ -23,13 +23,14 @@

#include <memory>
#include <vector>
#include <jvmfwk/framework.hxx>
#include "fwkutil.hxx"
#include <rtl/ustring.hxx>
#include <rtl/byteseq.hxx>
#include <libxml/parser.h>
#include <boost/optional.hpp>

struct JavaInfo;

#define NS_JAVA_FRAMEWORK "http://openoffice.org/2004/java/framework/1.0"
#define NS_SCHEMA_INSTANCE "http://www.w3.org/2001/XMLSchema-instance"

diff --git a/jvmfwk/inc/fwkbase.hxx b/jvmfwk/inc/fwkbase.hxx
index 8d9ae93..790b9a4 100644
--- a/jvmfwk/inc/fwkbase.hxx
+++ b/jvmfwk/inc/fwkbase.hxx
@@ -24,12 +24,13 @@
#include <boost/optional.hpp>

#include <rtl/ustring.hxx>
#include "elements.hxx"
#include "libxmlutil.hxx"

namespace jfw
{

struct VersionInfo;

class VendorSettings
{
    OUString m_xmlDocVendorSettingsFileUrl;
diff --git a/jvmfwk/inc/fwkutil.hxx b/jvmfwk/inc/fwkutil.hxx
index 890ccb1..f2f6fcb 100644
--- a/jvmfwk/inc/fwkutil.hxx
+++ b/jvmfwk/inc/fwkutil.hxx
@@ -19,17 +19,16 @@
#ifndef INCLUDED_JVMFWK_SOURCE_FWKUTIL_HXX
#define INCLUDED_JVMFWK_SOURCE_FWKUTIL_HXX

#include <config_features.h>
#include <config_folders.h>

#include <sal/config.h>
#include <sal/log.hxx>
#include <osl/mutex.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/instance.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/byteseq.hxx>
#include <osl/thread.hxx>

namespace osl { class Mutex; }

namespace jfw
{
diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index 02684a6..c510a0c 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -20,8 +20,6 @@
#ifndef INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_VENDORBASE_HXX
#define INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_VENDORBASE_HXX

#include <config_java.h>

#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
#include <osl/endian.h>
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index 0aa6d84..4c24903 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -21,14 +21,16 @@
#ifndef INCLUDED_JVMFWK_INC_VENDORPLUGIN_HXX
#define INCLUDED_JVMFWK_INC_VENDORPLUGIN_HXX

#include <jvmfwk/framework.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
#include <jni.h>

#include <memory>
#include <vector>
#include "vendorbase.hxx"

namespace jfw_plugin { class VendorBase; }
namespace rtl { template <class reference_type> class Reference; }

struct JavaInfo;

namespace jfw { class VendorSettings; }

diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
index 2a1a6b1..f7c295e 100644
--- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
+++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
@@ -22,7 +22,6 @@
#include <memory>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <sal/main.h>
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h
index 20e3f4b..599c404 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h
+++ b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h
@@ -22,7 +22,6 @@

#include <sal/config.h>

#include <rtl/ustring.hxx>
#include <sal/log.hxx>

#define JFW_ENSURE(c, m) SAL_WARN_IF(!(c), "jfw", m)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index ce4bc77..199b3fc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -19,7 +19,6 @@


#include <osl/file.hxx>
#include <osl/thread.h>
#include "gnujre.hxx"
#include "util.hxx"

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
index c9835ce..4826ea7 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_GNUJRE_HXX

#include <vendorbase.hxx>
#include "vendorlist.hxx"

namespace jfw_plugin
{
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
index 14faf56..8a10d39 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
@@ -18,7 +18,6 @@
 */


#include <osl/thread.h>
#include "otherjre.hxx"

using namespace std;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx
index 9860409..57b3a5e 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_OTHERJRE_HXX

#include <vendorbase.hxx>
#include "vendorlist.hxx"

namespace jfw_plugin
{
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 395ef33..5981e32 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -49,19 +49,19 @@
#include <osl/file.hxx>
#include <rtl/instance.hxx>
#include <sal/log.hxx>
#include <osl/getglobalmutex.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
#include <setjmp.h>
#include <signal.h>
#include <stack>

#include <jni.h>
#include <rtl/byteseq.hxx>
#include <fwkbase.hxx>
#include <elements.hxx>
#include <vendorbase.hxx>
#include <vendorplugin.hxx>
#include <jvmfwk/framework.hxx>
#include "util.hxx"
#include "sunversion.hxx"
#include "vendorlist.hxx"
#include "diagnostics.h"

#ifdef MACOSX
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
index 1e833a9..89731ad 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
@@ -18,7 +18,6 @@
 */


#include <osl/thread.h>
#include "sunjre.hxx"
#include "sunversion.hxx"
#include "diagnostics.h"
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx
index a334fc8..781e2dd 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_SUNJRE_HXX

#include <vendorbase.hxx>
#include "vendorlist.hxx"

namespace jfw_plugin
{
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index 9a5c7c2..09c75f9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -19,14 +19,9 @@


#include "sunversion.hxx"
#include <osl/diagnose.h>
#include <osl/thread.h>
#include <osl/process.h>
#include <osl/security.hxx>
#include <rtl/character.hxx>
#include <string.h>
#include "diagnostics.h"
using namespace osl;

namespace jfw_plugin  { //stoc_javadetect

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index a21aa4f..5824448 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -17,18 +17,16 @@
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <config_features.h>
#include <config_folders.h>

#include "util.hxx"

#include <osl/process.h>
#include <osl/security.hxx>
#include <osl/file.hxx>
#include <osl/module.hxx>
#include <osl/diagnose.h>
#include <osl/getglobalmutex.hxx>
#include <rtl/byteseq.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/instance.hxx>
#include <sal/log.hxx>
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
index 56e487b..7f10e27 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
@@ -20,14 +20,14 @@
#define INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_UTIL_HXX

#include <rtl/ustring.hxx>
#include <rtl/bootstrap.hxx>
#include <vector>
#include <vendorbase.hxx>

namespace rtl { class Bootstrap; }

namespace jfw_plugin
{

class VendorBase;
std::vector<OUString> getVectorFromCharArray(char const * const * ar, int size);

/*   The function uses the relative paths, such as "bin/java.exe" and the provided
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 254f17e..efd6b92 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -22,7 +22,6 @@

#include <vendorbase.hxx>
#include "util.hxx"
#include "sunjre.hxx"

using namespace std;
using namespace osl;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
index a0e682a..e10958d 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
@@ -20,7 +20,8 @@
#define INCLUDED_JVMFWK_PLUGINS_SUNMAJOR_PLUGINLIB_VENDORLIST_HXX

#include <rtl/ref.hxx>
#include <vendorbase.hxx>

namespace jfw_plugin { class VendorBase; }

namespace jfw_plugin
{
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 57134e1..27de353 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -30,12 +30,10 @@
#include <fwkbase.hxx>
#include "framework.hxx"
#include <libxmlutil.hxx>
#include <osl/thread.hxx>
#include <algorithm>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <rtl/bootstrap.hxx>
#include <boost/optional.hpp>
#include <string.h>

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 8d870fd..3212030 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -22,13 +22,13 @@

#include <cassert>
#include <memory>
#include <utility>

#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <rtl/bootstrap.hxx>
#include <osl/diagnose.h>
#include <osl/thread.hxx>
#include <osl/file.hxx>
#include <jvmfwk/framework.hxx>
#include <vendorbase.hxx>
#include <vendorplugin.hxx>
#include <vector>
#include <algorithm>
diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index f459650..39bda14 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -19,10 +19,7 @@
#ifndef INCLUDED_JVMFWK_SOURCE_FRAMEWORK_HXX
#define INCLUDED_JVMFWK_SOURCE_FRAMEWORK_HXX

#include <rtl/ustring.hxx>
#include <rtl/byteseq.hxx>
#include <jvmfwk/framework.hxx>
#include <vendorplugin.hxx>

namespace jfw
{
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 0aed985..1d0657a 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -19,13 +19,10 @@

#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/uri.hxx>
#include <sal/log.hxx>
#include <osl/thread.hxx>
#include <osl/process.h>
#include <libxml/xpathInternals.h>
#include <osl/file.hxx>
#include <osl/module.hxx>
#include <osl/thread.hxx>
#include "framework.hxx"
#include <fwkutil.hxx>
#include <elements.hxx>
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index 14cb3024..e140579 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -23,23 +23,14 @@
# define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <algorithm>
#endif

#include <string>
#include <string.h>
#include <osl/module.hxx>
#include <osl/thread.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/bootstrap.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
#include <rtl/instance.hxx>
#include <rtl/uri.hxx>
#include <sal/log.hxx>
#include <osl/getglobalmutex.hxx>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <cppuhelper/bootstrap.hxx>

#include "framework.hxx"
#include <fwkutil.hxx>