kamilfb / mqtt-spy

Please use the new Eclipse Paho GitHub repo instead.
https://github.com/eclipse/paho.mqtt-spy/wiki
345 stars 68 forks source link

diamond operator needs at least 1.7 #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. checkout repo
2. cd mqtt-spy-common
3. mvn clean install

What is the expected output? What do you see instead?

BUILD SUCCESS

What version of the product are you using? On what operating system?

Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 
17:22:22+0200)
Maven home: /usr/share/maven-bin-3.1
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: /opt/oracle-jdk-bin-1.8.0.40/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.18.2-gentoo", arch: "amd64", family: "unix"

Please provide any additional information below.

Using unmodified pom.xml for mqtt-spy-common results in an error on compilation:

[ERROR] 
/home/rathgeb/workspace/esh/mqtt-spy/mqtt-spy-common/src/main/java/pl/baczkowicz
/mqttspy/scripts/ScriptManager.java:[183,50] error: diamond operator is not 
supported in -source 1.5

So, we should set the source to 1.7 or 1.8.

diff --git a/mqtt-spy-common/pom.xml b/mqtt-spy-common/pom.xml
index 1dca75c..d7bdc5c 100644
--- a/mqtt-spy-common/pom.xml
+++ b/mqtt-spy-common/pom.xml
@@ -8,6 +8,8 @@
        <properties>
                <timestamp>${maven.build.timestamp}</timestamp>
                <maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
+               <maven.compiler.source>1.7</maven.compiler.source>
+               <maven.compiler.target>1.7</maven.compiler.target>
        </properties>

        <repositories>

Original issue reported on code.google.com by maggu2810@gmail.com on 9 Mar 2015 at 10:07

GoogleCodeExporter commented 9 years ago
mqtt-spy is using lambda expressions, so we need to that 1.8 for mqtt-spy.
Perhaps we should set this in every pom.

Original comment by maggu2810@gmail.com on 9 Mar 2015 at 10:09

kamilfb commented 9 years ago

Many thanks for reporting it and providing a fix. Done in the development branch.