From d2c3d771d7a8d22cccf9fc42cee32e87096f8bd5 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Tue, 10 Dec 2013 20:23:16 -0700 Subject: [PATCH] fix java 1.6 compatibility, and make sure it's maintained in the future --- makefile | 9 ++++++--- test/Reflection.java | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index f128d3e1f5..8e916fb336 100755 --- a/makefile +++ b/makefile @@ -1547,7 +1547,8 @@ $(classpath-dep): $(classpath-sources) $(classpath-jar-dep) @mkdir -p $(classpath-build) classes="$(shell $(MAKE) -s --no-print-directory build=$(build) \ $(classpath-classes))"; if [ -n "$${classes}" ]; then \ - $(javac) -d $(classpath-build) -bootclasspath $(boot-classpath) \ + $(javac) -source 1.6 -target 1.6 \ + -d $(classpath-build) -bootclasspath $(boot-classpath) \ $${classes}; fi @touch $(@) @@ -1595,7 +1596,8 @@ $(test-dep): $(test-sources) $(test-library) @mkdir -p $(test-build) files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-classes))"; \ if test -n "$${files}"; then \ - $(javac) -classpath $(test-build) -d $(test-build) -bootclasspath $(boot-classpath) $${files}; \ + $(javac) -source 1.6 -target 1.6 \ + -classpath $(test-build) -d $(test-build) -bootclasspath $(boot-classpath) $${files}; \ fi $(javac) -source 1.2 -target 1.1 -XDjsrlimit=0 -d $(test-build) \ -bootclasspath $(boot-classpath) test/Subroutine.java @@ -1606,7 +1608,8 @@ $(test-extra-dep): $(test-extra-sources) @mkdir -p $(test-build) files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-extra-classes))"; \ if test -n "$${files}"; then \ - $(javac) -d $(test-build) -bootclasspath $(boot-classpath) $${files}; \ + $(javac) -source 1.6 -target 1.6 \ + -d $(test-build) -bootclasspath $(boot-classpath) $${files}; \ fi @touch $(@) diff --git a/test/Reflection.java b/test/Reflection.java index 3afe5316b5..f00daede8d 100644 --- a/test/Reflection.java +++ b/test/Reflection.java @@ -145,7 +145,7 @@ public class Reflection { expect(r.egads == 0); Reflection.class.getDeclaredField("egads").set(r, 42); - expect(((int) Reflection.class.getDeclaredField("egads").get(r)) == 42); + expect(((Integer)Reflection.class.getDeclaredField("egads").get(r)) == 42); Reflection.class.getDeclaredField("egads").setInt(r, 43); expect(Reflection.class.getDeclaredField("egads").getInt(r) == 43);