| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,6 +220,7 @@ | |||
| 220 | 220 | <javac srcdir="src" destdir="classes/base" source="1.7" target="1.7" | |
| 221 | 221 | bootclasspath="${java8-runtime}" sourcepath="" includeAntRuntime="no" | |
| 222 | 222 | executable="${java8-home}/bin/javac" fork="yes" memoryMaximumSize="1024M" | |
| 223 | + encoding="UTF-8" | ||
| 223 | 224 | debug="on" optimize="off" deprecation="on" > | |
| 224 | 225 | <classpath> | |
| 225 | 226 | <!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent | |
@@ -273,6 +274,7 @@ | |||
| 273 | 274 | <javac srcdir="src" destdir="classes/base" source="1.6" target="1.6" | |
| 274 | 275 | bootclasspath="${java8-runtime}" sourcepath="" includeAntRuntime="no" | |
| 275 | 276 | executable="javac" fork="yes" memoryMaximumSize="1024M" | |
| 277 | + encoding="UTF-8" | ||
| 276 | 278 | debug="on" optimize="off" deprecation="on" > | |
| 277 | 279 | <classpath> | |
| 278 | 280 | <!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,8 +43,10 @@ public static void main(String... args) throws IOException { | |||
| 43 | 43 | } | |
| 44 | 44 | else{ | |
| 45 | 45 | 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 | + } | ||
| 48 | 50 | } | |
| 49 | 51 | ||
| 50 | 52 | if (input != null) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1614,9 +1614,13 @@ private void evaluateConstantExpression(UnaryExpression node) { | |||
| 1614 | 1614 | @Override public Type visit(InstanceOfExpression node) { | |
| 1615 | 1615 | Type expT = check(node.getExpression()); | |
| 1616 | 1616 | 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 | + | ||
| 1620 | 1624 | if (!ts.isReifiable(targetT)) { | |
| 1621 | 1625 | throw new ExecutionError("reifiable.type", node); | |
| 1622 | 1626 | } | |
| Original file line number | Diff line number | Diff 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; | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments