summaryrefslogtreecommitdiff
path: root/jvmfwk
AgeCommit message (Collapse)AuthorFilesLines
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin1-2/+2
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-14Remove useless constructor and destructorArnaud Versini2-23/+1
Change-Id: I3130ffb7e3ec1c39965ddbc921e5b3ef8303fa31 Reviewed-on: https://gerrit.libreoffice.org/61755 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-24loplugin:external (clang-cl)Stephan Bergmann1-4/+4
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17New loplugin:externalStephan Bergmann2-4/+4
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-29Replace find_if with proper quantifier algorithmsArkadiy Illarionov2-7/+3
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-06Add missing sal/log.hxx headersGabor Kelemen6-0/+6
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') in files formerly omitted for oversight or non-cxx extension Change-Id: I327c573f44076c6ccfecf737eafccba2da72e1bd Reviewed-on: https://gerrit.libreoffice.org/58600 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen2-0/+2
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from filter to jvmfwk Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5 Reviewed-on: https://gerrit.libreoffice.org/58204 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-26jvmfwk: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann2-5/+0
...by removing explicitly user-provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non-deleted in the future. (Even if a dtor was declared non-inline in an include file, the apparently-used implicitly-defined copy functions are already inline, so why bother with a non-inline dtor.) Change-Id: I1330a9fd4fc7f8fe8525b3ea02f9edb9e88e6638 Reviewed-on: https://gerrit.libreoffice.org/58059 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-26tdf#96099 Remove some trivial container iterator typedefsArkadiy Illarionov1-8/+6
Change-Id: Ifec98748d55ff6aca64c425c50c2cf2650f61591 Reviewed-on: https://gerrit.libreoffice.org/56422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-12Keep strings alive again as necessaryStephan Bergmann1-0/+4
...fixing regression introduced with 49eb02f07a5af44da59008a238e828b4a9532bef "new loplugin:unusedvariablemore" Change-Id: Ib598d67add50031937c9c9f3e23ea16d0a1da107
2018-04-11new loplugin:unusedvariablemoreNoel Grandin1-2/+0
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28Don't pass empty option to JNI_CreateJavaVMStephan Bergmann1-6/+11
sUserClassPath may be empty (instead of containing "-Djava.class.path=...") here, which older versions of Java have apparently silently ignored. But Java 10 now fails with JNI_EINVAL (-6). (Happens e.g. during CppunitTest_dbaccess_hsqldb_test.) Change-Id: Ifd13222f0d0ae69547bd1a9fe0fd5eae47917d0a Reviewed-on: https://gerrit.libreoffice.org/51949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-27Improve error reportingStephan Bergmann1-1/+1
Change-Id: Ic990e00d14b083f35b44915de3b048a683f269f4 Reviewed-on: https://gerrit.libreoffice.org/51962 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-25Use for-range loops in some modulesJulien Nabet1-3/+2
jvmaccess, jvmfwk, l10ntools, libreofficekit and linguistic Change-Id: I9d290d1098b25ccb3aee19d2df18c18f4aa65105 Reviewed-on: https://gerrit.libreoffice.org/51495 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-15Find Java 9 with the new registry keys on WindowsStephan Bergmann1-25/+39
See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37- 4D12-AB10-49F82F720027> section "Windows Registry Key Changes". Change-Id: Ic30ce430663cc1608c6268fa937142f73c55f138 Reviewed-on: https://gerrit.libreoffice.org/49792 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-01jvmfwk: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski2-12/+0
Change-Id: Ibb69ba9c994e44c162318e40c4469c311309f326 Reviewed-on: https://gerrit.libreoffice.org/48996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-23More loplugin:cstylecast on WindowsStephan Bergmann1-2/+2
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862 Reviewed-on: https://gerrit.libreoffice.org/48317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-20More loplugin:cstylecast on macOSStephan Bergmann1-2/+2
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870 Reviewed-on: https://gerrit.libreoffice.org/48216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-12More loplugin:cstylecast: jvmfwkStephan Bergmann1-4/+4
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Ifb4b7fa5d2a9111a63da241f75b59528e51f765c
2017-12-19inline use-once typedefsNoel Grandin1-2/+1
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin1-1/+1
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-14loplugin:flatten loosen conditionNoel Grandin1-4/+1
the description in the comment was right, but the code was not Change-Id: I7c038e7453f4387d33ec6423c0c55446d6d0df47 Reviewed-on: https://gerrit.libreoffice.org/44680 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-13Fix typosAndrea Gelmini1-1/+1
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-01loplugin:finalclasses in h*,i*,j*Noel Grandin1-4/+2
Change-Id: I3b5f319a88dbe6a9c2ffbfdf991345beda9a2fcd Reviewed-on: https://gerrit.libreoffice.org/44154 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-31loplugin:constantparam in i18nlangtagNoel Grandin1-6/+5
Change-Id: I148a47a9b63b78651ec18cd947f45b8f4dbb9345 Reviewed-on: https://gerrit.libreoffice.org/44094 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-26loplugin:constmethod in svlNoel Grandin2-4/+4
Change-Id: If92869e19c413e11f1f299a97f96b9637aaba65d Reviewed-on: https://gerrit.libreoffice.org/43864 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: jvmfwkStephan Bergmann27-119/+119
Change-Id: I7292ced23647692fdc85a3c234fb1469a91ad0ea
2017-10-13Use loop ranges in jvmfwkJulien Nabet6-117/+84
to simplify and avoid all the typedefs Change-Id: Ia14337dd71b55fc24f162b5436af76aeeb8d2575 Reviewed-on: https://gerrit.libreoffice.org/43346 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski1-3/+4
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30Use SAL_W/SAL_U instead of reinterpret_cast btwn wchar_t* and sal_Unicode*Mike Kaganski1-1/+1
This is type-safe, and allows to catch cases where a source type is changed for some reason, but reinterpret_cast masks that Change-Id: Ib64b6fa2e22d94a6bba890f0ccc3e20325c6f0a1 Reviewed-on: https://gerrit.libreoffice.org/42961 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30Use explicit function names for fooA/fooW WinAPI; prefer fooWMike Kaganski3-12/+14
We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18Some more WIN32_LEAN_AND_MEANMike Kaganski3-0/+9
Change-Id: Iadb0ebb66809c192fb817b8c7cf2f8cdb4d0b874 Reviewed-on: https://gerrit.libreoffice.org/42419 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-11clang-tidy modernize-use-emplace in hwpfilter..lotuswordproNoel Grandin3-8/+6
Change-Id: Ic11634ca28396fd156390c511087bae03bd5fb70 Reviewed-on: https://gerrit.libreoffice.org/42156 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-28tdf#100501: Fix thinkoStephan Bergmann1-1/+1
...in previous 52ffad9bb7be800790de6d918154dbeade88cadd "tdf#100501: Adapt to Java 9 (at least on Linux x86-64)" Change-Id: I4d6bc31e0a7051a2657bb3d1ffc20c7a03d69038
2017-08-28tdf#100501: Adapt to Java 9 (at least on Linux x86-64)Stephan Bergmann2-2/+8
Checking with both jdk-9+181_linux-x64_bin.tar.gz and jre-9+181_linux-x64_bin.tar.gz as currently available at <http://jdk.java.net/9/> "JDK 9 Early-Access Builds": For one, make SunVersion::init understand <http://openjdk.java.net/jeps/223> "JEP 223: New Version-String Scheme" at least insofar as to accept strings like "9" with less than three dot-separated segments (where the missing segments are treated like "0"). For another, at least for Linux x86-64, libjvm.so is now apparently located in a path without an "amd64" architecture segment, "lib/server/libjvm.so". (But could that also be "client"?) Other platforms may need further adjustments. Change-Id: Idcebc833472c81a1dc74dcdd481b0a37274a8713
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin2-3/+3
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-13log details of exception when we catch std::exceptionNoel Grandin1-2/+3
Change-Id: Ibfaba3473b11e24381d5a71a722c021ecde3488b Reviewed-on: https://gerrit.libreoffice.org/41112 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11convert std::map::insert to std::map::emplaceNoel Grandin1-3/+2
which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31loplugin:oncevarNoel Grandin4-14/+7
extend oncevar to any POD type Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0 Reviewed-on: https://gerrit.libreoffice.org/40564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13use more OUString::operator== in forms..salNoel Grandin4-12/+12
Change-Id: I70d7e50f8c1e019524ccad915f0cca912c5035dc Reviewed-on: https://gerrit.libreoffice.org/39899 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13loplugin:oncevar: empty strings: jvmfwkStephan Bergmann1-2/+1
Change-Id: Ic021968b648359d94e7e44d59606b25a6f6ce8c3
2017-07-06use OString::operator== in preference to ::equalsNoel Grandin1-1/+1
Change-Id: Ib291521963a791a9c6175964571e9d9895072acf Reviewed-on: https://gerrit.libreoffice.org/39646 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-25loplugin:oncevar in helpcompiler..jvmfwkNoel Grandin1-5/+5
Change-Id: Ia9b20a8ca95684cbeb21e3425972c43ba50df3cd Reviewed-on: https://gerrit.libreoffice.org/39187 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23loplugin:unusedfields in jvmfwk..mysqlcNoel Grandin1-6/+2
Change-Id: If9c7a3239fceba9a2db3a5905ccaa7fa9adadb08 Reviewed-on: https://gerrit.libreoffice.org/39099 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke1-1/+0
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-15use more SAL_N_ELEMENTS part 3Noel Grandin5-15/+15
Change-Id: I82e366fefd2e31928b99840fe76649cc3521e623 Reviewed-on: https://gerrit.libreoffice.org/38789 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30cleanup some OString stuff in jvmfwkNoel Grandin4-64/+45
Change-Id: I80d221a348c4bd5fcec82cafc455a051237ae95d Reviewed-on: https://gerrit.libreoffice.org/38131 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-29Revert "loplugin:stringcopy"Stephan Bergmann1-1/+1
This reverts commit 957874168491f4b030fda85c65dd969aae82a670. It wasn't really necessary (see commit message of 8b1fcedcd10366523967ebcbd463b2c0c6b5b17a "...and re-eanble loplugin:stringcopy again") and reportedly causes issues with older Boost (see <https://lists.freedesktop.org/archives/libreoffice/2017-May/077786.html> "[Libreoffice-commits] core.git: jvmfwk/source").
2017-05-28remove unnecessary use of OString::getStrNoel Grandin1-1/+1
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20loplugin:stringcopy (macOS)Stephan Bergmann1-2/+2
Change-Id: I855db37cdcd17920cf02d804e5cfa38d316ba236