File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
runtime/tesla/org.eclipse.rcptt.tesla.jface.aspects/src/org/eclipse/rcptt/tesla/jface Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 10
10
*******************************************************************************/
11
11
package org .eclipse .rcptt .tesla .jface ;
12
12
13
- import java .lang .reflect .Field ;
13
+ import static org .eclipse .rcptt .util .ReflectionUtil .getField ;
14
+
14
15
import java .net .URI ;
15
16
import java .net .URISyntaxException ;
16
17
import java .util .regex .Matcher ;
@@ -115,18 +116,14 @@ String extract(ImageDescriptor descriptor) {
115
116
if (descriptor instanceof ExternalProgramImageDescriptor ) {
116
117
if (isWindows ) {
117
118
try {
118
- Program p = (( ExternalProgramImageDescriptor ) descriptor ). program ;
119
+ Program p = (Program ) getField ( descriptor , " program" , true ) ;
119
120
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 );
123
122
if (extension != null && !extension .isEmpty ()) {
124
123
return extension ;
125
124
}
126
125
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 );
130
127
if (iconName != null && !iconName .isEmpty ()) {
131
128
return iconName ;
132
129
}
You can’t perform that action at this time.
0 commit comments