mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
Merge pull request #132 from joshuawarner32/master
fix java 1.6 compatibility, and make sure it's maintained in the future
This commit is contained in:
commit
2cb606babd
9
makefile
9
makefile
@ -1547,7 +1547,8 @@ $(classpath-dep): $(classpath-sources) $(classpath-jar-dep)
|
|||||||
@mkdir -p $(classpath-build)
|
@mkdir -p $(classpath-build)
|
||||||
classes="$(shell $(MAKE) -s --no-print-directory build=$(build) \
|
classes="$(shell $(MAKE) -s --no-print-directory build=$(build) \
|
||||||
$(classpath-classes))"; if [ -n "$${classes}" ]; then \
|
$(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
|
$${classes}; fi
|
||||||
@touch $(@)
|
@touch $(@)
|
||||||
|
|
||||||
@ -1595,7 +1596,8 @@ $(test-dep): $(test-sources) $(test-library)
|
|||||||
@mkdir -p $(test-build)
|
@mkdir -p $(test-build)
|
||||||
files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-classes))"; \
|
files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-classes))"; \
|
||||||
if test -n "$${files}"; then \
|
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
|
fi
|
||||||
$(javac) -source 1.2 -target 1.1 -XDjsrlimit=0 -d $(test-build) \
|
$(javac) -source 1.2 -target 1.1 -XDjsrlimit=0 -d $(test-build) \
|
||||||
-bootclasspath $(boot-classpath) test/Subroutine.java
|
-bootclasspath $(boot-classpath) test/Subroutine.java
|
||||||
@ -1606,7 +1608,8 @@ $(test-extra-dep): $(test-extra-sources)
|
|||||||
@mkdir -p $(test-build)
|
@mkdir -p $(test-build)
|
||||||
files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-extra-classes))"; \
|
files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-extra-classes))"; \
|
||||||
if test -n "$${files}"; then \
|
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
|
fi
|
||||||
@touch $(@)
|
@touch $(@)
|
||||||
|
|
||||||
|
@ -144,8 +144,8 @@ public class Reflection {
|
|||||||
{ Reflection r = new Reflection();
|
{ Reflection r = new Reflection();
|
||||||
expect(r.egads == 0);
|
expect(r.egads == 0);
|
||||||
|
|
||||||
Reflection.class.getDeclaredField("egads").set(r, 42);
|
Reflection.class.getDeclaredField("egads").set(r, (Integer)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);
|
Reflection.class.getDeclaredField("egads").setInt(r, 43);
|
||||||
expect(Reflection.class.getDeclaredField("egads").getInt(r) == 43);
|
expect(Reflection.class.getDeclaredField("egads").getInt(r) == 43);
|
||||||
@ -210,7 +210,7 @@ public class Reflection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Foo.class.getField("foo").set(null, 42);
|
Foo.class.getField("foo").set(null, (Integer)42);
|
||||||
expect(false);
|
expect(false);
|
||||||
} catch (NoClassDefFoundError e) {
|
} catch (NoClassDefFoundError e) {
|
||||||
// cool
|
// cool
|
||||||
|
Loading…
Reference in New Issue
Block a user