@@ -107,8 +107,9 @@ public Object[] getElements(Object inputElement) {
107107
108108 @ Override
109109 public Object [] getChildren (Object inputElement ) {
110- if (selectedContext == null )
110+ if (selectedContext == null ) {
111111 return EMPTY_RESULT ;
112+ }
112113
113114 if (inputElement == LOCAL_VALUE_NODE ) {
114115 Collection <Object > result = new ArrayList <>();
@@ -118,12 +119,13 @@ public Object[] getChildren(Object inputElement) {
118119 // For context function, we have to compute the value (if possible),
119120 // and display it as a standard value
120121 Map <String , Object > cfValues = new HashMap <>();
121- for (String key : selectedContext .localContextFunction ().keySet ())
122+ for (String key : selectedContext .localContextFunction ().keySet ()) {
122123 try {
123124 cfValues .put (key , selectedContext .get (key ));
124125 } catch (Throwable e ) {
125126 cfValues .put (key , NO_VALUE_COULD_BE_COMPUTED + " (Exception : " + e .getClass ().getName () + ")" ); //$NON-NLS-1$ //$NON-NLS-2$
126127 }
128+ }
127129 result .addAll (cfValues .entrySet ());
128130 return result .toArray ();
129131
@@ -139,8 +141,9 @@ public Object[] getChildren(Object inputElement) {
139141
140142 if (selectedContext .getRawListenerNames () != null ) {
141143 for (String name : selectedContext .getRawListenerNames ()) {
142- if (!localKeys .contains (name ) && !localContextFunctionsKeys .contains (name ))
144+ if (!localKeys .contains (name ) && !localContextFunctionsKeys .contains (name )) {
143145 result .add (name );
146+ }
144147 }
145148 }
146149 return result .isEmpty () ? new String [] { NO_VALUES_FOUND } : result .toArray ();
@@ -164,8 +167,9 @@ public void setDisplayKey(boolean k) {
164167 @ Override
165168 @ SuppressWarnings ("unchecked" )
166169 public String getText (Object element ) {
167- if (selectedContext == null )
170+ if (selectedContext == null ) {
168171 return null ;
172+ }
169173
170174 if (element instanceof Map .Entry ) {
171175 Map .Entry <String , Object > mapEntry = (Map .Entry <String , Object >) element ;
@@ -176,14 +180,16 @@ public String getText(Object element) {
176180 // value in value
177181 String txt = super .getText (element );
178182 if (displayKey ) {
179- if (txt .contains ("#" )) //$NON-NLS-1$
183+ if (txt .contains ("#" )) { //$NON-NLS-1$
180184 return INJECTED_IN_METHOD ;
181- else if (txt .contains ("@" )) //$NON-NLS-1$
185+ } else if (txt .contains ("@" )) { //$NON-NLS-1$
182186 return UPDATED_IN_CLASS ;
183- else
187+ } else {
184188 return INJECTED_IN_FIELD ;
185- } else
189+ }
190+ } else {
186191 return txt ;
192+ }
187193 }
188194
189195 return displayKey ? super .getText (element ) : null ;
@@ -194,8 +200,9 @@ public Color getForeground(Object element) {
194200 // Return magenta color if the value could not be yet computed (for
195201 // context functions)
196202 String s = getText (element );
197- if ((s != null ) && s .startsWith (NO_VALUE_COULD_BE_COMPUTED ))
203+ if ((s != null ) && s .startsWith (NO_VALUE_COULD_BE_COMPUTED )) {
198204 return COLOR_IF_NOT_COMPUTED ;
205+ }
199206
200207 // Return blue color if the string matches the search
201208 return (contextFilter .matchText (s )) ? COLOR_IF_FOUND : null ;
@@ -210,8 +217,9 @@ public Font getFont(Object element) {
210217
211218 @ Override
212219 public Image getImage (Object element ) {
213- if (!displayKey ) // No image in value column, only in key column
220+ if (!displayKey ) { // No image in value column, only in key column
214221 return null ;
222+ }
215223
216224 if (element == LOCAL_VALUE_NODE ) {
217225 return selectedContext == null ? null : imgReg .get (LOCAL_VARIABLE_IMG_KEY );
@@ -225,17 +233,18 @@ public Image getImage(Object element) {
225233 // value in value column
226234 String txt = super .getText (element );
227235
228- if (txt .contains ("#" )) //$NON-NLS-1$
236+ if (txt .contains ("#" )) { //$NON-NLS-1$
229237 return imgReg .get (PUBLIC_METHOD_IMG_KEY );
230- else if (txt .contains ("@" )) //$NON-NLS-1$
238+ } else if (txt .contains ("@" )) { //$NON-NLS-1$
231239 return imgReg .get (CONTEXT_FUNCTION_IMG_KEY );
232- else
240+ } else {
233241 return imgReg .get (PUBLIC_FIELD_IMG_KEY );
242+ }
234243
235244 } else if (element instanceof Map .Entry ) {
236- if (isAContextKeyFunction (element ))
245+ if (isAContextKeyFunction (element )) {
237246 return imgReg .get (CONTEXT_FUNCTION_IMG_KEY );
238- else {
247+ } else {
239248 // It is a value. If it is injected somewhere, display the
240249 // inject image
241250 return hasChildren (element ) ? imgReg .get (INJECT_IMG_KEY ) : imgReg .get (VALUE_IN_CONTEXT_IMG_KEY );
@@ -262,11 +271,12 @@ public String getToolTipText(Object element) {
262271
263272 return Messages .ContextDataProvider_26 + fname ;
264273 } else {
265- if (hasChildren (element ))
274+ if (hasChildren (element )) {
266275 return Messages .ContextDataProvider_27 ;
267- else {
268- if (element instanceof Map .Entry )
276+ } else {
277+ if (element instanceof Map .Entry ) {
269278 return Messages .ContextDataProvider_28 ;
279+ }
270280 }
271281
272282 }
@@ -303,8 +313,9 @@ boolean isAContextKeyFunction(Object element) {
303313
304314 @ Override
305315 public Object getParent (Object element ) {
306- if (element == LOCAL_VALUE_NODE || element == INHERITED_INJECTED_VALUE_NODE )
316+ if (element == LOCAL_VALUE_NODE || element == INHERITED_INJECTED_VALUE_NODE ) {
307317 return null ;
318+ }
308319
309320 // Not computed
310321 return null ;
0 commit comments