You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2014/10/06 21:22:54 UTC

svn commit: r1629739 - in /maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228: ./ invoker.properties pom.xml src/ src/main/ src/main/java/ src/main/java/example/ src/main/java/example/FinalExample.java

Author: rfscholte
Date: Mon Oct  6 19:22:53 2014
New Revision: 1629739

URL: http://svn.apache.org/r1629739
Log:
[MCOMPILER-228]: cannot assign a value to final variable in lamda
IT to confirm this issue is fixed by Oracle for JDK 1.8.0_40+

Added:
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/invoker.properties
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/java/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/java/example/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/invoker.properties?rev=1629739&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/invoker.properties (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/invoker.properties Mon Oct  6 19:22:53 2014
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# https://bugs.openjdk.java.net/browse/JDK-8051958
+invoker.java.version = 1.8.0_40+
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/pom.xml?rev=1629739&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/pom.xml (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/pom.xml Mon Oct  6 19:22:53 2014
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.compiler.its</groupId>
+  <artifactId>mcompiler228</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>http://jira.codehaus.org/browse/MCOMPILER-228</url>    
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <target>1.8</target>
+          <source>1.8</source>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java?rev=1629739&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java Mon Oct  6 19:22:53 2014
@@ -0,0 +1,49 @@
+package example;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Comparator;
+
+public class FinalExample 
+{
+    public static final Comparator<String> comparator = ( o1, o2 ) -> 
+    {
+        final String desc1 = o1;
+        final String desc2 = o2;
+        final int compareTo;
+        if ( desc1 == null ) 
+        {
+            compareTo = -1;
+        }
+        else if ( desc2 == null )
+        {
+            compareTo = 1;
+        }
+        else
+        {
+            compareTo = desc1.compareTo( desc2 );
+        }
+        if ( compareTo == 0 )
+        {
+            return 3;
+        }
+        return compareTo;
+    };
+}