Kaydet (Commit) 5dcfbe57 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up VendorBase (virtual) member functions

Change-Id: I1377dfded1246c8e96db3addc28489886c7f2d99
üst 454f5c30
...@@ -34,7 +34,6 @@ public: ...@@ -34,7 +34,6 @@ public:
static rtl::Reference<VendorBase> createInstance(); static rtl::Reference<VendorBase> createInstance();
using VendorBase::getLibraryPaths;
virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE; virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE;
virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE; virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE;
virtual int compareVersions(const OUString& sSecond) const SAL_OVERRIDE; virtual int compareVersions(const OUString& sSecond) const SAL_OVERRIDE;
......
...@@ -157,10 +157,10 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) ...@@ -157,10 +157,10 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info)
pInfo->nRequirements = info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0; pInfo->nRequirements = info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0;
OUStringBuffer buf(1024); OUStringBuffer buf(1024);
buf.append(info->getRuntimeLibrary()); buf.append(info->getRuntimeLibrary());
if (!info->getLibraryPaths().isEmpty()) if (!info->getLibraryPath().isEmpty())
{ {
buf.appendAscii("\n"); buf.appendAscii("\n");
buf.append(info->getLibraryPaths()); buf.append(info->getLibraryPath());
buf.appendAscii("\n"); buf.appendAscii("\n");
} }
......
...@@ -33,7 +33,6 @@ public: ...@@ -33,7 +33,6 @@ public:
static rtl::Reference<VendorBase> createInstance(); static rtl::Reference<VendorBase> createInstance();
using VendorBase::getLibraryPaths;
virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE; virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE;
virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE; virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE;
......
...@@ -54,12 +54,6 @@ VendorBase::VendorBase(): m_bAccessibility(false) ...@@ -54,12 +54,6 @@ VendorBase::VendorBase(): m_bAccessibility(false)
{ {
} }
rtl::Reference<VendorBase> VendorBase::createInstance()
{
VendorBase *pBase = new VendorBase();
return rtl::Reference<VendorBase>(pBase);
}
bool VendorBase::initialize(vector<pair<OUString, OUString> > props) bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
{ {
//get java.vendor, java.version, java.home, //get java.vendor, java.version, java.home,
...@@ -209,7 +203,7 @@ const OUString & VendorBase::getHome() const ...@@ -209,7 +203,7 @@ const OUString & VendorBase::getHome() const
return m_sHome; return m_sHome;
} }
const OUString & VendorBase::getLibraryPaths() const const OUString & VendorBase::getLibraryPath() const
{ {
return m_sLD_LIBRARY_PATH; return m_sLD_LIBRARY_PATH;
} }
...@@ -225,21 +219,11 @@ bool VendorBase::supportsAccessibility() const ...@@ -225,21 +219,11 @@ bool VendorBase::supportsAccessibility() const
bool VendorBase::needsRestart() const bool VendorBase::needsRestart() const
{ {
if (!getLibraryPaths().isEmpty()) if (!getLibraryPath().isEmpty())
return true; return true;
return false; return false;
} }
int VendorBase::compareVersions(const OUString& /*sSecond*/) const
{
OSL_FAIL("[Java framework] VendorBase::compareVersions must be "
"overridden in derived class.");
return 0;
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -88,7 +88,9 @@ class VendorBase: public salhelper::SimpleReferenceObject ...@@ -88,7 +88,9 @@ class VendorBase: public salhelper::SimpleReferenceObject
{ {
public: public:
VendorBase(); VendorBase();
/* returns relative paths to the java executable as /* static char const* const * getJavaExePaths(int* size);
returns relative paths to the java executable as
file URLs. file URLs.
For example "bin/java.exe". You need For example "bin/java.exe". You need
...@@ -103,9 +105,10 @@ public: ...@@ -103,9 +105,10 @@ public:
The signature of this function must correspond to The signature of this function must correspond to
getJavaExePaths_func. getJavaExePaths_func.
*/ */
static char const* const * getJavaExePaths(int* size);
/* creates an instance of this class. MUST be overridden /* static rtl::Reference<VendorBase> createInstance();
creates an instance of this class. MUST be overridden
in a derived class. in a derived class.
#################################################### ####################################################
OVERRIDE in derived class OVERRIDE in derived class
...@@ -113,7 +116,6 @@ public: ...@@ -113,7 +116,6 @@ public:
@param @param
Key - value pairs of the system properties of the JRE. Key - value pairs of the system properties of the JRE.
*/ */
static rtl::Reference<VendorBase> createInstance();
/* called automatically on the instance created by createInstance. /* called automatically on the instance created by createInstance.
...@@ -132,18 +134,18 @@ public: ...@@ -132,18 +134,18 @@ public:
virtual char const* const* getLibraryPaths(int* size); virtual char const* const* getLibraryPaths(int* size);
virtual const OUString & getVendor() const; const OUString & getVendor() const;
virtual const OUString & getVersion() const; const OUString & getVersion() const;
virtual const OUString & getHome() const; const OUString & getHome() const;
virtual const OUString & getRuntimeLibrary() const; const OUString & getRuntimeLibrary() const;
virtual const OUString & getLibraryPaths() const; const OUString & getLibraryPath() const;
virtual bool supportsAccessibility() const; bool supportsAccessibility() const;
/* determines if prior to running java something has to be done, /* determines if prior to running java something has to be done,
like setting the LD_LIBRARY_PATH. This implementation checks like setting the LD_LIBRARY_PATH. This implementation checks
if an LD_LIBRARY_PATH (getLD_LIBRARY_PATH) needs to be set and if an LD_LIBRARY_PATH (getLD_LIBRARY_PATH) needs to be set and
if so, needsRestart returns true. if so, needsRestart returns true.
*/ */
virtual bool needsRestart() const; bool needsRestart() const;
/* compares versions of this vendor. MUST be overridden /* compares versions of this vendor. MUST be overridden
in a derived class. in a derived class.
...@@ -158,7 +160,7 @@ public: ...@@ -158,7 +160,7 @@ public:
@throw @throw
MalformedVersionException if the version string was not recognized. MalformedVersionException if the version string was not recognized.
*/ */
virtual int compareVersions(const OUString& sSecond) const; virtual int compareVersions(const OUString& sSecond) const = 0;
protected: protected:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment