Can't see the missing curly bracket

Hi there!
I have a very short code that should clean up a dump file, but I get continuously errors because there’s a missing “{” and after 1h of frustrated staring, I need your help =)

ArrayList<String> rough = new ArrayList<String>();
ArrayList<String> sauber = new ArrayList<String>();
PrintWriter output;
String[] p;
String[] q;

void setup() {
  size(400, 400);
  output = createWriter("cleaned.txt"); 
  String[] dump = loadStrings("savefile.xml");

  for (int i=0; i < dump.length-6; i++) {

    if (dump[i].equals("</computer>")) {
      q = splitTokens(dump[i+1], str('"'));

      if (dump[i+3].equals("firewall")) {
        p = splitTokens(dump[i+6], str('"'));
      } else {
        p = splitTokens(dump[i+5], str('"'));

      sauber.add(" // ");

But processing keeps stating that it "Found a { that’s missing a matching }

I think it may just be a bug when trying to call splitTokens within setup

try placing the code in draw() and adding a method for it to only draw once (like adding stop() after the code is done)

I would also consider reporting this bug

i also see that as long line 20 is not disabled,
what even makes less sense as the first two splitTokens might work??
( here is your xml file not available )

but just a idea, how about using

Hmm. Removing line 28 which is sauber.add(" // "); seems to fix it. In particular, the // in the string causes the error.

Cutting down on code, I came down to this minimum viable example:

void setup() {
      splitTokens("hi", str('"'));
//      println("//");

Removing the commented out line fixes the error. That is pretty bizarre.

Anyone care to file a bug report? Can’t do that myself right now.

Was this ever reported?

This also fails

char c = '"';
void setup() {
  //      println("//");


Found a { that’s missing a matching }`

However changing either the single quoted character or the double-quoted string causes the problem to disappear.

char c = 'a';
void setup() {
  //      println("//");
char c = '"';
void setup() {
  //      println("a");