@@ -79,8 +79,9 @@ private static OleAutomation getAutomationProperty(OleAutomation auto, String na
79
79
Variant varResult = getVariantProperty (auto , name );
80
80
try {
81
81
OleAutomation automation = varResult .getAutomation ();
82
- if (automation != null )
82
+ if (automation != null ) {
83
83
return automation ;
84
+ }
84
85
} finally {
85
86
varResult .dispose ();
86
87
}
@@ -92,8 +93,9 @@ private static OleAutomation getAutomationResult(OleAutomation auto, String comm
92
93
if (varResult != null ) {
93
94
try {
94
95
OleAutomation result = varResult .getAutomation ();
95
- if (result != null )
96
+ if (result != null ) {
96
97
return result ;
98
+ }
97
99
} finally {
98
100
varResult .dispose ();
99
101
}
@@ -106,8 +108,9 @@ private static OleAutomation getAutomationResult(OleAutomation auto, String comm
106
108
if (varResult != null ) {
107
109
try {
108
110
OleAutomation result = varResult .getAutomation ();
109
- if (result != null )
111
+ if (result != null ) {
110
112
return result ;
113
+ }
111
114
} finally {
112
115
varResult .dispose ();
113
116
}
@@ -134,7 +137,9 @@ private static int property(OleAutomation auto, OleAutomation reference, String
134
137
if (ids != null ) {
135
138
return ids [0 ];
136
139
}
137
- if (reference == null ) throw new SWTException (NLS .bind (CompareWin32Messages .WordComparison_4 , name )) ;
140
+ if (reference == null ) {
141
+ throw new SWTException (NLS .bind (CompareWin32Messages .WordComparison_4 , name )) ;
142
+ }
138
143
139
144
// the property was not retrieved at that point, try to get it from the reference object
140
145
ids = reference .getIDsOfNames (new String [] { name });
@@ -146,7 +151,9 @@ private static int property(OleAutomation auto, OleAutomation reference, String
146
151
147
152
private static int property (OleAutomation auto , String name ) {
148
153
int [] ids = auto .getIDsOfNames (new String [] { name });
149
- if (ids == null ) throw new SWTException (NLS .bind (CompareWin32Messages .WordComparison_4 , name ));
154
+ if (ids == null ) {
155
+ throw new SWTException (NLS .bind (CompareWin32Messages .WordComparison_4 , name ));
156
+ }
150
157
return ids [0 ];
151
158
}
152
159
@@ -205,8 +212,9 @@ public void createWorkingCopy(String baseDocument, String revisedDocument, Strin
205
212
OleAutomation activeDocument = getActiveDocument (application );
206
213
try {
207
214
Variant varResult = invoke (activeDocument , document , "SaveAs" , workingCopy ); //$NON-NLS-1$
208
- if (varResult == null )
215
+ if (varResult == null ) {
209
216
throw new SWTException (NLS .bind (CompareWin32Messages .WordComparison_6 , workingCopy ));
217
+ }
210
218
varResult .dispose ();
211
219
} finally {
212
220
closeDocument (activeDocument , document );
@@ -251,8 +259,9 @@ private void closeDocument(OleAutomation document, OleAutomation reference) {
251
259
private void compareDocument (OleAutomation document , String baseDocument , String revisedDocument ) {
252
260
// Compare to the second document: compare = destination.Compare(p1)
253
261
Variant varResult = invoke (document , "Compare" , baseDocument ); //$NON-NLS-1$
254
- if (varResult == null )
262
+ if (varResult == null ) {
255
263
throw new SWTException (NLS .bind (CompareWin32Messages .WordComparison_9 , baseDocument , revisedDocument ));
264
+ }
256
265
varResult .dispose ();
257
266
}
258
267
@@ -361,7 +370,9 @@ private void disposeSite() {
361
370
}
362
371
363
372
public void saveAsDocument (String doc ) {
364
- if (site == null || site .isDisposed ()) return ;
373
+ if (site == null || site .isDisposed ()) {
374
+ return ;
375
+ }
365
376
if (inplace ) {
366
377
site .deactivateInPlaceClient ();
367
378
site .save (new File (doc ), true );
@@ -415,8 +426,9 @@ public boolean isDirty() {
415
426
*/
416
427
protected void initializeWorkbenchMenus (IWorkbenchWindow window ) {
417
428
//If there was an OLE Error or nothing has been created yet
418
- if (frame == null || frame .isDisposed ())
429
+ if (frame == null || frame .isDisposed ()) {
419
430
return ;
431
+ }
420
432
// Get the browser menu bar. If one does not exist then
421
433
// create it.
422
434
Shell shell = frame .getShell ();
@@ -434,13 +446,14 @@ protected void initializeWorkbenchMenus(IWorkbenchWindow window) {
434
446
for (int i = 0 ; i < menuBar .getItemCount (); i ++) {
435
447
MenuItem item = menuBar .getItem (i );
436
448
String id = "" ; //$NON-NLS-1$
437
- if (item .getData () instanceof IMenuManager )
449
+ if (item .getData () instanceof IMenuManager ) {
438
450
id = ((IMenuManager ) item .getData ()).getId ();
439
- if (id .equals (IWorkbenchActionConstants .M_FILE ))
451
+ }
452
+ if (id .equals (IWorkbenchActionConstants .M_FILE )) {
440
453
fileMenu [0 ] = item ;
441
- else if (id .equals (IWorkbenchActionConstants .M_WINDOW ))
454
+ } else if (id .equals (IWorkbenchActionConstants .M_WINDOW )) {
442
455
windowMenu [0 ] = item ;
443
- else {
456
+ } else {
444
457
if (window .isApplicationMenu (id )) {
445
458
containerItems .addElement (item );
446
459
}
0 commit comments