You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2022/04/09 05:42:01 UTC

[isis] branch master updated (9295248cb4 -> a8a0cea073)

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


    from 9295248cb4 ISIS-2997: recreate site index
     new 5b10ede1bd ISIS-2445: remove duplicated maven pom entry
     new 6db5375c10 ISIS-2445: adds missing pom variable
     new a8a0cea073 ISIS-2445: commons: remove deprecated reflective flag check

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../isis/commons/internal/reflection/_Reflect.java | 34 ++++++++++++++--------
 .../isis/core/metamodel/methods/MethodFinder.java  |  2 +-
 core/pom.xml                                       |  3 +-
 incubator/viewers/vaadin/model/pom.xml             |  7 -----
 4 files changed, 25 insertions(+), 21 deletions(-)


[isis] 01/03: ISIS-2445: remove duplicated maven pom entry

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 5b10ede1bd7b037f02ff5855fe09244a3de0a46f
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sat Apr 9 07:19:33 2022 +0200

    ISIS-2445: remove duplicated maven pom entry
---
 incubator/viewers/vaadin/model/pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/incubator/viewers/vaadin/model/pom.xml b/incubator/viewers/vaadin/model/pom.xml
index 6d75dfb2b7..752d544338 100644
--- a/incubator/viewers/vaadin/model/pom.xml
+++ b/incubator/viewers/vaadin/model/pom.xml
@@ -138,11 +138,11 @@
 			<artifactId>swagger-models</artifactId>
 			<version>2.1.12</version>
 		</dependency>
-		<dependency>
-		    <groupId>io.swagger.core.v3</groupId>
-		    <artifactId>swagger-core</artifactId>
-		    <version>2.1.12</version>
-		</dependency>
+<!-- 		<dependency> -->
+<!-- 		    <groupId>io.swagger.core.v3</groupId> -->
+<!-- 		    <artifactId>swagger-core</artifactId> -->
+<!-- 		    <version>2.1.12</version> -->
+<!-- 		</dependency> -->
 				
 
 


[isis] 02/03: ISIS-2445: adds missing pom variable

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 6db5375c108fa14b253824529371ca6096c4126c
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sat Apr 9 07:19:58 2022 +0200

    ISIS-2445: adds missing pom variable
---
 core/pom.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/pom.xml b/core/pom.xml
index 08df4cddff..4e74b3025e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -149,6 +149,7 @@
 
 		<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
 		<maven-release-plugin.version>2.5.3</maven-release-plugin.version>		<!-- See https://nodejs.org/en/download/ for latest node and npm (lts) versions -->
+		<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
 
 		<!-- See https://nodejs.org/en/download/ for latest node and npm (lts)
 			versions -->
@@ -474,7 +475,7 @@
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-war-plugin</artifactId>
-					<version>${maven-war-plugin}</version>
+					<version>${maven-war-plugin.version}</version>
 					<configuration>
 						<warSourceExcludes>
 							WEB-INF/lib/*.jar


[isis] 03/03: ISIS-2445: commons: remove deprecated reflective flag check

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit a8a0cea073ed289fae021e2cc4a7bd6c0727d313
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sat Apr 9 07:41:54 2022 +0200

    ISIS-2445: commons: remove deprecated reflective flag check
---
 .../isis/commons/internal/reflection/_Reflect.java | 34 ++++++++++++++--------
 .../isis/core/metamodel/methods/MethodFinder.java  |  2 +-
 incubator/viewers/vaadin/model/pom.xml             |  7 -----
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Reflect.java b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Reflect.java
index bc19b81fc8..e6688199ea 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Reflect.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Reflect.java
@@ -25,6 +25,7 @@ import java.beans.PropertyDescriptor;
 import java.lang.annotation.Annotation;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
+import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Field;
@@ -148,14 +149,23 @@ public final class _Reflect {
         return a.getName().compareTo(b.getName());
     }
 
+    /**
+     * Whether the caller can access this reflected object.
+     * (method, field or constructor)
+     */
+    public static boolean canAccess(final @Nullable AccessibleObject member) {
+        return member != null
+                && member.canAccess(member);
+    }
 
     /**
-     * Returns whether a {@link Member} is accessible.
-     * @param m Member to check
-     * @return {@code true} if <code>m</code> is accessible
+     * Returns whether a {@link Member} is public and not synthetic (can be accessed).
+     * @param member Member to check
      */
-    public static boolean isAccessible(final Member m) {
-        return m != null && Modifier.isPublic(m.getModifiers()) && !m.isSynthetic();
+    public static boolean isPublicNonSynthetic(final @Nullable Member member) {
+        return member != null
+                && Modifier.isPublic(member.getModifiers())
+                && !member.isSynthetic();
     }
 
     /**
@@ -375,7 +385,7 @@ public final class _Reflect {
             final boolean searchSupers,
             final boolean ignoreAccess) {
 
-        if (!ignoreAccess && !isAccessible(method)) {
+        if (!ignoreAccess && !isPublicNonSynthetic(method)) {
             return null;
         }
 
@@ -425,7 +435,7 @@ public final class _Reflect {
     // -- METHOD/FIELD HANDLES
 
     public static MethodHandle handleOf(final Method method) throws IllegalAccessException {
-        if(!method.isAccessible()) { // java9+ to replace by canAccess
+        if(!canAccess(method)) {
             /*sonar-ignore-on*/
             method.setAccessible(true);
             MethodHandle mh = MethodHandles.publicLookup().unreflect(method);
@@ -437,7 +447,7 @@ public final class _Reflect {
     }
 
     public static MethodHandle handleOfGetterOn(final Field field) throws IllegalAccessException {
-        if(!field.isAccessible()) { // java9+ to replace by canAccess
+        if(!canAccess(field)) {
             /*sonar-ignore-on*/
             field.setAccessible(true);
             MethodHandle mh = MethodHandles.lookup().unreflectGetter(field);
@@ -509,7 +519,7 @@ public final class _Reflect {
             final @NonNull Object target) throws IllegalArgumentException, IllegalAccessException {
 
         /*sonar-ignore-on*/
-        if(field.isAccessible()) {
+        if(canAccess(field)) {
             return field.get(target);
         }
         try {
@@ -527,7 +537,7 @@ public final class _Reflect {
             final Object fieldValue) throws IllegalArgumentException, IllegalAccessException {
 
         /*sonar-ignore-on*/
-        if(field.isAccessible()) {
+        if(canAccess(field)) {
             field.set(target, fieldValue);
             return;
         }
@@ -548,7 +558,7 @@ public final class _Reflect {
 
         /*sonar-ignore-on*/
         return Try.call(()->{
-            if(method.isAccessible()) {
+            if(canAccess(method)) {
                 return method.invoke(target, args);
             }
             try {
@@ -567,7 +577,7 @@ public final class _Reflect {
 
         /*sonar-ignore-on*/
         return Try.call(()->{
-            if(constructor.isAccessible()) {
+            if(canAccess(constructor)) {
                 return constructor.newInstance(args);
             }
             try {
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/methods/MethodFinder.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/methods/MethodFinder.java
index 95e98447fd..9203cf2153 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/methods/MethodFinder.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/methods/MethodFinder.java
@@ -250,7 +250,7 @@ public class MethodFinder {
             final Class<? extends Annotation> annotationType,
             final Can<Class<? extends Annotation>> conflictingAnnotations) {
 
-        return _Reflect.isAccessible(method)
+        return _Reflect.isPublicNonSynthetic(method)
                 ? true
                 : havingAnnotation(method, annotationType, conflictingAnnotations);
     }
diff --git a/incubator/viewers/vaadin/model/pom.xml b/incubator/viewers/vaadin/model/pom.xml
index 752d544338..bb516b42ec 100644
--- a/incubator/viewers/vaadin/model/pom.xml
+++ b/incubator/viewers/vaadin/model/pom.xml
@@ -138,13 +138,6 @@
 			<artifactId>swagger-models</artifactId>
 			<version>2.1.12</version>
 		</dependency>
-<!-- 		<dependency> -->
-<!-- 		    <groupId>io.swagger.core.v3</groupId> -->
-<!-- 		    <artifactId>swagger-core</artifactId> -->
-<!-- 		    <version>2.1.12</version> -->
-<!-- 		</dependency> -->
-				
-
 
 		<!-- TEST DEPENDENCIES -->
 		<dependency>