19789496 junit does not build with java 8 s11-update
authorCraig Mohrman <craig.mohrman@oracle.com>
Tue, 28 Apr 2015 15:56:18 -0700
branchs11-update
changeset 4212 7fdccaa4b284
parent 4208 73e3b3d02222
child 4213 9164037457d6
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	Tue Apr 28 14:22:38 2015 -0700
+++ b/components/junit/Makefile	Tue Apr 28 15:56:18 2015 -0700
@@ -32,21 +32,21 @@
 COMPONENT_ARCHIVE_URL=  $(COMPONENT_PROJECT_URL)/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	utility/junit
 
-TPNO=			9070
+TPNO=                   9070
 
 include $(WS_MAKE_RULES)/prep.mk
 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
 
-# common targets
+ASLR_MODE = $(ASLR_NOT_APPLICABLE)
+
 build:		$(BUILD_32)
 	
 install:	build	
@@ -61,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	Tue Apr 28 14:22:38 2015 -0700
+++ b/components/junit/junit.p5m	Tue Apr 28 15:56:18 2015 -0700
@@ -40,18 +40,10 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=LSARC/2008/633
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-dir  path=usr
-dir  path=usr/share
-dir  path=usr/share/doc
-dir  path=usr/share/doc/cookbook
-dir  path=usr/share/doc/cookstour
-dir  path=usr/share/doc/faq
-dir  path=usr/share/doc/junit
 file path=usr/share/doc/junit/BUILDING
 file path=usr/share/doc/junit/README.html
 file path=usr/share/doc/junit/build.xml
 file path=usr/share/doc/junit/cpl-v10.html
-dir  path=usr/share/doc/junit/doc
 file path=usr/share/doc/junit/doc/ReleaseNotes4.10.html
 file path=usr/share/doc/junit/doc/ReleaseNotes4.10.txt
 file path=usr/share/doc/junit/doc/ReleaseNotes4.11.html
@@ -93,18 +85,12 @@
 file path=usr/share/doc/junit/doc/testinfected/logo.gif
 file path=usr/share/doc/junit/doc/testinfected/testing.htm
 link path=usr/share/doc/junit/javadoc target=../../lib/java/javadoc/junit
-dir  path=usr/share/doc/junit/org/testinfected
-dir  path=usr/share/doc/junit/samples
-dir  path=usr/share/doc/junit/samples/org
-dir  path=usr/share/doc/junit/samples/org/junit
-dir  path=usr/share/doc/junit/samples/org/junit/samples
 file path=usr/share/doc/junit/samples/org/junit/samples/AllTests.class
 file path=usr/share/doc/junit/samples/org/junit/samples/AllTests.java
 file path=usr/share/doc/junit/samples/org/junit/samples/ListTest.class
 file path=usr/share/doc/junit/samples/org/junit/samples/ListTest.java
 file path=usr/share/doc/junit/samples/org/junit/samples/SimpleTest.class
 file path=usr/share/doc/junit/samples/org/junit/samples/SimpleTest.java
-dir  path=usr/share/doc/junit/samples/org/junit/samples/money
 file path=usr/share/doc/junit/samples/org/junit/samples/money/IMoney.class
 file path=usr/share/doc/junit/samples/org/junit/samples/money/IMoney.java
 file path=usr/share/doc/junit/samples/org/junit/samples/money/Money.class
@@ -117,10 +103,6 @@
 file path=usr/share/doc/junit/samples/org/junit/samples/money/package-info.java
 file path=usr/share/doc/junit/samples/org/junit/samples/package-info.class
 file path=usr/share/doc/junit/samples/org/junit/samples/package-info.java
-dir  path=usr/share/lib
-dir  path=usr/share/lib/java
-dir  path=usr/share/lib/java/javadoc
-dir  path=usr/share/lib/java/javadoc/junit
 file path=usr/share/lib/java/javadoc/junit/allclasses-frame.html
 file path=usr/share/lib/java/javadoc/junit/allclasses-noframe.html
 file path=usr/share/lib/java/javadoc/junit/constant-values.html
@@ -128,8 +110,6 @@
 file path=usr/share/lib/java/javadoc/junit/help-doc.html
 file path=usr/share/lib/java/javadoc/junit/index-all.html
 file path=usr/share/lib/java/javadoc/junit/index.html
-dir  path=usr/share/lib/java/javadoc/junit/org
-dir  path=usr/share/lib/java/javadoc/junit/org/hamcrest
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/BaseDescription.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/BaseMatcher.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/Condition.Step.html
@@ -148,7 +128,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/StringDescription.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/TypeSafeDiagnosingMatcher.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/TypeSafeMatcher.html
-dir  path=usr/share/lib/java/javadoc/junit/org/hamcrest/core
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/core/AllOf.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/core/AnyOf.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/core/CombinableMatcher.CombinableBothMatcher.html
@@ -171,7 +150,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/core/package-frame.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/core/package-summary.html
 file path=usr/share/lib/java/javadoc/junit/org/hamcrest/core/package-tree.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit
 file path=usr/share/lib/java/javadoc/junit/org/junit/After.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/AfterClass.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/Assert.html
@@ -185,7 +163,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/junit/Rule.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/Test.None.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/Test.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit/matchers
 file path=usr/share/lib/java/javadoc/junit/org/junit/matchers/JUnitMatchers.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/matchers/package-frame.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/matchers/package-summary.html
@@ -193,7 +170,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/junit/package-frame.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/package-summary.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/package-tree.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit/rules
 file path=usr/share/lib/java/javadoc/junit/org/junit/rules/ErrorCollector.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/rules/ExpectedException.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/rules/ExternalResource.html
@@ -210,7 +186,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/junit/rules/package-frame.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/rules/package-summary.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/rules/package-tree.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit/runner
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/Computer.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/Describable.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/Description.html
@@ -219,7 +194,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/Result.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/RunWith.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/Runner.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit/runner/manipulation
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/manipulation/Filter.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/manipulation/Filterable.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/manipulation/NoTestsRemainException.html
@@ -228,7 +202,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/manipulation/package-frame.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/manipulation/package-summary.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/manipulation/package-tree.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit/runner/notification
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/notification/Failure.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/notification/RunListener.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/notification/RunNotifier.html
@@ -244,7 +217,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/package-frame.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/package-summary.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runner/package-tree.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit/runners
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/AllTests.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/BlockJUnit4ClassRunner.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/JUnit4.html
@@ -255,7 +227,6 @@
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/ParentRunner.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/Suite.SuiteClasses.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/Suite.html
-dir  path=usr/share/lib/java/javadoc/junit/org/junit/runners/model
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/model/FrameworkField.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/model/FrameworkMember.html
 file path=usr/share/lib/java/javadoc/junit/org/junit/runners/model/FrameworkMethod.html
@@ -275,17 +246,11 @@
 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
-dir  path=usr/share/lib/java/javadoc/junit/resources
-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
 link path=usr/share/lib/java/junit.jar target=junit-$(COMPONENT_VERSION).jar
-dir  path=usr/share/man
-dir  path=usr/share/man/man3
 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	Tue Apr 28 14:22:38 2015 -0700
+++ b/components/junit/patches/build.xml.patch	Tue Apr 28 15:56:18 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
[email protected]@ -152,7 +152,6 @@
++++ junit-r4.11/build.xml	2015-03-09 15:16:26.620136857 -0700
[email protected]@ -144,6 +144,7 @@
+              version="false"
+              use="false"
+              windowtitle="JUnit API"
++	     additionalparam="${additionalparam}"
+              stylesheetfile="stylesheet.css"
+              >
+       <excludepackage name="junit.*" />
[email protected]@ -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	Tue Apr 28 15:56:18 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
[email protected]@ -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;
+ 
[email protected]@ -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() {