java : swing anonymous classes transformed in lambdas when building modules

hello

all is in the title : I want to avoid the automatic transformation in lambdas expressions, I have defined the 'level' of my module as JDK 7 (so I should not meet lambdas).anyway the text is reformated and it brings crashes of my program!

thanks

olivier:D

5 comments

Hi Oliver,

Please provide a minimal but complete sample project which illustrates the problem

Denis

0

hello

here is it, with my apologizes for the delay :

BEFORE : the good version ***************************************************

SwingUtilities.invokeLater(new Runnable() {


            @SuppressWarnings("static-access")
            @Override
            public void run() {
                oracle = new Gestion_oracle();
                sqlite = new Gestion_sqlite();
                proprietes = new Gestion_proprietes();
                proprietes.charge();
                setSmstrend(new Gestion_Smstrend());
                append(format_log.format(new Date()) + " dans serviceInit(), tous : " + getProprietes().isTous() + "");
                append(format_log.format(new Date()) + " dans serviceInit(), unique : " + getProprietes().isUnique() + "");
                append(format_log.format(new Date()) + " dans serviceInit(), notel : " + getProprietes().isNotel() + "");
                append(format_log.format(new Date()) + " dans serviceInit(), connexion smstrend : "
                        + getSmstrend().getConnexion() + "");

            }
        });

***********************************************************************************

AFTER a build *****************************************************************
SwingUtilities.invokeLater(() -> {
                oracle = new Gestion_oracle();
                sqlite = new Gestion_sqlite();
                proprietes = new Gestion_proprietes();
                proprietes.charge();
                setSmstrend(new Gestion_Smstrend());
                append(format_log.format(new Date()) + " dans serviceInit(), tous : " + getProprietes().isTous() + "");
                append(format_log.format(new Date()) + " dans serviceInit(), unique : " + getProprietes().isUnique() + "");
                append(format_log.format(new Date()) + " dans serviceInit(), notel : " + getProprietes().isNotel() + "");
                append(format_log.format(new Date()) + " dans serviceInit(), connexion smstrend : "
                        + getSmstrend().getConnexion() + "");



        });
**********************************************************************************

and I have another problem : I have a classpath with multiple entries; here is it:

. SMS2_lib/commons-lang3-3.1.jar SMS2_lib/log4j-1.2.16.jar SMS2_lib/org.hamcrest.core_1.1.0.v20090501071000.jar SMS2_lib/forms-1.2.0.jar SMS2_lib/sqlite-jdbc-3.7.2-javadoc.jar SMS2_lib/commons-cli-1.2-javadoc.jar SMS2_lib/laf-widget.jar SMS2_lib/substance-swingx.jar SMS2_lib/slf4j-api-1.6.1.jar SMS2_lib/swingx.jar SMS2_lib/miglayout15-swing.jar SMS2_lib/trident.jar SMS2_lib/slf4j-log4j12-1.6.1.jar SMS2_lib/c3p0-0.9.1.1.jar SMS2_lib/commonEvent.jar SMS2_lib/sqlite-jdbc-3.7.2.jar SMS2_lib/common.jar SMS2_lib/ojdbc14.jar SMS2_lib/quartz-all-2.1.7.jar SMS2_lib/commons-lang3-3.1-javadoc.jar SMS2_lib/junit.jar SMS2_lib/commons-cli-1.2.jar SMS2_lib/commonService.jar SMS2_ lib/asm-all-2.2.2.jar SMS2_lib/Theme.jar SMS2_lib/laf-plugin.jar

but when I build my project, and if I extract the generated jar, the MANIFEST.MF contains unexpected spaces, in the name of some jar files...

thank you

olivier

0

Am I right understanding that you right a code like below:

before.png
but the ide displays then like below:
after.png
Then there is no problem at all as the snippet below is not an actual code but just its folded representation (you can click any of the highlighted regions to get the 'raw text').

Regarding the classpath problem - it's unclear at all:

  1. Do you configure that classpath manuallly of where did you get it from?
  2. How do you generate the jar?
  3. What exactly is wrong with the resulting manifest?
  4. Sample project is welcomed;


Denis

0

hello

thanks.
for the classpath problem : I configure the classpath manually, and I generate the jar by creating an artifact, then I launch in the main window : build/build artifacts/all artifacts.
the artifact is of type "jar", and the META-INF directory with the MANIFEST.MF file inside is added to the jar.
in the last post of this thread, you can see an extra space for the library asm-all-2.2.2.jar.

I can give you other informations if needed.

regards,

olivier

0

Please provide a sample project which illustrates the problem

Denis

0

Please sign in to leave a comment.