FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 1522 : unexpected token: boolean
Last modified: 2010-03-22 08:04
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
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;