Repository: incubator-tamaya
Updated Branches:
  refs/heads/master f83f291ab -> dbb9f101f


TAMAYA-236: Added support for inaccessible members.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/dbb9f101
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/dbb9f101
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/dbb9f101

Branch: refs/heads/master
Commit: dbb9f101f7f6e54cdc37cc7044d247a1e69f012c
Parents: b1e9122
Author: anatole <[email protected]>
Authored: Mon Feb 27 00:02:54 2017 +0100
Committer: anatole <[email protected]>
Committed: Mon Feb 27 00:05:00 2017 +0100

----------------------------------------------------------------------
 .../apache/tamaya/core/internal/PropertySourceComparator.java  | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/dbb9f101/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
----------------------------------------------------------------------
diff --git 
a/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
 
b/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
index 50d3653..2793f1f 100644
--- 
a/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
+++ 
b/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
@@ -97,6 +97,9 @@ public class PropertySourceComparator implements 
Comparator<PropertySource>, Ser
         try {
             Method method = propertySource.getClass().getMethod("getOrdinal");
             if(int.class.equals(method.getReturnType())){
+                if(!method.isAccessible()){
+                    method.setAccessible(true);
+                }
                 try {
                     return (int)method.invoke(propertySource);
                 } catch (Exception e) {
@@ -109,6 +112,9 @@ public class PropertySourceComparator implements 
Comparator<PropertySource>, Ser
         try {
             Field field = propertySource.getClass().getField("ORDINAL");
             if(int.class.equals(field.getType()) && 
Modifier.isStatic(field.getModifiers())){
+                if(!field.isAccessible()){
+                    field.setAccessible(true);
+                }
                 try {
                     return (int)field.get(propertySource);
                 } catch (Exception e) {

Reply via email to