Is there any plan to ditch Java in the future and use only C/C++ code?
There is. As almost everything about LO it is long-term plan, but there is some progress, e.g search http://www.libreoffice.org/download/4-0-new-features-and-fixes/ for Java.
See also: Development · Java
There is GSoC 2013 project to replace HSQLDB with Firbird SQL Database for LO Base:
So there will be major component LibreOffice Base that will not require Java and so only some special parts of LibreOffice will require a Java.
There is one big part left that will not be replaced soon and that are the old API tests. But in contrast to the base parts they are not shipped with the product.
Interesting comment. Don’t know what was the main point of original question - you know from end-user perspective of not needing Java Run-time Environment any more or from developer point of view (API tests etc). Quite big success would be from end-user point of few of not needing to install JRE which can even be very dangerous if enabled (by default) in web browser as plug-in.
Bug related to comment by @mmohrhard is fdo#45904. Thanks for pointing this out Markus.
Just to add my 2c to this: I think Java will still be required for the MySQL/JDBC database connector (i.e. to connect to a MariaDB or MySQL database). Also MySQL/ODBC is down with a known bug. And the native MySQL connector was removed in 5.3. Furthermore, Firebird is lacking in places, and also there is no plan to remove HSQLDB any time soon, if ever. For example it’s currently quite a bit of trouble to rename a key field (like your record ID) in Firebird.
The question as asked is very broad and the idea of using “only C/C++ code” seems simplistic. There is a wide variety of language code used in LO, with C++ and Java merely being the two most extensively used ones. This AskLO question about replacing Java scripts with Python is related.
The information in this answer needs to be taken in the context that statistics are notoriously contentious, even so I felt it might be good to have some figures to add. Caolán McNamara provides some “lower-bound” figures from
sloccount for OO v2.1 in Jan 2007 and LO v3.6.2 in Sep 2012. The two blog entries highlight an important point that the source packaging has changed over time and this makes it more challenging to obtain like-for-like numbers (refer notes at bottom). These figures (also from
sloccount) are more an “upper-bound” set (i.e., include all Java code) based on significant / end-of-life (EOL) releases for OOo, LO, and AOO.
lines p/cent version ----- ------ ------- 126538 (3.92%) OOo v1.0.3  228821 (6.22%) OOo v1.1.5  385075 (8.84%) OOo v2.1.0  372807 (8.59%) OOo v2.2.1  405473 (8.88%) OOo v2.3.1  393523 (8.49%) OOo v2.4.3  388903 (8.46%) OOo v3.0.1  396073 (8.53%) OOo v3.1.1  408610 (8.62%) OOo v3.2.1  382284 (8.04%) OOo v3.3.0  403890 (8.02%) LO v3.3.4-final  401205 (8.09%) LO v184.108.40.206  395165 (8.14%) LO v220.127.116.11  387388 (8.20%) LO v18.104.22.168  401007 (8.36%) LO v22.214.171.124  375603 (7.87%) LO v126.96.36.199  376390 (7.73%) LO v188.8.131.52  364014 (7.62%) LO v184.108.40.206  406520 (7.30%) AOO v3.4.1-r1435053 405245 (8.45%) AOO v4.0.1-r1524958 405212 (8.41%) AOO v4.1.0-r1589052
LO efforts to clean-up the code based (v3.3 to v4.1) have reduced the number of lines of code for all languages (from ~5,000,000 to ~4,770,000) and this effects the percentage of Java use. Conversely, in AOO the number of lines of Java appears relatively unchanged. I will leave it to others to comment further or correct me on anything I may have clearly got wrong.
 All inclusive source package.
 Source package ‘core’ only.
 Source packages ‘base’, ‘bootstrap’, ‘build’, ‘calc’, ‘components’, ‘extensions’, ‘extras’, ‘filters’ (excl. binfilter/), ‘impress’, ‘libs-core’, ‘libs-extern’, ‘libs-extern-sys’ (excl. dictionaries/), ‘libs-gui’, ‘postprocess’, ‘sdk’, ‘testing’, ‘ure’, and ‘writer’.
 Source packages as per  but excluding ‘build’.
 Most of the increase is due to the inclusion of Android code (~27,000 lines).
 Rewriting of the fax/letter/agenda/web/report/form/table wizards in Python is now complete as suggested in fdo#38820. This reduced the Java use in
wizards/ from ~44,000 lines (v220.127.116.11) to ~35,000 (v18.104.22.168).
- 2014-06-20: Statistics updated.
- 2014-09-06: Statistics updated.