| 1 |
Description: Remove usage of sun.reflect.ConstructorAccessor |
| 2 |
Author: Felix Natter <[email protected]> |
| 3 |
Forwarded: no |
| 4 |
Last-Update: 2019-10-09 |
| 5 |
--- a/src/com/bulenkov/iconloader/util/StringFactory.java |
| 6 |
+++ b/src/com/bulenkov/iconloader/util/StringFactory.java |
| 7 |
@@ -16,7 +16,7 @@ |
| 8 |
|
| 9 |
package com.bulenkov.iconloader.util; |
| 10 |
|
| 11 |
|
| 12 |
+//import sun.reflect.ConstructorAccessor; |
| 13 |
|
| 14 |
import java.lang.reflect.Constructor; |
| 15 |
import java.lang.reflect.Method; |
| 16 |
@@ -26,9 +26,10 @@ |
| 17 |
*/ |
| 18 |
public class StringFactory { |
| 19 |
// String(char[], boolean). Works since JDK1.7, earlier JDKs have too slow reflection anyway |
| 20 |
|
| 21 |
+ //private static final ConstructorAccessor ourConstructorAccessor; |
| 22 |
|
| 23 |
static { |
| 24 |
+ /* |
| 25 |
ConstructorAccessor constructorAccessor = null; |
| 26 |
try { |
| 27 |
Constructor<String> newC = String.class.getDeclaredConstructor(char[].class, boolean.class); |
| 28 |
@@ -40,6 +41,7 @@ |
| 29 |
} catch (Exception ignored) { |
| 30 |
} |
| 31 |
ourConstructorAccessor = constructorAccessor; |
| 32 |
+ */ |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
@@ -50,6 +52,7 @@ |
| 37 |
* DO NOT USE THIS METHOD UNLESS YOU ARE TOO DESPERATE |
| 38 |
*/ |
| 39 |
public static String createShared(char[] chars) { |
| 40 |
+ /* |
| 41 |
if (ourConstructorAccessor != null) { |
| 42 |
try { |
| 43 |
return (String) ourConstructorAccessor.newInstance(new Object[]{chars, Boolean.TRUE}); |
| 44 |
@@ -57,6 +60,7 @@ |
| 45 |
throw new RuntimeException(e); |
| 46 |
} |
| 47 |
} |
| 48 |
+ */ |
| 49 |
return new String(chars); |
| 50 |
} |
| 51 |
} |