File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
java/src/processing/mode/java Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,8 @@ public void close() { }
166166 exception = new SketchException (errorMessage );
167167 }
168168
169+ String [] parts = null ;
170+
169171 if (errorMessage .startsWith ("The import " ) &&
170172 errorMessage .endsWith ("cannot be resolved" )) {
171173 // The import poo cannot be resolved
@@ -253,9 +255,18 @@ public void close() { }
253255 // "Duplicate nested type xxx"
254256 // "Duplicate local variable xxx"
255257
258+ } else if (null != (parts = PApplet .match (errorMessage ,
259+ "literal (\\ S*) of type (\\ S*) is out of range" ))) {
260+ if ("int" .equals (parts [2 ])) {
261+ exception .setMessage ("The type int can't handle numbers that big. Try "
262+ + parts [1 ] + "L to upgrade to long." );
263+ } else {
264+ // I'd like to give an essay on BigInteger and BigDecimal, but
265+ // this margin is too narrow to contain it.
266+ exception .setMessage ("Even the type " + parts [2 ] + " can't handle "
267+ + parts [1 ] + ". Research big numbers in Java." );
268+ }
256269 } else {
257- String [] parts = null ;
258-
259270 // The method xxx(String) is undefined for the type Temporary_XXXX_XXXX
260271 //xxx("blah");
261272 // The method xxx(String, int) is undefined for the type Temporary_XXXX_XXXX
You can’t perform that action at this time.
0 commit comments