@@ -141,36 +141,36 @@ public boolean unregister(Platform platform) {
141
141
142
142
try {
143
143
removed = platforms .remove (platform );
144
- } finally {
145
- platformsLock .writeLock ().unlock ();
146
- }
147
144
148
- if (removed ) {
149
- LOGGER .info ("Unregistering " + platform .getClass ().getCanonicalName () + " from WorldEdit" );
145
+ if (removed ) {
146
+ LOGGER .info ("Unregistering " + platform .getClass ().getCanonicalName () + " from WorldEdit" );
150
147
151
- boolean choosePreferred = false ;
148
+ boolean choosePreferred = false ;
152
149
153
- preferencesLock .writeLock ().lock ();
150
+ preferencesLock .writeLock ().lock ();
154
151
155
- try {
156
- // Check whether this platform was chosen to be the preferred one
157
- // for any capability and be sure to remove it
158
- Iterator <Entry <Capability , Platform >> it = preferences .entrySet ().iterator ();
159
- while (it .hasNext ()) {
160
- Entry <Capability , Platform > entry = it .next ();
161
- if (entry .getValue ().equals (platform )) {
162
- entry .getKey ().uninitialize (this , entry .getValue ());
163
- it .remove ();
164
- choosePreferred = true ; // Have to choose new favorites
152
+ try {
153
+ // Check whether this platform was chosen to be the preferred one
154
+ // for any capability and be sure to remove it
155
+ Iterator <Entry <Capability , Platform >> it = preferences .entrySet ().iterator ();
156
+ while (it .hasNext ()) {
157
+ Entry <Capability , Platform > entry = it .next ();
158
+ if (entry .getValue ().equals (platform )) {
159
+ entry .getKey ().uninitialize (this , entry .getValue ());
160
+ it .remove ();
161
+ choosePreferred = true ; // Have to choose new favorites
162
+ }
165
163
}
164
+ } finally {
165
+ preferencesLock .writeLock ().unlock ();
166
166
}
167
- } finally {
168
- preferencesLock .writeLock ().unlock ();
169
- }
170
167
171
- if (choosePreferred ) {
172
- choosePreferred ();
168
+ if (choosePreferred ) {
169
+ choosePreferred ();
170
+ }
173
171
}
172
+ } finally {
173
+ platformsLock .writeLock ().unlock ();
174
174
}
175
175
176
176
return removed ;
0 commit comments