summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-05-15 20:09:43 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-05-15 23:29:36 +0200
commit3bc8b14bea3c11159bdbd6fc4f9658fce3ba252e (patch)
tree848417f74e6d7036101b039fd8d13ccdaf291666 /jvmfwk
parentdd372b444f1f1821048e197768d5095e6204a102 (diff)
Drop the JVM "feature" concept support
...now that 6ba74150866d71469827de9f4f19268dfa7db137 "jfw::isAccessibilitySupportDesired is obsolete" demonstrated that there is no more need for JFW_FEATURE_ACCESSBRIDGE, the sole feature that had been provided. * The javasettings_*.xml format still supports the <feature> tag, but it is ignored when reading and always written as "0". * There is no trace that "the bootstrap parameter JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY" whose mention gets removed from jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java had ever been supported. (The only mention was 6873b3be47d71f94c38262003101576081acd241 "INTEGRATION: CWS jre5issues (1.3.18); FILE MERGED: 2005/01/18 12:48:48 jl 1.3.18.1: #i40879# in build environment the JRE is not tested for accessibility, because of potential X server problems" introducing that comment.) * The "Features" column is removed from the JRE table on the "LibreOffice - Advance" options page. Change-Id: I332d34b60548e7f2f852241ea8edfbee0ffcf510 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94329 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/inc/elements.hxx1
-rw-r--r--jvmfwk/inc/vendorbase.hxx2
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java24
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx18
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx1
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx18
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx25
-rw-r--r--jvmfwk/source/elements.cxx26
-rw-r--r--jvmfwk/source/framework.cxx6
9 files changed, 20 insertions, 101 deletions
diff --git a/jvmfwk/inc/elements.hxx b/jvmfwk/inc/elements.hxx
index eeaff7c4b835..800ecaf697fb 100644
--- a/jvmfwk/inc/elements.hxx
+++ b/jvmfwk/inc/elements.hxx
@@ -84,7 +84,6 @@ public:
OUString sVendor;
OUString sLocation;
OUString sVersion;
- sal_uInt64 nFeatures;
sal_uInt64 nRequirements;
::rtl::ByteSequence arVendorData;
diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx
index 374a3cbcf655..df536bc3477e 100644
--- a/jvmfwk/inc/vendorbase.hxx
+++ b/jvmfwk/inc/vendorbase.hxx
@@ -124,7 +124,6 @@ public:
const OUString & getHome() const;
const OUString & getRuntimeLibrary() const;
const OUString & getLibraryPath() const;
- bool supportsAccessibility() const;
bool isValidArch() const;
/* determines if prior to running java something has to be done,
like setting the LD_LIBRARY_PATH. This implementation checks
@@ -172,7 +171,6 @@ protected:
OUString m_sRuntimeLibrary;
OUString m_sLD_LIBRARY_PATH;
OUString m_sArch;
- bool m_bAccessibility;
typedef rtl::Reference<VendorBase> (* createInstance_func) ();
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
index dfb27e941b8b..0d3503af385f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
+++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java
@@ -35,30 +35,6 @@ public class JREProperties
{
try
{
- boolean bNoAccess = false;
- if(args.length > 0 && args[0].equals("noaccessibility")) {
- bNoAccess = true;
- }
-
- //We need to be able to switch this part off because
- //it causes an exception if the DISPLAY variable has
- //a false value. Setting the noaccessibility argument
- //can be done by providing a sunjavaplugin.ini with
- //the bootstrap parameter JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY
- //set to "1"
- if (!bNoAccess)
- {
- try{
- //This line is needed to get the accessibility properties
- java.awt.Toolkit.getDefaultToolkit();
- }
- catch(Throwable e)
- {
- System.err.println(e);
- }
- }
-
-
Properties p = System.getProperties();
Enumeration e = p.propertyNames();
while (e.hasMoreElements()) {
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index d9c0e7d5d25f..19cc9bf5d674 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -92,8 +92,8 @@ char const* const* GnuInfo::getLibraryPaths(int* /*size*/)
bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
{
- //get java.vendor, java.version, java.home,
- //javax.accessibility.assistive_technologies from system properties
+ //get java.vendor, java.version, java.home
+ //from system properties
OUString sJavaLibraryPath;
OUString const sVendorProperty("java.vendor");
@@ -101,14 +101,12 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
OUString const sJavaHomeProperty("java.home");
OUString const sJavaLibraryPathProperty("java.library.path");
OUString const sGNUHomeProperty("gnu.classpath.home.url");
- OUString const sAccessProperty("javax.accessibility.assistive_technologies");
bool bVersion = false;
bool bVendor = false;
bool bHome = false;
bool bJavaHome = false;
bool bJavaLibraryPath = false;
- bool bAccess = false;
for (auto const& prop : props)
{
@@ -149,17 +147,9 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
osl_getFileURLFromSystemPath(prop.second.getToken(0, ':', nIndex).pData, &sJavaLibraryPath.pData);
bJavaLibraryPath = true;
}
- else if (!bAccess && sAccessProperty == prop.first)
- {
- if (!prop.second.isEmpty())
- {
- m_bAccessibility = true;
- bAccess = true;
- }
+ if (bVendor && bVersion && bHome && bJavaHome && bJavaLibraryPath) {
+ break;
}
- // the javax.accessibility.xxx property may not be set. Therefore we
- //must search through all properties.
-
}
if (!bVersion || !bVendor || !bHome)
return false;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 46f5cfba1281..1d3667988cf9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -168,7 +168,6 @@ std::unique_ptr<JavaInfo> createJavaInfo(
return std::unique_ptr<JavaInfo>(
new JavaInfo{
info->getVendor(), info->getHome(), info->getVersion(),
- sal_uInt64(info->supportsAccessibility() ? JFW_FEATURE_ACCESSBRIDGE : 0),
sal_uInt64(info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0),
rtl::ByteSequence(
reinterpret_cast<sal_Int8*>(sVendorData.pData->buffer),
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index db855d9ce4f4..3b7a2beb2314 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -383,26 +383,12 @@ bool getJavaProps(const OUString & exePath,
sClassPath += "/../Resources/java";
#endif
-#ifdef UNX
- // Java is no longer required for a11y - we use atk directly.
- bool bNoAccessibility = true;
-#else
- bool bNoAccessibility = false;
-#endif
-
//prepare the arguments
- sal_Int32 cArgs = 3;
+ sal_Int32 const cArgs = 3;
OUString arg1 = "-classpath";// + sClassPath;
OUString arg2 = sClassPath;
OUString arg3("JREProperties");
- OUString arg4 = "noaccessibility";
- rtl_uString *args[4] = {arg1.pData, arg2.pData, arg3.pData};
- // Only add the fourth param if the bootstrap parameter is set.
- if (bNoAccessibility)
- {
- args[3] = arg4.pData;
- cArgs = 4;
- }
+ rtl_uString *args[cArgs] = {arg1.pData, arg2.pData, arg3.pData};
oslProcess javaProcess= nullptr;
oslFileHandle fileOut= nullptr;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index c4e70d1df27b..4bfc1fd90af0 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -32,19 +32,18 @@ namespace jfw_plugin
MalformedVersionException::~MalformedVersionException() = default;
-VendorBase::VendorBase(): m_bAccessibility(false)
+VendorBase::VendorBase()
{
}
bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
{
- //get java.vendor, java.version, java.home,
- //javax.accessibility.assistive_technologies from system properties
+ //get java.vendor, java.version, java.home
+ //from system properties
bool bVersion = false;
bool bVendor = false;
bool bHome = false;
- bool bAccess = false;
bool bArch = false;
for (auto const& prop : props)
@@ -85,18 +84,9 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
m_sArch = prop.second;
bArch = true;
}
- else if (!bAccess
- && prop.first == "javax.accessibility.assistive_technologies")
- {
- if (!prop.second.isEmpty())
- {
- m_bAccessibility = true;
- bAccess = true;
- }
+ if (bVendor && bVersion && bHome && bArch) {
+ break;
}
- // the javax.accessibility.xxx property may not be set. Therefore we
- //must search through all properties.
-
}
if (!bVersion || !bVendor || !bHome || !bArch)
return false;
@@ -196,11 +186,6 @@ bool VendorBase::isValidArch() const
#endif
}
-bool VendorBase::supportsAccessibility() const
-{
- return m_bAccessibility;
-}
-
bool VendorBase::needsRestart() const
{
return !getLibraryPath().isEmpty();
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index f05cb5950e83..904e8211834c 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -37,9 +37,9 @@
#include <optional>
#include <string.h>
-// For backwards compatibility, the nFeatures and nRequirements flag words are
-// read/written as potentially signed hexadecimal numbers (though that has no
-// practical relevance given that each has only one flag with value 0x01
+// For backwards compatibility, the nRequirements flag word is
+// read/written as potentially signed hexadecimal number (though that has no
+// practical relevance given that it has only one flag with value 0x01
// defined).
using namespace osl;
@@ -553,7 +553,6 @@ void NodeJava::setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect)
m_javaInfo->sVendor = pInfo->sVendor;
m_javaInfo->sLocation = pInfo->sLocation;
m_javaInfo->sVersion = pInfo->sVersion;
- m_javaInfo->nFeatures = pInfo->nFeatures;
m_javaInfo->nRequirements = pInfo->nRequirements;
m_javaInfo->arVendorData = pInfo->arVendorData;
}
@@ -563,7 +562,6 @@ void NodeJava::setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect)
m_javaInfo->sVendor.clear();
m_javaInfo->sLocation.clear();
m_javaInfo->sVersion.clear();
- m_javaInfo->nFeatures = 0;
m_javaInfo->nRequirements = 0;
m_javaInfo->arVendorData = rtl::ByteSequence();
}
@@ -676,7 +674,7 @@ bool NodeJava::createSettingsDocument() const
CNodeJavaInfo::CNodeJavaInfo() :
m_bEmptyNode(false), bNil(true), bAutoSelect(true),
- nFeatures(0), nRequirements(0)
+ nRequirements(0)
{
}
@@ -740,13 +738,6 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
pDoc, cur->children, 1);
sVersion = xmlVersion;
}
- else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("features"))== 0)
- {
- CXmlCharPtr xmlFeatures = xmlNodeListGetString(
- pDoc, cur->children, 1);
- OUString sFeatures = xmlFeatures;
- nFeatures = sFeatures.toInt64(16);
- }
else if (xmlStrcmp(cur->name, reinterpret_cast<xmlChar const *>("requirements")) == 0)
{
CXmlCharPtr xmlRequire = xmlNodeListGetString(
@@ -858,11 +849,10 @@ void CNodeJavaInfo::writeToNode(xmlDoc* pDoc,
nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n"));
xmlAddChild(pJavaInfoNode, nodeCrLf);
- //Create the features element
- OUString sFeatures = OUString::number(
- nFeatures, 16);
+ //Create the features element, for backwards compatibility (it used to support one flag
+ // JFW_FEATURE_ACCESSBRIDGE = 0x01, but is ignored and always written as zero now)
xmlNewTextChild(pJavaInfoNode, nullptr, reinterpret_cast<xmlChar const *>("features"),
- CXmlCharPtr(sFeatures));
+ reinterpret_cast<xmlChar const *>("0"));
//add a new line for better readability
nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n"));
xmlAddChild(pJavaInfoNode, nodeCrLf);
@@ -896,7 +886,7 @@ std::unique_ptr<JavaInfo> CNodeJavaInfo::makeJavaInfo() const
return std::unique_ptr<JavaInfo>();
return std::unique_ptr<JavaInfo>(
new JavaInfo{
- sVendor, sLocation, sVersion, nFeatures, nRequirements,
+ sVendor, sLocation, sVersion, nRequirements,
arVendorData});
}
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index d008b5d16ab2..c253eec65426 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -282,7 +282,6 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
// 'bInfoFound' indicates whether a Java installation has been found
- // that supports all desired features
bool bInfoFound = false;
// get list of vendors for Java installations
@@ -299,7 +298,7 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
bInfoFound = true;
}
- // if no Java installation providing all features was detected by using JAVA_HOME,
+ // if no Java installation was detected by using JAVA_HOME,
// query PATH for Java installations
if (!bInfoFound)
{
@@ -359,8 +358,6 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
if (aInfo)
{
- //the just found Java implements all required features
- //currently there is only accessibility!!!
aCurrentInfo = std::move(aInfo);
break;
}
@@ -403,7 +400,6 @@ bool jfw_areEqualJavaInfo(JavaInfo const * pInfoA,JavaInfo const * pInfoB)
if (pInfoA->sVendor == pInfoB->sVendor
&& pInfoA->sLocation == pInfoB->sLocation
&& pInfoA->sVersion == pInfoB->sVersion
- && pInfoA->nFeatures == pInfoB->nFeatures
&& pInfoA->nRequirements == pInfoB->nRequirements
&& pInfoA->arVendorData == pInfoB->arVendorData)
{