aboutsummaryrefslogtreecommitdiff
path: root/src/patches
diff options
context:
space:
mode:
authormaslovalex <none@none>2018-02-28 14:57:33 +0200
committermaslovalex <none@none>2018-02-28 14:57:33 +0200
commitf7ddded068d3c77bd36d0cc072d0e613f928e8fb (patch)
tree65d77d9e97856ec2b895fa353cfce1bbf73eb7c8 /src/patches
parent713eb57ef9fa89a10a5baf4ce796a471c2c25ca6 (diff)
downloadsnakeyaml-f7ddded068d3c77bd36d0cc072d0e613f928e8fb.tar.gz
fix PropertyUtils.patch for -Pandroid build
Diffstat (limited to 'src/patches')
-rw-r--r--src/patches/android/PropertyUtils.patch53
1 files changed, 5 insertions, 48 deletions
diff --git a/src/patches/android/PropertyUtils.patch b/src/patches/android/PropertyUtils.patch
index b59b5e1d..ba282b3f 100644
--- a/src/patches/android/PropertyUtils.patch
+++ b/src/patches/android/PropertyUtils.patch
@@ -4,7 +4,7 @@
diff --git a/src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java b/src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java
--- a/src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java
+++ b/src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java
-@@ -15,13 +15,7 @@
+@@ -15,12 +15,7 @@
*/
package org.yaml.snakeyaml.introspector;
@@ -13,28 +13,11 @@ diff --git a/src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java b/
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
--import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collection;
import java.util.HashMap;
-@@ -29,15 +23,12 @@
- import java.util.Map;
- import java.util.Set;
- import java.util.TreeSet;
--import java.util.logging.Logger;
-
- import org.yaml.snakeyaml.error.YAMLException;
- import org.yaml.snakeyaml.util.PlatformFeatureDetector;
-
- public class PropertyUtils {
-
-- final private static Logger log = Logger.getLogger(PropertyUtils.class.getPackage().getName());
--
- private final Map<Class<?>, Map<String, Property>> propertiesCache = new HashMap<Class<?>, Map<String, Property>>();
- private final Map<Class<?>, Set<Property>> readableProperties = new HashMap<Class<?>, Set<Property>>();
- private BeanAccess beanAccess = BeanAccess.DEFAULT;
-@@ -68,9 +59,6 @@
+@@ -64,9 +59,6 @@
}
Map<String, Property> properties = new LinkedHashMap<String, Property>();
@@ -44,7 +27,7 @@ diff --git a/src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java b/
for (Class<?> c = type; c != null; c = c.getSuperclass()) {
for (Field field : c.getDeclaredFields()) {
int modifiers = field.getModifiers();
-@@ -80,76 +68,10 @@
+@@ -76,50 +68,10 @@
}
}
}
@@ -86,36 +69,10 @@ diff --git a/src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java b/
return properties;
}
-- private boolean transientMethodChecked;
-- private Method isTransientMethod;
+- private static final String TRANSIENT = "transient";
-
- private boolean isTransient(FeatureDescriptor fd) {
-- if (!transientMethodChecked) {
-- transientMethodChecked = true;
-- try {
-- isTransientMethod = FeatureDescriptor.class.getDeclaredMethod("isTransient");
-- isTransientMethod.setAccessible(true);
-- } catch (NoSuchMethodException e) {
-- log.fine("NoSuchMethod: FeatureDescriptor.isTransient(). Don't check it anymore.");
-- } catch (SecurityException e) {
-- e.printStackTrace();
-- isTransientMethod = null;
-- }
-- }
--
-- if (isTransientMethod != null) {
-- try {
-- return Boolean.TRUE.equals(isTransientMethod.invoke(fd));
-- } catch (IllegalAccessException e) {
-- e.printStackTrace();
-- } catch (IllegalArgumentException e) {
-- e.printStackTrace();
-- } catch (InvocationTargetException e) {
-- e.printStackTrace();
-- }
-- isTransientMethod = null;
-- }
-- return false;
+- return Boolean.TRUE.equals(fd.getValue(TRANSIENT));
- }
-
public Set<Property> getProperties(Class<? extends Object> type) {