bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject [10/50] bval git commit: avoid redundant path copy operations
Date Tue, 16 Oct 2018 17:31:14 GMT
avoid redundant path copy operations


Project: http://git-wip-us.apache.org/repos/asf/bval/repo
Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/1c2482ee
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/1c2482ee
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/1c2482ee

Branch: refs/heads/bv2
Commit: 1c2482eee41a91c3390b967faf955af07d000262
Parents: b4ae2b2
Author: Matt Benson <mbenson@apache.org>
Authored: Fri Mar 30 12:42:14 2018 -0500
Committer: Matt Benson <mbenson@apache.org>
Committed: Tue Oct 16 12:28:20 2018 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java  | 2 +-
 .../src/main/java/org/apache/bval/jsr/job/ValidationJob.java     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bval/blob/1c2482ee/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java b/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
index 4b1d5f9..38cfaaa 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
@@ -100,7 +100,7 @@ public abstract class PropertyD<E extends AnnotatedElement> extends
CascadableCo
         }
         try {
             final Object value = getValue(context.getValue());
-            final PathImpl p = PathImpl.copy(context.getPath());
+            final PathImpl p = context.getPath();
             p.addProperty(getPropertyName());
             return Stream.of(context.child(p, value));
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/bval/blob/1c2482ee/bval-jsr/src/main/java/org/apache/bval/jsr/job/ValidationJob.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/job/ValidationJob.java b/bval-jsr/src/main/java/org/apache/bval/jsr/job/ValidationJob.java
index 7cb3538..6542717 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/job/ValidationJob.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/job/ValidationJob.java
@@ -283,7 +283,7 @@ public abstract class ValidationJob<T> {
             final TraversableResolver traversableResolver = validatorContext.getTraversableResolver();
 
             final Stream<PropertyD<?>> reachableProperties = properties.filter(d
-> {
-                final PathImpl p = PathImpl.copy(context.getPath());
+                final PathImpl p = context.getPath();
                 p.addProperty(d.getPropertyName());
                 try {
                     return traversableResolver.isReachable(context.getValue(), p.removeLeafNode(),
getRootBeanClass(),
@@ -337,7 +337,7 @@ public abstract class ValidationJob<T> {
                 final Object traversableObject =
                     Optional.ofNullable(context.getParent()).map(GraphContext::getValue).orElse(null);
 
-                final PathImpl pathToTraversableObject = PathImpl.copy(context.getPath());
+                final PathImpl pathToTraversableObject = context.getPath();
                 final NodeImpl traversableProperty = pathToTraversableObject.removeLeafNode();
 
                 try {


Mime
View raw message