I am getting an error using the Auto Format command when there is a syntactical error in a for loop specifier. (MacOS 10.5.7, Arduino 0016)
When the for statement has commas for separators instead of semi-colons, the IDE thinks for a very long time when asked to Auto Format the sketch, and then yields the message:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
The compiler will correctly diagnose the error, however.
Here is a very simple sketch that demonstrates the error:
int i;
void setup () {
}
void loop () {
for (i = 0, i < 10, i++)
;
}
Yup, it is falling off the end of the world trying to make sense of that bad code. The parsing stuff looks ok, but it might be the display code wanting to display things over and over.
The autoformat function is still pretty buggy and is best avoided until after you have made sure that the program compiles.
It used to have a charming "auto-delete" bug where code was deleted if brackets weren't balanced (which balanced the code) but that one has been fixed for a while. There are still many bugs and quirks in it though so compile first - and you'll be happier.