mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
fixed synchronized blocks
This commit is contained in:
parent
8488514593
commit
b6a701520e
1 changed files with 8 additions and 7 deletions
|
@ -166,7 +166,7 @@ public class NetworkLibrary {
|
|||
}
|
||||
|
||||
private boolean myIsAlreadyInitialized;
|
||||
public synchronized void initialize() throws ZLNetworkException {
|
||||
public void initialize() throws ZLNetworkException {
|
||||
if (myIsAlreadyInitialized) {
|
||||
return;
|
||||
}
|
||||
|
@ -473,15 +473,16 @@ public class NetworkLibrary {
|
|||
if (id == ICustomNetworkLink.INVALID_ID) {
|
||||
myLinks.add(link);
|
||||
} else {
|
||||
synchronized (myLinks) {
|
||||
for (int i = myLinks.size() - 1; i >= 0; --i) {
|
||||
final INetworkLink l = myLinks.get(i);
|
||||
if (l instanceof ICustomNetworkLink &&
|
||||
((ICustomNetworkLink)l).getId() == id) {
|
||||
if (l instanceof ICustomNetworkLink && ((ICustomNetworkLink)l).getId() == id) {
|
||||
myLinks.set(i, link);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
NetworkDatabase.Instance().saveLink(link);
|
||||
invalidateChildren();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue