@@ -85,14 +85,16 @@ public void validate(IProgressMonitor monitor) {
85
85
private void validateBoolean (Element element , Attr attr ) {
86
86
if (attr != null ) {
87
87
String value = attr .getValue ();
88
- if (!value .equalsIgnoreCase ("true" ) && !value .equalsIgnoreCase ("false" )) //$NON-NLS-1$ //$NON-NLS-2$
88
+ if (!value .equalsIgnoreCase ("true" ) && !value .equalsIgnoreCase ("false" )) { //$NON-NLS-1$ //$NON-NLS-2$
89
89
reportIllegalAttributeValue (element , attr );
90
+ }
90
91
}
91
92
}
92
93
93
94
private void reportIllegalAttributeValue (Element element , Attr attr ) {
94
- if (attr == null || attr .getValue () == null || attr .getName () == null )
95
+ if (attr == null || attr .getValue () == null || attr .getName () == null ) {
95
96
return ;
97
+ }
96
98
String message = NLS .bind (Messages .DSErrorReporter_attrValue , attr
97
99
.getValue (), attr .getName ());
98
100
report (message , getLine (element , attr .getName ()), ERROR ,
@@ -168,8 +170,9 @@ private void reportDuplicateReferenceElementName(Element element,
168
170
String name ) {
169
171
Attr attr = element
170
172
.getAttributeNode (IDSConstants .ATTRIBUTE_REFERENCE_NAME );
171
- if (attr == null || attr .getValue () == null || attr .getName () == null )
173
+ if (attr == null || attr .getValue () == null || attr .getName () == null ) {
172
174
return ;
175
+ }
173
176
String message = NLS .bind (
174
177
Messages .DSErrorReporter_duplicateReferenceName , name );
175
178
report (message ,
@@ -198,9 +201,10 @@ private void validateReferencePolicy(Element element) {
198
201
private void reportIllegalPolicy (Element element , String policy ) {
199
202
String name = element
200
203
.getAttribute (IDSConstants .ATTRIBUTE_REFERENCE_NAME );
201
- if (name == null )
204
+ if (name == null ) {
202
205
name = element
203
206
.getAttribute (IDSConstants .ATTRIBUTE_REFERENCE_INTERFACE );
207
+ }
204
208
String message = NLS .bind (Messages .DSErrorReporter_invalidPolicyValue ,
205
209
name , policy );
206
210
Attr attr = element
@@ -242,8 +246,9 @@ private void reportIllegalCardinality(Element element, String cardinality) {
242
246
cardinality );
243
247
Attr attr = element
244
248
.getAttributeNode (IDSConstants .ATTRIBUTE_REFERENCE_CARDINALITY );
245
- if (attr == null || attr .getValue () == null || attr .getName () == null )
249
+ if (attr == null || attr .getValue () == null || attr .getName () == null ) {
246
250
return ;
251
+ }
247
252
report (message , getLine (element , attr .getName ()), ERROR ,
248
253
PDEMarkerFactory .CAT_OTHER );
249
254
}
@@ -316,8 +321,9 @@ private void validatePropertySpecificTypeBody(String type, String body,
316
321
while (st .hasMoreTokens ()) {
317
322
String token = st .nextToken ();
318
323
token = token .trim ();
319
- if (token .length () > 0 )
324
+ if (token .length () > 0 ) {
320
325
validatePropertySpecificTypeValue (type , token , element );
326
+ }
321
327
}
322
328
}
323
329
@@ -395,8 +401,9 @@ private void validatePropertyAttrValueAndBody(Element element,
395
401
String propertyType = property .getPropertyType ();
396
402
if (propertyType == null
397
403
|| propertyType
398
- .equals (IDSConstants .VALUE_PROPERTY_TYPE_STRING ))
404
+ .equals (IDSConstants .VALUE_PROPERTY_TYPE_STRING )) {
399
405
return ; // It's OK for a property of type "String" to have a
406
+ }
400
407
// value of "".
401
408
if (property .getPropertyValue ().equals ("" )) { //$NON-NLS-1$
402
409
String propertyName = property .getPropertyName ();
@@ -601,14 +608,16 @@ private void reportInvalidImmediate(Element element) {
601
608
private void validateEmpty (Element element , Attr attr ) {
602
609
if (attr != null ) {
603
610
String value = attr .getValue ();
604
- if (value .equalsIgnoreCase ("" )) //$NON-NLS-1$
611
+ if (value .equalsIgnoreCase ("" )) { //$NON-NLS-1$
605
612
reportIllegalEmptyAttributeValue (element , attr );
613
+ }
606
614
}
607
615
}
608
616
609
617
private void reportIllegalEmptyAttributeValue (Element element , Attr attr ) {
610
- if (attr == null || attr .getValue () == null || attr .getName () == null )
618
+ if (attr == null || attr .getValue () == null || attr .getName () == null ) {
611
619
return ;
620
+ }
612
621
String message = NLS .bind (Messages .DSErrorReporter_emptyAttrValue , attr
613
622
.getName ());
614
623
report (message , getLine (element , attr .getName ()), ERROR ,
0 commit comments