We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I've gone over this a few times. Processing is reporting "Found one too many { characters without a } to match it." I count exactly twenty "{" and the same number of "}". Help?
EDIT: I put all my classes in different tabs. This is the tab Processing opened when I got the error.
public class Server
{
private JSONObject data;
private String name;
private String status;
private int port;
private boolean shared;
private String publicURL;
public Server(String newName)
{
name = newName;
refreshData();
}
//Getting----------------------
public String getName() {
return name;
}
public String getStatus() {
return status;
}
public String getPublicUrl() {
return publicURL;
}
public String toString() {
return data.toString();
}
//Misc-------------------------
public void refreshData()
{
JSONArray servers = null;
try {
servers = loadJSONArray("http://127.0.0.1:33649/server/list");
}
catch (Exception e1)
{
launch("C:\\ProgramData\\Fenix\\Fenix.exe");
while (servers==null)
{
try {
servers = loadJSONArray("http://127.0.0.1:33649/server/list");
}
catch (Exception e2)
{
}
}
}
for (int i = 0; i<servers.size(); i++)
{
JSONObject temp = servers.getJSONObject(i);
if (temp.getString("name").equals(name))
{
data = temp;
}
}
if (data.getBoolean("starting"))
{
status = "Starting";
} else if (data.getBoolean("stopping"))
{
status = "Stopping";
} else if (data.getBoolean("running"))
{
status = "Running";
} else
{
status = "Stopped";
}
port = data.getInt("port");
if (data.getBoolean("shared"))
{
shared = true;
publicURL = data.getString("publicUrl");
} else
{
shared = false;
publicURL = null;
}
}
}
Answers
The problem isn't always where it's reported to be - unbalanced braces on earlier code is probably causing this.
rejected answer 8(
but no new information for us...
the problem is in a different tab - processing just concatenates all the code together before it runs it.
don't believe me?
TAB 1
TAB 2
run this and it'll tell you the error is in TAB2.