19789496 junit does not build with java 8
authorCraig Mohrman <craig.mohrman@oracle.com>
Mon, 27 Apr 2015 19:48:28 -0700
changeset 4197 67d7270f6817
parent 4196 d697072a92f5
child 4201 1db8af129b18
19789496 junit does not build with java 8
components/junit/Makefile
components/junit/junit.p5m
components/junit/patches/build.xml.patch
components/junit/patches/java8.patch
--- a/components/junit/Makefile	Mon Apr 27 10:19:50 2015 -0500
+++ b/components/junit/Makefile	Mon Apr 27 19:48:28 2015 -0700
@@ -38,17 +38,15 @@
 include $(WS_MAKE_RULES)/ant.mk
 include $(WS_MAKE_RULES)/ips.mk
 
-JAVA_HOME = $(JAVA7_HOME)
-
 # These ARGS override what is set in build.xml
 COMPONENT_BUILD_ARGS 	+= -Ddist=${PROTO_DIR}
 COMPONENT_BUILD_ARGS    += -Djavadocdir=${PROTO_DIR}
 COMPONENT_BUILD_ARGS    += -Dversion-status=""
+COMPONENT_BUILD_ARGS    += -Dadditionalparam="-Xdoclint:none"
 COMPONENT_BUILD_TARGETS += dist
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-# common targets
 build:		$(BUILD_32)
 	
 install:	build	
@@ -63,5 +61,4 @@
 # OK (22 tests)
 test:		$(NO_TESTS)
 		
-
-REQUIRED_PACKAGES += runtime/java/jre-7
+REQUIRED_PACKAGES += runtime/java/jre-8
--- a/components/junit/junit.p5m	Mon Apr 27 10:19:50 2015 -0500
+++ b/components/junit/junit.p5m	Mon Apr 27 19:48:28 2015 -0700
@@ -246,10 +246,6 @@
 file path=usr/share/lib/java/javadoc/junit/overview-summary.html
 file path=usr/share/lib/java/javadoc/junit/overview-tree.html
 file path=usr/share/lib/java/javadoc/junit/package-list
-file path=usr/share/lib/java/javadoc/junit/resources/background.gif
-file path=usr/share/lib/java/javadoc/junit/resources/tab.gif
-file path=usr/share/lib/java/javadoc/junit/resources/titlebar.gif
-file path=usr/share/lib/java/javadoc/junit/resources/titlebar_end.gif
 file path=usr/share/lib/java/javadoc/junit/serialized-form.html
 file path=usr/share/lib/java/javadoc/junit/stylesheet.css
 file path=usr/share/lib/java/junit-$(COMPONENT_VERSION).jar
@@ -257,4 +253,4 @@
 file junit.3 path=usr/share/man/man3/junit.3
 license junit.license license="CPLv1.0, BSD"
 #
-depend type=require fmri=runtime/java/jre-7
+depend type=require fmri=runtime/java/jre-8
--- a/components/junit/patches/build.xml.patch	Mon Apr 27 10:19:50 2015 -0500
+++ b/components/junit/patches/build.xml.patch	Mon Apr 27 19:48:28 2015 -0700
@@ -1,7 +1,18 @@
+# Need to pass in another parameter from the Makefile.
+
 # Disable this download of outside documentation.
+
 --- junit-r4.11/build.xml_orig	2012-11-13 12:10:08.000000000 -0800
-+++ junit-r4.11/build.xml	2013-02-27 11:20:06.370285042 -0800
-@@ -152,7 +152,6 @@
++++ junit-r4.11/build.xml	2015-03-09 15:16:26.620136857 -0700
+@@ -144,6 +144,7 @@
+              version="false"
+              use="false"
+              windowtitle="JUnit API"
++	     additionalparam="${additionalparam}"
+              stylesheetfile="stylesheet.css"
+              >
+       <excludepackage name="junit.*" />
+@@ -152,7 +153,6 @@
        
        <sourcepath location="${src}" />
        <sourcepath location="${hamcrestsrc}" />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/junit/patches/java8.patch	Mon Apr 27 19:48:28 2015 -0700
@@ -0,0 +1,40 @@
+This is the community's fix for using Java 8.
+Community bug:
+https://github.com/junit-team/junit/issues/749
+Community code:
+https://github.com/stefanbirkner/junit/commit/69de4c23996fe320e8345f273e2e35e529f0fdf3
+
+
+--- junit-r4.11/src/main/java/org/junit/internal/MethodSorter.java.orig	Thu Oct  9 11:09:18 2014
++++ junit-r4.11/src/main/java/org/junit/internal/MethodSorter.java	Thu Oct  9 11:14:09 2014
+@@ -1,8 +1,10 @@
+ package org.junit.internal;
+ 
+ import java.lang.reflect.Method;
+-import java.util.Arrays;
++import java.util.ArrayList;
++import java.util.Collections;
+ import java.util.Comparator;
++import java.util.List;
+ 
+ import org.junit.FixMethodOrder;
+ 
+@@ -52,11 +54,16 @@
+         Comparator<Method> comparator = getSorter(clazz.getAnnotation(FixMethodOrder.class));
+ 
+         Method[] methods = clazz.getDeclaredMethods();
++        List<Method> x = new ArrayList<Method>();
++        for (Method method : methods)
++            if (!method.isBridge() && !method.isSynthetic())
++                x.add(method);
++
+         if (comparator != null) {
+-            Arrays.sort(methods, comparator);
++            Collections.sort(x, comparator);
+         }
+ 
+-        return methods;
++        return x.toArray(new Method[x.size()]);
+     }
+ 
+     private MethodSorter() {