Bug 1522 : unexpected token: boolean
Last modified: 2010-03-22 08:04




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
janebeta7
Assigned To:
MrFeinberg

Attachment Type Created Size Actions
The error image/jpeg 2010-03-22 07:37 32.12 KB

Description:   Opened: 2010-03-22 07:36
In previous versions all ok, but in Processing 1.1 with Windows / OS X fail

I Have this code:

class PicFilter implements FilenameFilter
{


public boolean accept ( File dir, String name )
{
if ( new File( dir, name ).isDirectory())
{
return false;
}

return (name.endsWith( ".png" ) || name.endsWith( ".jpg" ) ||
name.endsWith( ".gif" )) ;
name = name.toLowerCase();
return true;
}
}

and An error appears:
processing.app.debug.RunnerException: unexpected token: boolean
Additional Comment #1 From janebeta7 2010-03-22 07:37
edit]
The error

This is the error
Additional Comment #2 From MrFeinberg 2010-03-22 07:52
Cannot reproduce with current HEAD. janebeta7, please download the latest
build (0181) and try with that. You'll find you've got some unreachable
code in your example, but the syntax error is gone.
Additional Comment #3 From janebeta7 2010-03-22 08:04
I change the code and now the error does'nt appear

public static boolean accept ( File dir, String name )
{

if ( new File( dir, name ).isDirectory())
{
return false;
}
name = name.toLowerCase();
String str = "CCCP";
boolean valid =false;
int posjpg = name.indexOf(".png" );
int posgif = name.indexOf(".gif" );
int pospng = name.indexOf(".png" );
if ( posjpg != -1 || posgif != -1 || pospng !=-1) valid = true;
return valid;