File tree Expand file tree Collapse file tree
runtime/tesla/org.eclipse.rcptt.tesla.jface.aspects/src/org/eclipse/rcptt/tesla/jface Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 *******************************************************************************/
1111package org .eclipse .rcptt .tesla .jface ;
1212
13- import java .lang .reflect .Field ;
13+ import static org .eclipse .rcptt .util .ReflectionUtil .getField ;
14+
1415import java .net .URI ;
1516import java .net .URISyntaxException ;
1617import java .util .regex .Matcher ;
@@ -115,18 +116,14 @@ String extract(ImageDescriptor descriptor) {
115116 if (descriptor instanceof ExternalProgramImageDescriptor ) {
116117 if (isWindows ) {
117118 try {
118- Program p = (( ExternalProgramImageDescriptor ) descriptor ). program ;
119+ Program p = (Program ) getField ( descriptor , " program" , true ) ;
119120
120- Field extensionField = p .getClass ().getDeclaredField ("extension" );
121- extensionField .setAccessible (true );
122- String extension = (String ) extensionField .get (p );
121+ String extension = (String ) getField (p , "extension" , true );
123122 if (extension != null && !extension .isEmpty ()) {
124123 return extension ;
125124 }
126125
127- Field iconNameField = p .getClass ().getDeclaredField ("iconName" );
128- iconNameField .setAccessible (true );
129- String iconName = (String ) iconNameField .get (p );
126+ String iconName = (String ) getField (p , "iconName" , true );
130127 if (iconName != null && !iconName .isEmpty ()) {
131128 return iconName ;
132129 }
You can’t perform that action at this time.
0 commit comments