FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge branch 'devel' · jiverson002/drjava@cfef223 · GitHub

This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Repository navigation

Commit cfef223

Browse files
committed
Merge branch 'devel'
2 parents 075eb1e + 73393c0 commit cfef223

5 files changed

Lines changed: 25 additions & 5 deletions

File tree

‎drjava/build.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
<javac srcdir="src" destdir="classes/base" source="1.7" target="1.7"
221221
bootclasspath="${java8-runtime}" sourcepath="" includeAntRuntime="no"
222222
executable="${java8-home}/bin/javac" fork="yes" memoryMaximumSize="1024M"
223+
encoding="UTF-8"
223224
debug="on" optimize="off" deprecation="on" >
224225
<classpath>
225226
<!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent
@@ -273,6 +274,7 @@
273274
<javac srcdir="src" destdir="classes/base" source="1.6" target="1.6"
274275
bootclasspath="${java8-runtime}" sourcepath="" includeAntRuntime="no"
275276
executable="javac" fork="yes" memoryMaximumSize="1024M"
277+
encoding="UTF-8"
276278
debug="on" optimize="off" deprecation="on" >
277279
<classpath>
278280
<!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent

‎drjava/lib/dynamicjava-base.jar‎

1.06 MB
Binary file not shown.

‎dynamicjava/src/edu/rice/cs/dynamicjava/DynamicJava.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ public static void main(String... args) throws IOException {
4343
}
4444
else{
4545
input = in.readLine();
46-
System.out.print(prompt);
47-
System.out.println(input);
46+
if(input != null){
47+
System.out.print(prompt);
48+
System.out.println(input);
49+
}
4850
}
4951

5052
if (input != null) {

‎dynamicjava/src/edu/rice/cs/dynamicjava/interpreter/ExpressionChecker.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,9 +1614,13 @@ private void evaluateConstantExpression(UnaryExpression node) {
16141614
@Override public Type visit(InstanceOfExpression node) {
16151615
Type expT = check(node.getExpression());
16161616
Type targetT = checkTypeName(node.getReferenceType());
1617-
if (!ts.isReference(expT) || !ts.isReference(targetT) || ts.isDisjoint(targetT, expT)) {
1618-
throw new ExecutionError("instanceof.type", node);
1619-
}
1617+
// if (!ts.isReference(expT) || !ts.isReference(targetT) || ts.isDisjoint(targetT, expT)) {
1618+
// // throw new ExecutionError("instanceof.type", node);
1619+
// }
1620+
//
1621+
// Removing this check case to allow false to be returned on the
1622+
// main interactive loop for expressions like "hi" instanceof Integer
1623+
16201624
if (!ts.isReifiable(targetT)) {
16211625
throw new ExecutionError("reifiable.type", node);
16221626
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Object s = "hi"
2+
// should be true
3+
assert(s instanceof Object)
4+
5+
// should be true
6+
assert(s instanceof String)
7+
8+
// should be false
9+
s instanceof Integer
10+
assert(!(s instanceof Integer))
11+
12+
Integer i = (Integer) s;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL