geometer/FBReaderJ — comment on commit 5858509076eb34faaeeef47825cf72e632c2902a
File:  line 0
By vasiliy-bout:

We have synchronization issues in this class. Check that all reading & writing operations with class fields MUST be placed into

synchronized (this) {
...
}

blocks.

For example, code from authorise(String) method:

try {
result = ServerInterface.ourAuthLogin(
UserNameOption.getValue(),
password,
myFBIdOption.getValue()
);
} catch (ZLNetworkException e) {
exception = e;
}

should be rewritten as:

String name;
String fbId;
synchronized (this) {
name = UserNameOption.getValue();
fbId = myFBIdOption.getValue();
}
try {
result = ServerInterface.ourAuthLogin(name, password, fbId);
} catch (ZLNetworkException e) {
exception = e;
}

because long network operations MUST NOT be placed into synchronized blocks.