equal
deleted
inserted
replaced
25 package javax.swing.text; |
25 package javax.swing.text; |
26 |
26 |
27 import java.lang.reflect.*; |
27 import java.lang.reflect.*; |
28 import java.text.*; |
28 import java.text.*; |
29 import java.util.*; |
29 import java.util.*; |
|
30 import sun.reflect.misc.ReflectUtil; |
|
31 import sun.swing.SwingUtilities2; |
30 |
32 |
31 /** |
33 /** |
32 * <code>NumberFormatter</code> subclasses <code>InternationalFormatter</code> |
34 * <code>NumberFormatter</code> subclasses <code>InternationalFormatter</code> |
33 * adding special behavior for numbers. Among the specializations are |
35 * adding special behavior for numbers. Among the specializations are |
34 * (these are only used if the <code>NumberFormatter</code> does not display |
36 * (these are only used if the <code>NumberFormatter</code> does not display |
425 |
427 |
426 if (valueClass == null) { |
428 if (valueClass == null) { |
427 valueClass = value.getClass(); |
429 valueClass = value.getClass(); |
428 } |
430 } |
429 try { |
431 try { |
|
432 ReflectUtil.checkPackageAccess(valueClass); |
|
433 SwingUtilities2.checkAccess(valueClass.getModifiers()); |
430 Constructor cons = valueClass.getConstructor( |
434 Constructor cons = valueClass.getConstructor( |
431 new Class[] { String.class }); |
435 new Class[] { String.class }); |
432 |
|
433 if (cons != null) { |
436 if (cons != null) { |
|
437 SwingUtilities2.checkAccess(cons.getModifiers()); |
434 return cons.newInstance(new Object[]{string}); |
438 return cons.newInstance(new Object[]{string}); |
435 } |
439 } |
436 } catch (Throwable ex) { } |
440 } catch (Throwable ex) { } |
437 } |
441 } |
438 } |
442 } |