summaryrefslogtreecommitdiff
path: root/connectivity
AgeCommit message (Collapse)Author
2019-08-10loplugin:stringconstant (macOS)Stephan Bergmann
Change-Id: Icb9d9e1cd21e2506e36fe40a3b93b6a2521a868c Reviewed-on: https://gerrit.libreoffice.org/77239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-07tdf#126588 crash in saving viewNoel Grandin
regression from commit d425658bd9fd8e315e4931afb544bc845da0360e Date: Wed Dec 19 16:10:51 2018 +0200 pass OSQLParseNode around by unique_ptr We have a OSQLNode being deleted at connectivity::OSQLParseNodesContainer::clearAndDelete() at connectivity/source/parse/sqlnode.cxx:2781 connectivity::OSQLParser::parseTree(rtl::OUString&, rtl::OUString const&, bool) (this=0x38eba90, rErrorMessage="syntax error, unexpected UNION, expecting $end", rStatement="CREATE VIEW \"View1\" AS SELECT \"Tab1\".\"Name\" AS \"Name1\", \"Tab1\".\"Geburtsdatum\" AS \"Geburtsdatum1\", 1 AS \"MonatZahl1\", COALESCE(\"Tab1\".\"MonatZaehler\",999) AS \"MonatZaehler1\", 'Januar' AS \"Monat1\", \"Tab2"..., bInternational=false) at workdir/YaccTarget/connectivity/source/parse/sqlbison.cxx:10914 namespace)::parseStatement_throwError(connectivity::OSQLParser&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) (_rParser=..., _rStatement="CREATE VIEW \"View1\" AS SELECT \"Tab1\".\"Name\" AS \"Name1\", \"Tab1\".\"Geburtsdatum\" AS \"Geburtsdatum1\", 1 AS \"MonatZahl1\", COALESCE(\"Tab1\".\"MonatZaehler\",999) AS \"MonatZaehler1\", 'Januar' AS \"Monat1\", \"Tab2"..., _rxContext=uno::Reference to (dbaccess::OSingleSelectQueryComposer *) 0x38eb8d0) at dbaccess/source/core/api/SingleSelectQueryComposer.cxx:106 and then again at std::unique_ptr<connectivity::OSQLParseNode, std::default_delete<connectivity::OSQLParseNode> >::operator=(decltype(nullptr)) (this=0x38eba90) at connectivity/source/parse/sqlnode.cxx:1500 Change-Id: I292627a06369208e0010743063c7eb5a38921a19 Reviewed-on: https://gerrit.libreoffice.org/77106 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-05tdf#39593 Drop connectivity::sdbcx::ODescriptor::getImplementationArkadiy Illarionov
Replace with comphelper::getUnoTunnelImplementation. Change-Id: Ia08561c11872a4ede9077863f81040633c30aebc Reviewed-on: https://gerrit.libreoffice.org/76914 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-01mysqlc: Add test for textual blob typesTamas Bunth
Test setting and querying the following data types: TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT Test them using prepared statements. Change-Id: I43387034ad8c32c3731cde70a22cc8b3dd652b78 Reviewed-on: https://gerrit.libreoffice.org/76747 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-07-31mysqlc: getTablePrivileges not implemented, so..Tamas Bunth
it should throw an exception. Reviewed-on: https://gerrit.libreoffice.org/60460 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 19f8ea668833a4dc90244792cbf91881b0ca9a07) Change-Id: I32b0b5dde0bcfd8cc59d0814a9f35d43c0f58ae1 Reviewed-on: https://gerrit.libreoffice.org/76750 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-31Fix typosAndrea Gelmini
Change-Id: I3a877a8eb0babb9d04ac9750494576869481c8db Reviewed-on: https://gerrit.libreoffice.org/76763 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): connectivityStephan Bergmann
Change-Id: I80dab66757b1f541d448a642a5ecddc876f55c7b Reviewed-on: https://gerrit.libreoffice.org/76689 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31mysqlc: Support reading blob as stringTamas Bunth
Change-Id: I1ef0c3817bc255e7f0c38aca73c475b19d5d7d9b Reviewed-on: https://gerrit.libreoffice.org/76600 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-07-31tdf#123591: truncate and round to 'scale' number of decimal placesXisco Fauli
otherwise the number will be incorrectly converted to OUString if scale < number of decimals See https://bugs.documentfoundation.org/show_bug.cgi?id=123591#c25 Change-Id: Ie32c9c6ab339d6907e9a4e2645d6f19bad9e67c8 Reviewed-on: https://gerrit.libreoffice.org/75727 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-07-29mysqlc: Fix query of cursor position in result setTamas Bunth
Fix queries like "IsAfterLast" in result sets of prepared statements in the mysql driver. Cursor position is stored in the driver, since the mysql C driver does not support the query of the cursor position. The cursor position works the following way: - 0 means the cursor is on "BeforeFirst". In that state calling of getXXX() methods is user error. - 1 means the first row is already fetched. - n means the last fow is fetched, where n is the total number of rows in the result set. - Everything bigger than n is "AfterLast" Change-Id: I131f2042606897019cc0f868dbc4151faf4850ac Reviewed-on: https://gerrit.libreoffice.org/76549 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-07-25Fix typosAndrea Gelmini
Change-Id: I1efccb8b926e4aa10e9ccee7e8e36919e38c05fc Reviewed-on: https://gerrit.libreoffice.org/76339 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-24cid#1448360 Assignment of overlapping memoryCaolán McNamara
Change-Id: Ifefa007ff7534e65cc35cdbcb4983012b36ed6e0 Reviewed-on: https://gerrit.libreoffice.org/76248 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-20Fix typosAndrea Gelmini
Change-Id: Icefd5a9e2a8bd929caa486c4cf3283925237d707 Reviewed-on: https://gerrit.libreoffice.org/75980 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-19loplugin:referencecasting in comphelper..connectivityNoel Grandin
Change-Id: I21896885c29e9ab58ebab17b59f1480c6a06fb38 Reviewed-on: https://gerrit.libreoffice.org/75936 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19cid#1448480 Uncaught exceptionCaolán McNamara
Change-Id: Ied9ff9ea5d8b40c52e20c10f709836a193d5e940 Reviewed-on: https://gerrit.libreoffice.org/75896 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-13tdf#123150: Firebird: set UTF-8 client connectionTamas Bunth
There are two options related to character sets when attaching or creating a database with the C API: - isc_dpb_lc_ctype: Sets the character set of the connection between the Firebird server and the Client (which is the sdbc driver in that case). That is required in order to pass UTF 8 literals correctly. - isc_dpb_set_db_charset: Sets the default character set of the database itself. It has the same effect as the following SQL statement: ALTER DATABASE SET DEFAULT CHARACTER SET <Charset> We need to set both of them to UTF-8. Change-Id: Ia9e5a4b87a3997c084be8abb68c2de813fbd631b Reviewed-on: https://gerrit.libreoffice.org/75557 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2019-07-13tdf#123591: Firebird: Fix setting double valuesTamas Bunth
Handle numerical and decimal values separately. In order to do that we have to indentify the exact type first. That can be achieved using sqltype and sqlsubtype in Firebird API. Change-Id: Ie664dead51bae5522ee53009cda1cddbe0d64b16 Reviewed-on: https://gerrit.libreoffice.org/75525 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2019-07-10tdf#121528: Firebird stores scale as a negative numberXisco Fauli
Change-Id: Ic301952aeef93d3035b04442e70705d08f45f95d Reviewed-on: https://gerrit.libreoffice.org/75357 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Jenkins
2019-07-10tdf#123591: Firebird: take decimal places into account...Xisco Fauli
when copying values from Calc to Base Change-Id: I5dc645e3e9b153f71f2027a205815aaf83c1d6d3 Reviewed-on: https://gerrit.libreoffice.org/75346 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Jenkins
2019-07-02Slight reformattingAndrea Gelmini
Change-Id: I0f372656e58338f5292938576f40822061338e70 Reviewed-on: https://gerrit.libreoffice.org/71631 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-24tdf#39593 Change comphelper::getImplementation signatureArkadiy Illarionov
To merge with comphelper::getUnoTunnelImplementation Change-Id: I976d768d7fb159d50fa90e27ec36f2bea91ea2cb Reviewed-on: https://gerrit.libreoffice.org/74542 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-19connectivity, oox: remove some unused includesMiklos Vajna
Change-Id: I8b39caafc157e309e638eec1a66d9302f1a11a73 Reviewed-on: https://gerrit.libreoffice.org/74307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-18loplugin:passstuffbyrefNoel Grandin
Change-Id: Icb7c22cf4ac95eab54d04e79312fb471ca27bceb Reviewed-on: https://gerrit.libreoffice.org/74246 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-14loplugin:logexceptionnicely in configmgr..connectivityNoel Grandin
Change-Id: I1cf8250dba63b744f882e54e9eb572884f292975 Reviewed-on: https://gerrit.libreoffice.org/74020 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-12Resolves: tdf#125878 correct calculation of H:M:S from timestampEike Rathke
This apparently has been wrong since the beginning in 2009. It's a somewhat odd algorithm anyway, first calculating the time in seconds, minutes and hours, but maybe there's a reason regarding rounding, so not changing that. Change-Id: I855d2c96094b4edb1095d20bcdfebdea6d6d943a Reviewed-on: https://gerrit.libreoffice.org/73893 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-06-11Fix typoAndrea Gelmini
Change-Id: I2ad6228e21dd51be90a289cc438cf640d453d8d7 Reviewed-on: https://gerrit.libreoffice.org/73788 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-10Use hasElements to check Sequence emptiness in chart2..connectivityArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: I41824e8a4ef38d6a35a0ac4421cffcbcd17308e1 Reviewed-on: https://gerrit.libreoffice.org/71802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-03mysqlc: Add support for mysql type INT24Tamas Bunth
Which is mapped to sal_Int32. Change-Id: Ibf12e92a20034440fa990ed0c6f1196f4ca3f40f Reviewed-on: https://gerrit.libreoffice.org/73217 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-06-01tdf#43157 Clean up OSL_VERIFY (replace with SAL_WARN)Jens Carl
Replace OSL_VERIFY with if-statement and SAL_WARN. Change-Id: Iccc7e079d9f8778060bbebba3f8e9204fc351d8e Reviewed-on: https://gerrit.libreoffice.org/73289 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-05-31connectivity: fix memory leaks caused by OConnection::acquire()Michael Stahl
Followup to 58f121ef2e680697e10453add43bab9b771d153a; OConnection must not be held by rtl::Reference as that creates a cycle. (regression from 497e40ad03c27837978551ba15491c3fb2a0bf53) Change-Id: Ibd56d335e3e2631c5a57ea435f1035e89868a5a6 Reviewed-on: https://gerrit.libreoffice.org/73155 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-29tdf#43157 Clean up OSL_VERIFY (replace with SAL_WARN)Jens Carl
Replace OSL_VERIFY with if-statement and SAL_WARN. Change-Id: Ib5459a365231514efa0e8a33a880857378cd239e Reviewed-on: https://gerrit.libreoffice.org/73121 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-22New loplugin:dataStephan Bergmann
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-22tdf#122538: add index appendix for hsqldbJulien Nabet
Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=3208fcb3a36d75d6290d9c548430682f153b09db Change-Id: I8f85f0a5838df87671ecb9bdb5751b7ec43c09ea Reviewed-on: https://gerrit.libreoffice.org/72701 Tested-by: Jenkins Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2019-05-14tdf#43157 Clean up OSL_VERIFY (replace with SAL_WARN)Jens Carl
Replace OSL_VERIFY with if-statement and SAL_WARN. Change-Id: Icf6a0b81aca489b25520c9f6837d1b482179cad5 Reviewed-on: https://gerrit.libreoffice.org/72155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-12regenerate PCH headersLuboš Luňák
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-10an is used before a vowel soundCaolán McNamara
not before vowels with a consonant sound so its a url not an url Change-Id: Ic27ff3bee67469284d460c31ced6f63cb3633db2 Reviewed-on: https://gerrit.libreoffice.org/72062 Reviewed-by: Jens Carl <j.carl43@gmx.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-09Clean up makefile (remove some cargo-cult copied stuff)Jens Carl
Change-Id: Iafbb69a405a3c9ee8d0ae7dbe8a24a75d237519d Reviewed-on: https://gerrit.libreoffice.org/71924 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-07tdf#43157 Clean up OSL_VERIFY (replace with SAL_WARN)Jens Carl
Replace OSL_VERIFY with if-statement and SAL_WARN and add some unit tests to ensure the implementation works and the replacements don't introduce some side effects. Change-Id: I4ed50eee53e4dba4d392ed2486186d48f919ce1d Reviewed-on: https://gerrit.libreoffice.org/71712 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-01Fix typoAndrea Gelmini
Change-Id: I20e6de52e8244ef118973671cd25fb9fc6f3e22f Reviewed-on: https://gerrit.libreoffice.org/71632 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-30implement std::hash for css::uno::Reference and rtl::ReferenceNoel Grandin
The declaration in BarChart.cxx is particularly suspicious, because it was using a < for the KeyEqual template parameter. Been there since: commit b2c3233e5f267b5d244d722a94424a3b224b3314 Date: Thu Dec 21 20:08:33 2017 +0900 chart2: suspend/resume setting rects dirty for 3D shapes comphelper::OInterfaceCompare is no longer necessary Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975 Reviewed-on: https://gerrit.libreoffice.org/71537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30Fix typoAndrea Gelmini
Change-Id: Ie0193edb4e729c4469c15bc5940dbc8005caf28b Reviewed-on: https://gerrit.libreoffice.org/71561 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-30Fix typoAndrea Gelmini
Change-Id: I0af0c7c750018a9766dc0b3af4a6c114a7b27144 Reviewed-on: https://gerrit.libreoffice.org/71560 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-29Fix typoAndrea Gelmini
Change-Id: I881b23341ee1fc8d1ff3443e8ab52f51e07c3646 Reviewed-on: https://gerrit.libreoffice.org/71499 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-25Resolves: rhbz#1702810 Prepare for upcoming libebook soname version bumpMilan Crha
as noted here: https://mail.gnome.org/archives/desktop-devel-list/2019-April/msg00016.html wrt: https://gitlab.gnome.org/GNOME/evolution-data-server/issues/33 Change-Id: I88f900b3adf12de545b1d2d16da67eae22fde748 Reviewed-on: https://gerrit.libreoffice.org/71281 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-25Cut down on -pthread/-lpthread proliferationStephan Bergmann
Building against libstdc++ effectively always requires -pthread anyway (as various standard C++ headers require it, see the comment added to solenv/gbuild/platform/unxgcc.mk), so many explicit uses of -pthread/-lpthread can be removed. Doing a (partial) test build on Linux with Clang -stdlib=libc++ suggests that libc++ indeed doesn't need -pthread as libstdc++ does. The remaining uses of -pthread/-lpthread are mostly in configure.ac for the various BSDs (which somebody else might want to clean up now), and related to external projects. I tried to be careful to remove -pthread/-lpthread from makefiles only when C++ object files are involved (so -pthread will now be included on the link command line by default). Change-Id: I936e082839cb9a434bd273ce5a1f187a4245dfa1 Reviewed-on: https://gerrit.libreoffice.org/71291 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-25mysqlc: Allow conversions between different typesTamas Bunth
Change-Id: I54c1f438a755267db0896637c79f915de9113f83 Reviewed-on: https://gerrit.libreoffice.org/71074 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-04-24Avoid calling java.lang.Class.newInstance()Stephan Bergmann
For one, it is deprecated since Java 9, and for another it causes a NullPointerException when called from the JNI Invocation API (i.e., without a Java caller frame) at least with some Java 12. (Found when doing a test build with Java 12 and JAVA_SOURCE/TARGET_VER explicitly configured as 7 with d365f36331874f94bbd9832fbd19ace90fafefec "Allow to pass JAVA_SOURCE/TARGET_VER into configure".) I have entered information about the NullPointerException at <https://bugreport.java.com/bugreport/start_form.do>, but haven't heard back yet, so duplicate that information here: Issue Type: > Bug Component: > Core Libraries Operating System: > Linux 64-bit Java Release: > 12 Synopsis: > Calling java.lang.Class.newInstance from JNI Invocation API causes NullPointerEx Description: > I can reproduce this with the OpenJDK 12 RPMs on Fedora 30, but from looking at <https://hg.openjdk.java.net/jdk/jdk12/file/06222165c35f/src/java.base/share/classes/java/lang/Class.java> it looks plausible that it is a common issue that Reflection.getCallerClass() returns null when java.lang.Class.newInstance is called from the JNI Invocation API, and that null is propagated to jdk.internal.reflect.Reflection.verifyMemberAccess as parameter currentClass, which dereferences it at <https://hg.openjdk.java.net/jdk/jdk12/file/06222165c35f/src/java.base/share/classes/jdk/internal/reflect/Reflection.java#l130>. > This is known to have been working with older OpenJDK (at least 1.8). Steps to Reproduce: > Compile the provided test.cc with `g++ -I/usr/lib/jvm/java-12-openjdk-12.0.0.33-1.ea.1.rolling.fc30.x86_64/include -I/usr/lib/jvm/java-12-openjdk-12.0.0.33-1.ea.1.rolling.fc30.x86_64/include/linux /usr/lib/jvm/java-12-openjdk-12.0.0.33-1.ea.1.rolling.fc30.x86_64/lib/server/libjvm.so test.cc` and run it with `LD_LIBRARY_PATH=/usr/lib/jvm/java-12-openjdk-12.0.0.33-1.ea.1.rolling.fc30.x86_64/lib/server ./a.out`. Expected Result: > exit 0 Actual Result: > Exception in thread "main" java.lang.NullPointerException > at java.base/jdk.internal.reflect.Reflection.verifyMemberAccess(Reflection.java:130) > at java.base/java.lang.reflect.AccessibleObject.slowVerifyAccess(AccessibleObject.java:673) > at java.base/java.lang.reflect.AccessibleObject.verifyAccess(AccessibleObject.java:666) > at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:638) > at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:490) > at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:166) > at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:404) > at java.base/java.lang.Class.newInstance(Class.java:590) > Aborted Source code for an executable test case: > #include <cstdlib> > > #include "jni.h" > > void handleError(JNIEnv * env) { > if (env->ExceptionCheck()) { > env->ExceptionDescribe(); > std::abort(); > } > } > > int main() { > JavaVM * vm; > JNIEnv * env; > JavaVMInitArgs args{JNI_VERSION_1_2, 0, nullptr, true}; > if (JNI_CreateJavaVM(&vm, reinterpret_cast<void **>(&env), &args) != JNI_OK) { > std::abort(); > } > auto const c1 = env->FindClass("java/lang/Class"); > handleError(env); > auto const id = env->GetMethodID(c1, "newInstance", "()Ljava/lang/Object;"); > handleError(env); > auto const c2 = env->FindClass("java/lang/Object"); > handleError(env); > env->CallObjectMethod(c2, id); > handleError(env); > } Workaround: > Call via JNI the suggested replacement of clazz.getDeclaredConstructor().newInstance() instead of the deprecated java.lang.Class.newInstance(). Change-Id: I85ff7102a18b98561f188e609873753546bc050d Reviewed-on: https://gerrit.libreoffice.org/71240 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>