[GitHub] [commons-geometry] agoss94 commented on a diff in pull request #218: Refactor hull

2023-07-25 Thread via GitHub


agoss94 commented on code in PR #218:
URL: https://github.com/apache/commons-geometry/pull/218#discussion_r1274404792


##
commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/hull/ConvexHull2D.java:
##
@@ -0,0 +1,475 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.geometry.euclidean.twod.hull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.geometry.core.ConvexHull;
+import org.apache.commons.geometry.euclidean.EuclideanCollections;
+import org.apache.commons.geometry.euclidean.twod.ConvexArea;
+import org.apache.commons.geometry.euclidean.twod.Lines;
+import org.apache.commons.geometry.euclidean.twod.Vector2D;
+import org.apache.commons.geometry.euclidean.twod.path.LinePath;
+import org.apache.commons.numbers.core.Precision;
+
+/**
+ * This class represents a convex hull in two-dimensional Euclidean space.
+ */
+public final class ConvexHull2D implements ConvexHull {
+
+/** Vertices for the convex hull, in order. */
+private final List vertices;
+
+/** Polyline path for the convex hull. */
+private final LinePath path;
+
+/** Simple constructor; no validation is performed.
+ * @param vertices the vertices of the convex hull; callers are 
responsible for ensuring that
+ *  the given vertices are in order, unique, and define a convex hull.
+ * @param precision precision context used to compare floating point 
numbers
+ */
+ConvexHull2D(final Collection vertices, final 
Precision.DoubleEquivalence precision) {
+this.vertices = Collections.unmodifiableList(new 
ArrayList<>(vertices));
+this.path = buildHullPath(vertices, precision);
+}
+
+/** {@inheritDoc} */
+@Override
+public List getVertices() {
+return vertices;
+}
+
+/** Get a path defining the convex hull. The path will contain
+ * 
+ *  zero segments if the hull consists of only a single point,
+ *  one segment if the hull consists of two points,
+ *  three or more segments defining a closed loop if the hull 
consists of more than
+ *  two non-collinear points.
+ * 
+ * @return polyline path defining the convex hull
+ */
+public LinePath getPath() {
+return path;
+}
+
+/** {@inheritDoc} */
+@Override
+public ConvexArea getRegion() {
+return path.isClosed() ?
+ConvexArea.convexPolygonFromPath(path) :
+null;
+}
+
+/** {@inheritDoc} */
+@Override
+public String toString() {
+final StringBuilder sb = new StringBuilder();
+sb.append(getClass().getSimpleName())
+.append("[vertices= ")
+.append(getVertices())
+.append(']');
+
+return sb.toString();
+}
+
+/** Build a polyline representing the path for a convex hull.
+ * @param vertices convex hull vertices
+ * @param precision precision context used to compare floating point values
+ * @return path for the convex hull defined by the given vertices
+ */
+private static LinePath buildHullPath(final Collection vertices,
+final Precision.DoubleEquivalence precision) {
+if (vertices.size() < 2) {
+return LinePath.empty();
+}
+
+final boolean closeLoop = vertices.size() > 2;
+
+return LinePath.builder(precision)
+.appendVertices(vertices)
+.build(closeLoop);
+}
+
+/** Class used to build convex hulls. The builder is based on the 
Akl-Toussaint
+ * heuristic to construct the hull. The heuristic is based on the idea of a
+ * convex quadrilateral, which is formed by four points with the lowest and
+ * highest x / y coordinates. Any point that lies inside this 
quadrilateral can
+ * not be part of the convex hull and can thus be safely discarded before
+ * generating the convex hull itself.
+ * 
+ * The complexity of the operation is O(n), and may greatly improve the 
time it
+ * takes to construct the convex hull 

[GitHub] [commons-io] jsoref commented on a diff in pull request #468: Spelling

2023-07-25 Thread via GitHub


jsoref commented on code in PR #468:
URL: https://github.com/apache/commons-io/pull/468#discussion_r1274370960


##
src/test/java/org/apache/commons/io/file/PathUtilsContentEqualsTest.java:
##
@@ -44,7 +44,7 @@ private String getName() {
 
 @Test
 public void testDirectoryAndFileContentEquals() throws Exception {
-// Non-existent files
+// Nonexistent files

Review Comment:
   Sorry, how would you do that? consider 
https://github.com/apache/commons-io/compare/318645fd97d6c31cfbce6f5a7fa83d5350e87708..810cf30344db9d3e5fffc8ea074d50fae136e558
   
   
https://github.com/apache/commons-io/blob/810cf30344db9d3e5fffc8ea074d50fae136e558/src/test/java/org/apache/commons/io/file/PathUtilsTest.java#L102



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-io] garydgregory commented on a diff in pull request #468: Spelling

2023-07-25 Thread via GitHub


garydgregory commented on code in PR #468:
URL: https://github.com/apache/commons-io/pull/468#discussion_r1274266890


##
src/test/java/org/apache/commons/io/file/PathUtilsContentEqualsTest.java:
##
@@ -44,7 +44,7 @@ private String getName() {
 
 @Test
 public void testDirectoryAndFileContentEquals() throws Exception {
-// Non-existent files
+// Nonexistent files

Review Comment:
   Thank you. I'd rather normalize that word on the hyphenated variant.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-io] jsoref commented on a diff in pull request #468: Spelling

2023-07-25 Thread via GitHub


jsoref commented on code in PR #468:
URL: https://github.com/apache/commons-io/pull/468#discussion_r1274263232


##
src/test/java/org/apache/commons/io/file/PathUtilsContentEqualsTest.java:
##
@@ -44,7 +44,7 @@ private String getName() {
 
 @Test
 public void testDirectoryAndFileContentEquals() throws Exception {
-// Non-existent files
+// Nonexistent files

Review Comment:
   I've dropped those changes, but I've thrown in some more `existant` -> 
`existent` changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-io] jsoref commented on a diff in pull request #468: Spelling

2023-07-25 Thread via GitHub


jsoref commented on code in PR #468:
URL: https://github.com/apache/commons-io/pull/468#discussion_r1274249061


##
src/test/java/org/apache/commons/io/file/PathUtilsContentEqualsTest.java:
##
@@ -44,7 +44,7 @@ private String getName() {
 
 @Test
 public void testDirectoryAndFileContentEquals() throws Exception {
-// Non-existent files
+// Nonexistent files

Review Comment:
   Sure, but do note that you're already using it in 
[‎src/main/java/org/apache/commons/io/FileUtils.java](https://github.com/apache/commons-io/blob/06fde31494c279ad940149e1a3d4944040c73c0d/src/main/java/org/apache/commons/io/FileUtils.java#L1091)
 per 
https://github.com/search?q=repo%3Aapache%2Fcommons-io%20nonexistent=code



##
src/test/java/org/apache/commons/io/file/PathUtilsContentEqualsTest.java:
##
@@ -44,7 +44,7 @@ private String getName() {
 
 @Test
 public void testDirectoryAndFileContentEquals() throws Exception {
-// Non-existent files
+// Nonexistent files

Review Comment:
   Sure, but do note that you're already using it in 
[‎src/main/java/org/apache/commons/io/FileUtils.java](https://github.com/apache/commons-io/blob/06fde31494c279ad940149e1a3d4944040c73c0d/src/main/java/org/apache/commons/io/FileUtils.java#L1091)
 per 
https://github.com/search?q=repo%3Aapache%2Fcommons-io%20nonexistent=code



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-io] garydgregory commented on a diff in pull request #468: Spelling

2023-07-25 Thread via GitHub


garydgregory commented on code in PR #468:
URL: https://github.com/apache/commons-io/pull/468#discussion_r1274228815


##
src/test/java/org/apache/commons/io/file/PathUtilsContentEqualsTest.java:
##
@@ -44,7 +44,7 @@ private String getName() {
 
 @Test
 public void testDirectoryAndFileContentEquals() throws Exception {
-// Non-existent files
+// Nonexistent files

Review Comment:
   Let's not change this please, this is not a spelling error, both spellings 
are acceptable, one is clearer due to the hyphen.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Commented] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Bernd Eckenfels (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747216#comment-17747216
 ] 

Bernd Eckenfels commented on VFS-840:
-

I would suggest to discuss usage questions on the commons-user mailing list. 
The rules are annoying but simple:
- filenames have to be url encoded in most API (exception like getChild)
- fsm.resolveFile needs a fully qualified name or a base name or a base url

In you example I would try "/D:" as an absolute filename (I am not completely 
sure bout the semantics, as I normally just use the before mentioned convenient 
method to convert java.io.File into FileObject).

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}
> {color:#ff} at 
> com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}
> {color:#ff}Caused by: 
> {color}+java.net.URISyntaxException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}
> {color:#ff} ... 3 more{color}
>  
> Following is the code to reproduce the issue.
> {color:#7f0055}try{color}{color:#00} {{color}
> {color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
> {color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}
> {color:#00} FileSystemManager 
> {color}{color:#6a3e3e}fsManager{color}{color:#00} = 
> VFS.{color}{color:#00}getManager{color}{color:#00}();{color}
> {color:#00} FileObject 
> {color}{color:#6a3e3e}fileObject{color}{color:#00} = 
> {color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}fileName{color}{color:#00});{color}
> {color:#00} 
> System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}
> {color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
> {color}{color:#6a3e3e}ex{color}{color:#00}) {{color}
> {color:#00} 
> {color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}
> {color:#00} }{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [commons-io] jsoref commented on a diff in pull request #468: Spelling

2023-07-25 Thread via GitHub


jsoref commented on code in PR #468:
URL: https://github.com/apache/commons-io/pull/468#discussion_r1274202266


##
src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java:
##
@@ -410,11 +410,11 @@ public void test_reset_Exception() throws IOException {
 @Test
 public void test_reset_scenario1() throws IOException {
 final byte[] input = "12345678900".getBytes();
-final BufferedInputStream buffis = new BufferedInputStream(new 
ByteArrayInputStream(input));
-buffis.read();
-buffis.mark(5);
-buffis.skip(5);
-buffis.reset();
+final BufferedInputStream bufin = new BufferedInputStream(new 
ByteArrayInputStream(input));
+bufin.read();
+bufin.mark(5);
+bufin.skip(5);
+bufin.reset();

Review Comment:
   This file has a whole bunch of different local variables used for `new 
BufferedInputStream(...)`. There does not appear to be a remotely good reason 
for so many different ways to spell the same variable name in a single file, 
but only this one bothered me enough to change it.
   
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L94
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L112
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L143
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L162
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L172
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L216
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L230
   -- this is in the same scope as the previous one, but the previous one is 
effectively dead, so there's no reason not to recycle it as the next two sites 
do...
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L281
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L302
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L347
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L390
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L428
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L441
   
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L461



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-io] jsoref opened a new pull request, #468: Spelling

2023-07-25 Thread via GitHub


jsoref opened a new pull request, #468:
URL: https://github.com/apache/commons-io/pull/468

   https://issues.apache.org/jira/browse/IO-806
   
   This PR corrects misspellings identified by the [check-spelling 
action](https://github.com/marketplace/actions/check-spelling).
   
   The misspellings have been reported at 
https://github.com/jsoref/commons-io/actions/runs/5662536320#summary-15342653080
   
   The action reports that the changes in this PR would make it happy: 
https://github.com/jsoref/commons-io/actions/runs/5662536436
   
   ---
   
   I can fix the summaries to match the requested style, but at the moment I'm 
all out of available jobs and I'm waiting for the current jobs to finish.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Created] (IO-806) Spelling fixes

2023-07-25 Thread Josh Soref (Jira)
Josh Soref created IO-806:
-

 Summary: Spelling fixes
 Key: IO-806
 URL: https://issues.apache.org/jira/browse/IO-806
 Project: Commons IO
  Issue Type: Task
Reporter: Josh Soref


Misspellings identified by the [check-spelling 
action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at 
https://github.com/jsoref/commons-io/actions/runs/5662536320#summary-15342653080



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FILEUPLOAD-309) Release version 2.0.0

2023-07-25 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/FILEUPLOAD-309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747156#comment-17747156
 ] 

Gary D. Gregory commented on FILEUPLOAD-309:


Please see version 2.0.0-M1 in Maven Central and the download servers.

> Release version 2.0.0
> -
>
> Key: FILEUPLOAD-309
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-309
> Project: Commons FileUpload
>  Issue Type: Wish
>Reporter: Thiago Henrique Hupner
>Assignee: Gary D. Gregory
>Priority: Major
>
> At Piranha, we've migrated to use the new Jakarta namespace.
> One of our dependencies is the Commons File Upload, but the latest version 
> available is 1.4.
> Looking around at the source code, I've found that the code is already 
> prepared for the new Jakarta namespace.
> So, I want to know if there's a plan to release a new version soon. Or at 
> least a 2.0.0 milestone.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (FILEUPLOAD-345) Support for Servlet 5

2023-07-25 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/FILEUPLOAD-345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved FILEUPLOAD-345.

Fix Version/s: 2.0.0-M1
   Resolution: Fixed

Available in 2.0.0-M1

> Support for Servlet 5
> -
>
> Key: FILEUPLOAD-345
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-345
> Project: Commons FileUpload
>  Issue Type: Wish
>Reporter: Artur
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> FileUpload depends on Servlet 3 API, e.g. in 
> [https://github.com/apache/commons-fileupload/blob/master/src/main/java/org/apache/commons/fileupload2/servlet/ServletFileUpload.java#L23]
>  
> There should be a new major version that depends on Servlet 5 API instead so 
> that it can be used e.g. together with Spring 6 
> https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (FILEUPLOAD-342) FileUploadBase should not import HttpServletRequest

2023-07-25 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/FILEUPLOAD-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved FILEUPLOAD-342.

Fix Version/s: 2.0.0-M1
   Resolution: Fixed

Available in 2.0.0-M1

> FileUploadBase should not import HttpServletRequest
> ---
>
> Key: FILEUPLOAD-342
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-342
> Project: Commons FileUpload
>  Issue Type: Improvement
>Affects Versions: 2.0.0
>Reporter: Martin Tzvetanov Grigorov
>Priority: Major
> Fix For: 2.0.0-M1
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> FileUploadBase has few deprecated methods which use 
> 'javax.servlet.http.HttpServletRequest`.
>  
> This causes class loading problem when using the new Jakarta based 
> `JakSrvltFileUpload.isMultipartContent(jakartaRequest)` because 
> javax.servlet.** in not on the classpath.
>  
> Would it be OK to remove the deprecated methods in 2.0 ?
> The applications should use 
> org.apache.commons.fileupload2.servlet.ServletFileUpload#isMultipartContent() 
> or 
> org.apache.commons.fileupload2.jaksrvlt.JakSrvltFileUpload#isMultipartContent()
>  instead.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (FILEUPLOAD-349) Update javax libs to Jakarta libs in commons-fileupload jar

2023-07-25 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/FILEUPLOAD-349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved FILEUPLOAD-349.

Fix Version/s: 2.0.0-M1
   Resolution: Fixed

Available in 2.0.0-M1

> Update javax libs to Jakarta libs in commons-fileupload jar
> ---
>
> Key: FILEUPLOAD-349
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-349
> Project: Commons FileUpload
>  Issue Type: New Feature
>Affects Versions: 1.5
>Reporter: Dhoka Pramod
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> ServletFileUpload class is using javax.servlet.http.HttpServletRequest. 
> The latest Jakarta Jars are not compaitable with the latest 
> commons-fileupload-1.5.jar
>  
> Requesting commons-fileupload jar which doesnt have references for javax.*.*



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [commons-geometry] aherbert commented on a diff in pull request #218: Refactor hull

2023-07-25 Thread via GitHub


aherbert commented on code in PR #218:
URL: https://github.com/apache/commons-geometry/pull/218#discussion_r1274042831


##
commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/hull/ConvexHull2D.java:
##
@@ -0,0 +1,475 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.geometry.euclidean.twod.hull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.geometry.core.ConvexHull;
+import org.apache.commons.geometry.euclidean.EuclideanCollections;
+import org.apache.commons.geometry.euclidean.twod.ConvexArea;
+import org.apache.commons.geometry.euclidean.twod.Lines;
+import org.apache.commons.geometry.euclidean.twod.Vector2D;
+import org.apache.commons.geometry.euclidean.twod.path.LinePath;
+import org.apache.commons.numbers.core.Precision;
+
+/**
+ * This class represents a convex hull in two-dimensional Euclidean space.
+ */
+public final class ConvexHull2D implements ConvexHull {
+
+/** Vertices for the convex hull, in order. */
+private final List vertices;
+
+/** Polyline path for the convex hull. */
+private final LinePath path;
+
+/** Simple constructor; no validation is performed.
+ * @param vertices the vertices of the convex hull; callers are 
responsible for ensuring that
+ *  the given vertices are in order, unique, and define a convex hull.
+ * @param precision precision context used to compare floating point 
numbers
+ */
+ConvexHull2D(final Collection vertices, final 
Precision.DoubleEquivalence precision) {
+this.vertices = Collections.unmodifiableList(new 
ArrayList<>(vertices));
+this.path = buildHullPath(vertices, precision);
+}
+
+/** {@inheritDoc} */
+@Override
+public List getVertices() {
+return vertices;
+}
+
+/** Get a path defining the convex hull. The path will contain
+ * 
+ *  zero segments if the hull consists of only a single point,
+ *  one segment if the hull consists of two points,
+ *  three or more segments defining a closed loop if the hull 
consists of more than
+ *  two non-collinear points.
+ * 
+ * @return polyline path defining the convex hull
+ */
+public LinePath getPath() {
+return path;
+}
+
+/** {@inheritDoc} */
+@Override
+public ConvexArea getRegion() {
+return path.isClosed() ?
+ConvexArea.convexPolygonFromPath(path) :
+null;
+}
+
+/** {@inheritDoc} */
+@Override
+public String toString() {
+final StringBuilder sb = new StringBuilder();
+sb.append(getClass().getSimpleName())
+.append("[vertices= ")
+.append(getVertices())
+.append(']');
+
+return sb.toString();
+}
+
+/** Build a polyline representing the path for a convex hull.
+ * @param vertices convex hull vertices
+ * @param precision precision context used to compare floating point values
+ * @return path for the convex hull defined by the given vertices
+ */
+private static LinePath buildHullPath(final Collection vertices,
+final Precision.DoubleEquivalence precision) {
+if (vertices.size() < 2) {
+return LinePath.empty();
+}
+
+final boolean closeLoop = vertices.size() > 2;
+
+return LinePath.builder(precision)
+.appendVertices(vertices)
+.build(closeLoop);
+}
+
+/** Class used to build convex hulls. The builder is based on the 
Akl-Toussaint
+ * heuristic to construct the hull. The heuristic is based on the idea of a
+ * convex quadrilateral, which is formed by four points with the lowest and
+ * highest x / y coordinates. Any point that lies inside this 
quadrilateral can
+ * not be part of the convex hull and can thus be safely discarded before
+ * generating the convex hull itself.
+ * 
+ * The complexity of the operation is O(n), and may greatly improve the 
time it
+ * takes to construct the convex hull 

[jira] [Comment Edited] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Usman Ashraf Bajwah (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747078#comment-17747078
 ] 

Usman Ashraf Bajwah edited comment on VFS-840 at 7/25/23 5:35 PM:
--

Not understanding the proposed solution. How we can create cwd ? and in my 
application i am not specifying base url seprately and its working fine apart 
from these special characters. There should be a simple solution for this 
problem.

used this code but still its erroring out.
{color:#7f0055}try{color}{color:#00} {{color}

{color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
{color}{color:#2a00ff}"citrus[1].jpg"{color}{color:#00};{color}

{color:#00} String 
{color}{color:#6a3e3e}encodedFileName{color}{color:#00} = 
URLEncoder.{color}{color:#00}encode{color}{color:#00}({color}{color:#6a3e3e}fileName{color}{color:#00},{color}{color:#2a00ff}"UTF-8"{color}{color:#00});{color}

{color:#00} FileSystemManager 
{color}{color:#6a3e3e}fsManager{color}{color:#00} = 
VFS.{color}{color:#00}getManager{color}{color:#00}();{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}baseObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#2a00ff}"D:\
 \"{color}{color:#00}); – No spaces just to avoid JIRA's styling
{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}fileObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}baseObject{color}{color:#00},
 {color}{color:#6a3e3e}encodedFileName{color}{color:#00});{color}

{color:#00} 
System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}

{color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
{color}{color:#6a3e3e}ex{color}{color:#00}) {{color}

{color:#00} 
{color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}

{color:#00} }{color}


was (Author: JIRAUSER301519):
Not understanding the proposed solution. How we can create cwd ? and in my 
application i am not specifying base url seprately and its working fine apart 
from these special characters. There should be a simple solution for this 
problem.

used this code but still its erroring out.
{color:#7f0055}try{color}{color:#00} {{color}

{color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
{color}{color:#2a00ff}"citrus[1].jpg"{color}{color:#00};{color}

{color:#00} String 
{color}{color:#6a3e3e}encodedFileName{color}{color:#00} = 
URLEncoder.{color}{color:#00}encode{color}{color:#00}({color}{color:#6a3e3e}fileName{color}{color:#00},{color}{color:#2a00ff}"UTF-8"{color}{color:#00});{color}

{color:#00} FileSystemManager 
{color}{color:#6a3e3e}fsManager{color}{color:#00} = 
VFS.{color}{color:#00}getManager{color}{color:#00}();{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}baseObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#2a00ff}"D:\\"{color}{color:#00});{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}fileObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}baseObject{color}{color:#00},
 {color}{color:#6a3e3e}encodedFileName{color}{color:#00});{color}

{color:#00} 
System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}

{color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
{color}{color:#6a3e3e}ex{color}{color:#00}) {{color}

{color:#00} 
{color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}

{color:#00} }{color}

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> 

[jira] [Comment Edited] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Usman Ashraf Bajwah (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747078#comment-17747078
 ] 

Usman Ashraf Bajwah edited comment on VFS-840 at 7/25/23 5:34 PM:
--

Not understanding the proposed solution. How we can create cwd ? and in my 
application i am not specifying base url seprately and its working fine apart 
from these special characters. There should be a simple solution for this 
problem.

used this code but still its erroring out.
{color:#7f0055}try{color}{color:#00} {{color}

{color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
{color}{color:#2a00ff}"citrus[1].jpg"{color}{color:#00};{color}

{color:#00} String 
{color}{color:#6a3e3e}encodedFileName{color}{color:#00} = 
URLEncoder.{color}{color:#00}encode{color}{color:#00}({color}{color:#6a3e3e}fileName{color}{color:#00},{color}{color:#2a00ff}"UTF-8"{color}{color:#00});{color}

{color:#00} FileSystemManager 
{color}{color:#6a3e3e}fsManager{color}{color:#00} = 
VFS.{color}{color:#00}getManager{color}{color:#00}();{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}baseObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#2a00ff}"D:\\"{color}{color:#00});{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}fileObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}baseObject{color}{color:#00},
 {color}{color:#6a3e3e}encodedFileName{color}{color:#00});{color}

{color:#00} 
System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}

{color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
{color}{color:#6a3e3e}ex{color}{color:#00}) {{color}

{color:#00} 
{color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}

{color:#00} }{color}


was (Author: JIRAUSER301519):
Not understanding the proposed solution. How we can create cwd ? and in my 
application i am not specifying base url seprately and its working fine apart 
from these special characters. There should be a simple solution for this 
problem.

used this code but still its erroring out.
{color:#7f0055}try{color}{color:#00} {{color}

{color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
{color}{color:#2a00ff}"citrus[1].jpg"{color}{color:#00};{color}

{color:#00} String 
{color}{color:#6a3e3e}encodedFileName{color}{color:#00} = 
URLEncoder.{color}{color:#00}encode{color}{color:#00}({color}{color:#6a3e3e}fileName{color}{color:#00},{color}{color:#2a00ff}"UTF-8"{color}{color:#00});{color}

{color:#00} FileSystemManager 
{color}{color:#6a3e3e}fsManager{color}{color:#00} = 
VFS.{color}{color:#00}getManager{color}{color:#00}();{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}baseObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#2a00ff}"D:\\"{color}{color:#00});{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}fileObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}baseObject{color}{color:#00},
 {color}{color:#6a3e3e}encodedFileName{color}{color:#00});{color}

{color:#00} 
System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}

{color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
{color}{color:#6a3e3e}ex{color}{color:#00}) {{color}

{color:#00} 
{color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}

{color:#00} }{color}

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> 

[jira] [Comment Edited] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Usman Ashraf Bajwah (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747078#comment-17747078
 ] 

Usman Ashraf Bajwah edited comment on VFS-840 at 7/25/23 5:34 PM:
--

Not understanding the proposed solution. How we can create cwd ? and in my 
application i am not specifying base url seprately and its working fine apart 
from these special characters. There should be a simple solution for this 
problem.

used this code but still its erroring out.
{color:#7f0055}try{color}{color:#00} {{color}

{color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
{color}{color:#2a00ff}"citrus[1].jpg"{color}{color:#00};{color}

{color:#00} String 
{color}{color:#6a3e3e}encodedFileName{color}{color:#00} = 
URLEncoder.{color}{color:#00}encode{color}{color:#00}({color}{color:#6a3e3e}fileName{color}{color:#00},{color}{color:#2a00ff}"UTF-8"{color}{color:#00});{color}

{color:#00} FileSystemManager 
{color}{color:#6a3e3e}fsManager{color}{color:#00} = 
VFS.{color}{color:#00}getManager{color}{color:#00}();{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}baseObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#2a00ff}"D:\\"{color}{color:#00});{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}fileObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}baseObject{color}{color:#00},
 {color}{color:#6a3e3e}encodedFileName{color}{color:#00});{color}

{color:#00} 
System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}

{color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
{color}{color:#6a3e3e}ex{color}{color:#00}) {{color}

{color:#00} 
{color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}

{color:#00} }{color}


was (Author: JIRAUSER301519):
Not understanding the proposed solution. How we can create cwd ? and in my 
application i am not specifying base url seprately and its working fine apart 
from these special characters. There should be a simple solution for this 
problem.

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}
> {color:#ff} at 
> com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}
> {color:#ff}Caused by: 
> {color}+java.net.URISyntaxException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}
> {color:#ff} ... 3 more{color}
>  
> Following is the code to reproduce the issue.
> {color:#7f0055}try{color}{color:#00} {{color}
> {color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
> {color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}
> {color:#00} FileSystemManager 
> {color}{color:#6a3e3e}fsManager{color}{color:#00} = 
> VFS.{color}{color:#00}getManager{color}{color:#00}();{color}
> {color:#00} 

[jira] [Commented] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Usman Ashraf Bajwah (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747078#comment-17747078
 ] 

Usman Ashraf Bajwah commented on VFS-840:
-

Not understanding the proposed solution. How we can create cwd ? and in my 
application i am not specifying base url seprately and its working fine apart 
from these special characters. There should be a simple solution for this 
problem.

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}
> {color:#ff} at 
> com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}
> {color:#ff}Caused by: 
> {color}+java.net.URISyntaxException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}
> {color:#ff} ... 3 more{color}
>  
> Following is the code to reproduce the issue.
> {color:#7f0055}try{color}{color:#00} {{color}
> {color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
> {color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}
> {color:#00} FileSystemManager 
> {color}{color:#6a3e3e}fsManager{color}{color:#00} = 
> VFS.{color}{color:#00}getManager{color}{color:#00}();{color}
> {color:#00} FileObject 
> {color}{color:#6a3e3e}fileObject{color}{color:#00} = 
> {color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}fileName{color}{color:#00});{color}
> {color:#00} 
> System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}
> {color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
> {color}{color:#6a3e3e}ex{color}{color:#00}) {{color}
> {color:#00} 
> {color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}
> {color:#00} }{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Bernd Eckenfels (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747070#comment-17747070
 ] 

Bernd Eckenfels commented on VFS-840:
-

The resolve always needs a base of you don’t set a base url. For example you 
can use  `cwd = fsm.toFileObject(new File(".")); jpg = fsm.resovleFile(cwd, 
"test%5B1%5D.jpg");`

Btw also beware, fo.getChildre(fn) on the other hand does not work with url 
encoding.

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}
> {color:#ff} at 
> com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}
> {color:#ff}Caused by: 
> {color}+java.net.URISyntaxException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}
> {color:#ff} ... 3 more{color}
>  
> Following is the code to reproduce the issue.
> {color:#7f0055}try{color}{color:#00} {{color}
> {color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
> {color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}
> {color:#00} FileSystemManager 
> {color}{color:#6a3e3e}fsManager{color}{color:#00} = 
> VFS.{color}{color:#00}getManager{color}{color:#00}();{color}
> {color:#00} FileObject 
> {color}{color:#6a3e3e}fileObject{color}{color:#00} = 
> {color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}fileName{color}{color:#00});{color}
> {color:#00} 
> System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}
> {color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
> {color}{color:#6a3e3e}ex{color}{color:#00}) {{color}
> {color:#00} 
> {color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}
> {color:#00} }{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Usman Ashraf Bajwah (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747061#comment-17747061
 ] 

Usman Ashraf Bajwah commented on VFS-840:
-

Tried that and it was another error with FileNotFoundException. used 
{color:#00}String 
{color}{color:#6a3e3e}encodedFileName{color}{color:#00} = 
java.net.URLEncoder.{color}{color:#00}encode{color}{color:#00}({color}{color:#6a3e3e}fileName{color}{color:#00},{color}{color:#2a00ff}"UTF-8"{color}{color:#00});{color}

 
+org.apache.commons.vfs2.FileSystemException+{color:#ff}: Could not find 
file with URI "D%3A%5Ccitrus%5B1%5D.jpg" because it is a relative path, and no 
base URI was provided.{color}

{color:#ff} at 
org.apache.commons.vfs2.FileSystemException.requireNonNull({color}+FileSystemException.java:88+{color:#ff}){color}

{color:#ff} at 
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile({color}+DefaultFileSystemManager.java:805+{color:#ff}){color}

{color:#ff} at 
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile({color}+DefaultFileSystemManager.java:754+{color:#ff}){color}

{color:#ff} at 
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile({color}+DefaultFileSystemManager.java:819+{color:#ff}){color}

{color:#ff} at 
com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}

 

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}
> {color:#ff} at 
> com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}
> {color:#ff}Caused by: 
> {color}+java.net.URISyntaxException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}
> {color:#ff} ... 3 more{color}
>  
> Following is the code to reproduce the issue.
> {color:#7f0055}try{color}{color:#00} {{color}
> {color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
> {color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}
> {color:#00} FileSystemManager 
> {color}{color:#6a3e3e}fsManager{color}{color:#00} = 
> VFS.{color}{color:#00}getManager{color}{color:#00}();{color}
> {color:#00} FileObject 
> {color}{color:#6a3e3e}fileObject{color}{color:#00} = 
> {color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}fileName{color}{color:#00});{color}
> {color:#00} 
> System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}
> {color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
> {color}{color:#6a3e3e}ex{color}{color:#00}) {{color}
> {color:#00} 
> {color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}
> {color:#00} }{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Bernd Eckenfels (Jira)


[ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17747053#comment-17747053
 ] 

Bernd Eckenfels commented on VFS-840:
-

In VFS2 you must url encode the resolveFile(argument). 

Not sure if the error can maybe be thrown in another way.

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}
> {color:#ff} at 
> com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}
> {color:#ff}Caused by: 
> {color}+java.net.URISyntaxException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}
> {color:#ff} ... 3 more{color}
>  
> Following is the code to reproduce the issue.
> {color:#7f0055}try{color}{color:#00} {{color}
> {color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
> {color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}
> {color:#00} FileSystemManager 
> {color}{color:#6a3e3e}fsManager{color}{color:#00} = 
> VFS.{color}{color:#00}getManager{color}{color:#00}();{color}
> {color:#00} FileObject 
> {color}{color:#6a3e3e}fileObject{color}{color:#00} = 
> {color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}fileName{color}{color:#00});{color}
> {color:#00} 
> System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}
> {color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
> {color}{color:#6a3e3e}ex{color}{color:#00}) {{color}
> {color:#00} 
> {color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}
> {color:#00} }{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and calling FileObject.getPath method

2023-07-25 Thread Usman Ashraf Bajwah (Jira)


 [ 
https://issues.apache.org/jira/browse/VFS-840?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Usman Ashraf Bajwah updated VFS-840:

Summary: IllegalArgumentException when using special characters in filename 
eg [ or ] and calling FileObject.getPath method  (was: IllegalArgumentException 
when using special characters in filename eg [ or ] and using 
FileObject.getPath method)

> IllegalArgumentException when using special characters in filename eg [ or ] 
> and calling FileObject.getPath method
> --
>
> Key: VFS-840
> URL: https://issues.apache.org/jira/browse/VFS-840
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.9.0
> Environment: Windows 10
> Java 17
> Apache VFS 2.9.0
>Reporter: Usman Ashraf Bajwah
>Priority: Major
>
> When special characters ([ or ] for example there might be others also) are 
> used in filename FileObject resolve it alright but calling its getPath method 
> fails with following exception.
>  
> +java.lang.IllegalArgumentException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}
> {color:#ff} at 
> org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}
> {color:#ff} at 
> com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}
> {color:#ff}Caused by: 
> {color}+java.net.URISyntaxException+{color:#ff}: Illegal character in 
> path at index 17: file:///D:/citrus[1].jpg{color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}
> {color:#ff} at 
> java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}
> {color:#ff} ... 3 more{color}
>  
> Following is the code to reproduce the issue.
> {color:#7f0055}try{color}{color:#00} {{color}
> {color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
> {color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}
> {color:#00} FileSystemManager 
> {color}{color:#6a3e3e}fsManager{color}{color:#00} = 
> VFS.{color}{color:#00}getManager{color}{color:#00}();{color}
> {color:#00} FileObject 
> {color}{color:#6a3e3e}fileObject{color}{color:#00} = 
> {color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}fileName{color}{color:#00});{color}
> {color:#00} 
> System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}
> {color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
> {color}{color:#6a3e3e}ex{color}{color:#00}) {{color}
> {color:#00} 
> {color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}
> {color:#00} }{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (VFS-840) IllegalArgumentException when using special characters in filename eg [ or ] and using FileObject.getPath method

2023-07-25 Thread Usman Ashraf Bajwah (Jira)
Usman Ashraf Bajwah created VFS-840:
---

 Summary: IllegalArgumentException when using special characters in 
filename eg [ or ] and using FileObject.getPath method
 Key: VFS-840
 URL: https://issues.apache.org/jira/browse/VFS-840
 Project: Commons VFS
  Issue Type: Bug
Affects Versions: 2.9.0
 Environment: Windows 10

Java 17

Apache VFS 2.9.0
Reporter: Usman Ashraf Bajwah


When special characters ([ or ] for example there might be others also) are 
used in filename FileObject resolve it alright but calling its getPath method 
fails with following exception.

 
+java.lang.IllegalArgumentException+{color:#ff}: Illegal character in path 
at index 17: file:///D:/citrus[1].jpg{color}

{color:#ff} at 
java.base/java.net.URI.create({color}+URI.java:906+{color:#ff}){color}

{color:#ff} at 
org.apache.commons.vfs2.FileObject.getURI({color}+FileObject.java:310+{color:#ff}){color}

{color:#ff} at 
org.apache.commons.vfs2.FileObject.getPath({color}+FileObject.java:320+{color:#ff}){color}

{color:#ff} at 
com.gallerysystems.tms.common.util.FileUtil.main({color}+FileUtil.java:859+{color:#ff}){color}

{color:#ff}Caused by: {color}+java.net.URISyntaxException+{color:#ff}: 
Illegal character in path at index 17: file:///D:/citrus[1].jpg{color}

{color:#ff} at 
java.base/java.net.URI$Parser.fail({color}+URI.java:2974+{color:#ff}){color}

{color:#ff} at 
java.base/java.net.URI$Parser.checkChars({color}+URI.java:3145+{color:#ff}){color}

{color:#ff} at 
java.base/java.net.URI$Parser.parseHierarchical({color}+URI.java:3227+{color:#ff}){color}

{color:#ff} at 
java.base/java.net.URI$Parser.parse({color}+URI.java:3175+{color:#ff}){color}

{color:#ff} at 
java.base/java.net.URI.({color}+URI.java:623+{color:#ff}){color}

{color:#ff} at 
java.base/java.net.URI.create({color}+URI.java:904+{color:#ff}){color}

{color:#ff} ... 3 more{color}

 

Following is the code to reproduce the issue.
{color:#7f0055}try{color}{color:#00} {{color}

{color:#00} String {color}{color:#6a3e3e}fileName{color}{color:#00} = 
{color}{color:#2a00ff}"D:\\citrus[1].jpg"{color}{color:#00};{color}

{color:#00} FileSystemManager 
{color}{color:#6a3e3e}fsManager{color}{color:#00} = 
VFS.{color}{color:#00}getManager{color}{color:#00}();{color}

{color:#00} FileObject 
{color}{color:#6a3e3e}fileObject{color}{color:#00} = 
{color}{color:#6a3e3e}fsManager{color}{color:#00}.resolveFile({color}{color:#6a3e3e}fileName{color}{color:#00});{color}

{color:#00} 
System.{color}{color:#c0}out{color}{color:#00}.println({color}{color:#6a3e3e}fileObject{color}{color:#00}.getPath());{color}

{color:#00} }{color}{color:#7f0055}catch{color}{color:#00}(Exception 
{color}{color:#6a3e3e}ex{color}{color:#00}) {{color}

{color:#00} 
{color}{color:#6a3e3e}ex{color}{color:#00}.printStackTrace();{color}

{color:#00} }{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [commons-geometry] darkma773r commented on a diff in pull request #217: GEOMETRY-150: implemented check for codirectional vectors

2023-07-25 Thread via GitHub


darkma773r commented on code in PR #217:
URL: https://github.com/apache/commons-geometry/pull/217#discussion_r1273636413


##
commons-geometry-core/src/main/java/org/apache/commons/geometry/core/Vector.java:
##
@@ -142,4 +144,24 @@ public interface Vector> extends 
Spatial {
  * @throws IllegalArgumentException if either vector has a zero, NaN, or 
infinite norm
  */
 double angle(V v);
+
+
+/**
+ * Determines if this vector has teh same direction as the other vector.
+ * It normalizes both vectors and if the dot product of them is 1,
+ * then it returns {@code true}, otherwise {@code false}.
+ * @param other other vector
+ * @param precision precision object used for floating point comparisons
+ * @return {@code true} if this vector has the same direction as the otehr 
vector.
+ */
+default boolean isCodirectionalWith(final V other, final 
Precision.DoubleEquivalence precision) {
+final V thisNormalized = normalizeOrNull();
+final V otherNormalized = other.normalizeOrNull();
+
+if (thisNormalized != null && otherNormalized != null) {

Review Comment:
   We need unit tests for the following:
   - cases where one or both vectors cannot be normalized (i.e., they are zero, 
NaN, or infinite)
   - cases where the vectors are very close but not exactly pointing in the 
same direction (the given precision determines the result in these cases)
   
   Add these tests to `commons-geometry-core` (see `SizedTest` for a possible 
example of how to do this) and the corresponding `VectorXDTest` classses.



##
commons-geometry-core/src/main/java/org/apache/commons/geometry/core/Vector.java:
##
@@ -142,4 +144,24 @@ public interface Vector> extends 
Spatial {
  * @throws IllegalArgumentException if either vector has a zero, NaN, or 
infinite norm
  */
 double angle(V v);
+
+
+/**
+ * Determines if this vector has teh same direction as the other vector.
+ * It normalizes both vectors and if the dot product of them is 1,
+ * then it returns {@code true}, otherwise {@code false}.
+ * @param other other vector
+ * @param precision precision object used for floating point comparisons
+ * @return {@code true} if this vector has the same direction as the otehr 
vector.

Review Comment:
   - typo `teh` -> `the`
   - Document the expected result when one or both of the vectors cannot be 
normalized



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-geometry] darkma773r commented on pull request #218: Refactor hull

2023-07-25 Thread via GitHub


darkma773r commented on PR #218:
URL: https://github.com/apache/commons-geometry/pull/218#issuecomment-1649936856

   Hello! I plan on reviewing this soon, although I might not have time until 
this weekend. Thanks for the hard work here!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-collections] vad0 opened a new pull request, #407: Make AbstractPatriciaTrie public

2023-07-25 Thread via GitHub


vad0 opened a new pull request, #407:
URL: https://github.com/apache/commons-collections/pull/407

   I extend this class 
[here](https://github.com/vad0/gfjson/blob/master/src/main/java/org/apache/commons/collections4/trie/AsciiTrie.java)
 to make an implementation which works with a 'AsciiSequenceView' instead of 
'String'. I forces me to create a package org.apache.commons.collections4.trie 
in my project. This hack works, but it prevents me from migrating to the java 
modules system, which prohibits using the same package names in the different 
modules. So I think the best solution here wil be to make AbstractPatriciaTrie 
public.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [commons-collections] Claudenw commented on pull request #406: COLLECTIONS-844 - allow counting Bloom filters with cell size other than Integer.SIZE

2023-07-25 Thread via GitHub


Claudenw commented on PR #406:
URL: 
https://github.com/apache/commons-collections/pull/406#issuecomment-1649833256

   @aherbert Please take a look again and see if you are OK to merge this 
change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Comment Edited] (STATISTICS-77) Implement Sum

2023-07-25 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/STATISTICS-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17746879#comment-17746879
 ] 

Gilles Sadowski edited comment on STATISTICS-77 at 7/25/23 9:37 AM:


{quote}Let me know your thoughts on this and other alternatives.
{quote}
IMO, we have to delineate what is the most important service these classes will 
provide, before trying to cover rare use-cases.

Casual usage does not need to bother with figuring out which of {{combine}} or 
{{{}safeCombine{}}} to call; if it seems that {{safeCombine}} is safer, users 
will pick it even if they will call it where {{combine}} would have been fine, 
thus loosing whatever efficiency was available by default.
In the context of a library, a developer may have to always call 
{{safeCombine}} in methods that cannot know which implementations they receive 
as input.

I repeat that if we stick with the decision made in [Numbers] for 
[{{Sum}}|https://commons.apache.org/proper/commons-numbers/commons-numbers-core/javadocs/api-1.1/org/apache/commons/numbers/core/Sum.html],
 the issue vanishes (IOW, we stop wondering how to implement a service which we 
don't intend to provide).



was (Author: erans):
bq. Let me know your thoughts on this and other alternatives.

IMO, we have delineate what is the most important service these classes will 
provide, before trying to cover rare use-cases.

Casual usage does not need to bother with figuring out which of {{combine}} or 
{{safeCombine}}; if it seems that {{safeCombine}} is safer, a user will pick it 
even if he will most probably call it where {{combine}} would have been fine, 
thus loosing whatever efficiency was available.
In the context of a library, a developer may have to always call 
{{safeCombine}} in methods that cannot know which implementations they receive 
as input.

I repeat that if we stick with the decision made in [Numbers] for 
[{{Sum}}|https://commons.apache.org/proper/commons-numbers/commons-numbers-core/javadocs/api-1.1/org/apache/commons/numbers/core/Sum.html],
 the issue vanishes (IOW, we stop wondering how to implement a service which we 
don't intend to provide).


> Implement Sum
> -
>
> Key: STATISTICS-77
> URL: https://issues.apache.org/jira/browse/STATISTICS-77
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Anirudh Joshi
>Priority: Minor
>  Labels: gsoc, gsoc2023
> Fix For: 1.1
>
>
> This implementation uses {{commons-numbers}} 
> [Sum|https://github.com/apache/commons-numbers/blob/master/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Sum.java]
>  as the underlying implementation.
> This may be further expanded to include various other Sum implementations 
> like [Kahan Sum|https://en.wikipedia.org/wiki/Kahan_summation_algorithm], 
> {{Neumaier Sum}} (Two sum method) etc. with the option for the users to 
> choose an implementation. However, before beginning the implementation of 
> various other algorithms it may be worthwhile to discuss and investigate the 
> relative speed of the current Sum implementation compared to 
> {{DoubleStream.sum}} through JMH benchmarks.
> When we know the different speeds, it would be more clear if the user should 
> have a choice for this statistic, e.g.
>  * When using {{DoubleStream.sum}} is too slow and it would be nice to have a 
> simple sum variation.
>  * When the sum has a lot of cancellation and {{DoubleStream.sum}} suffers 
> from random walk around zero.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (STATISTICS-77) Implement Sum

2023-07-25 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/STATISTICS-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17746879#comment-17746879
 ] 

Gilles Sadowski commented on STATISTICS-77:
---

bq. Let me know your thoughts on this and other alternatives.

IMO, we have delineate what is the most important service these classes will 
provide, before trying to cover rare use-cases.

Casual usage does not need to bother with figuring out which of {{combine}} or 
{{safeCombine}}; if it seems that {{safeCombine}} is safer, a user will pick it 
even if he will most probably call it where {{combine}} would have been fine, 
thus loosing whatever efficiency was available.
In the context of a library, a developer may have to always call 
{{safeCombine}} in methods that cannot know which implementations they receive 
as input.

I repeat that if we stick with the decision made in [Numbers] for 
[{{Sum}}|https://commons.apache.org/proper/commons-numbers/commons-numbers-core/javadocs/api-1.1/org/apache/commons/numbers/core/Sum.html],
 the issue vanishes (IOW, we stop wondering how to implement a service which we 
don't intend to provide).


> Implement Sum
> -
>
> Key: STATISTICS-77
> URL: https://issues.apache.org/jira/browse/STATISTICS-77
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Anirudh Joshi
>Priority: Minor
>  Labels: gsoc, gsoc2023
> Fix For: 1.1
>
>
> This implementation uses {{commons-numbers}} 
> [Sum|https://github.com/apache/commons-numbers/blob/master/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Sum.java]
>  as the underlying implementation.
> This may be further expanded to include various other Sum implementations 
> like [Kahan Sum|https://en.wikipedia.org/wiki/Kahan_summation_algorithm], 
> {{Neumaier Sum}} (Two sum method) etc. with the option for the users to 
> choose an implementation. However, before beginning the implementation of 
> various other algorithms it may be worthwhile to discuss and investigate the 
> relative speed of the current Sum implementation compared to 
> {{DoubleStream.sum}} through JMH benchmarks.
> When we know the different speeds, it would be more clear if the user should 
> have a choice for this statistic, e.g.
>  * When using {{DoubleStream.sum}} is too slow and it would be nice to have a 
> simple sum variation.
>  * When the sum has a lot of cancellation and {{DoubleStream.sum}} suffers 
> from random walk around zero.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] (STATISTICS-18) Port Percentile class from Commons-Maths

2023-07-25 Thread Alex Herbert (Jira)


[ https://issues.apache.org/jira/browse/STATISTICS-18 ]


Alex Herbert deleted comment on STATISTICS-18:


was (Author: alexherbert):
Added in commit:

684f1c40556b87a27d07a16c29a44f7d9fac1015

> Port Percentile class from Commons-Maths
> 
>
> Key: STATISTICS-18
> URL: https://issues.apache.org/jira/browse/STATISTICS-18
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Virendra Singh
>Priority: Blocker
> Fix For: 1.1
>
>
> Port the Percentile class from Commons-Maths in Commons-Statistics.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] (STATISTICS-18) Port Percentile class from Commons-Maths

2023-07-25 Thread Alex Herbert (Jira)


[ https://issues.apache.org/jira/browse/STATISTICS-18 ]


Alex Herbert deleted comment on STATISTICS-18:


was (Author: alexherbert):
Resolved in error

> Port Percentile class from Commons-Maths
> 
>
> Key: STATISTICS-18
> URL: https://issues.apache.org/jira/browse/STATISTICS-18
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Virendra Singh
>Priority: Blocker
> Fix For: 1.1
>
>
> Port the Percentile class from Commons-Maths in Commons-Statistics.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (STATISTICS-18) Port Percentile class from Commons-Maths

2023-07-25 Thread Alex Herbert (Jira)


 [ 
https://issues.apache.org/jira/browse/STATISTICS-18?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Herbert updated STATISTICS-18:
---
Fix Version/s: (was: 1.1)

> Port Percentile class from Commons-Maths
> 
>
> Key: STATISTICS-18
> URL: https://issues.apache.org/jira/browse/STATISTICS-18
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Virendra Singh
>Priority: Blocker
>
> Port the Percentile class from Commons-Maths in Commons-Statistics.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (STATISTICS-77) Implement Sum

2023-07-25 Thread Alex Herbert (Jira)


 [ 
https://issues.apache.org/jira/browse/STATISTICS-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Herbert resolved STATISTICS-77.

Fix Version/s: 1.1
   Resolution: Implemented

Added in commit

684f1c40556b87a27d07a16c29a44f7d9fac1015

> Implement Sum
> -
>
> Key: STATISTICS-77
> URL: https://issues.apache.org/jira/browse/STATISTICS-77
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Anirudh Joshi
>Priority: Minor
>  Labels: gsoc, gsoc2023
> Fix For: 1.1
>
>
> This implementation uses {{commons-numbers}} 
> [Sum|https://github.com/apache/commons-numbers/blob/master/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Sum.java]
>  as the underlying implementation.
> This may be further expanded to include various other Sum implementations 
> like [Kahan Sum|https://en.wikipedia.org/wiki/Kahan_summation_algorithm], 
> {{Neumaier Sum}} (Two sum method) etc. with the option for the users to 
> choose an implementation. However, before beginning the implementation of 
> various other algorithms it may be worthwhile to discuss and investigate the 
> relative speed of the current Sum implementation compared to 
> {{DoubleStream.sum}} through JMH benchmarks.
> When we know the different speeds, it would be more clear if the user should 
> have a choice for this statistic, e.g.
>  * When using {{DoubleStream.sum}} is too slow and it would be nice to have a 
> simple sum variation.
>  * When the sum has a lot of cancellation and {{DoubleStream.sum}} suffers 
> from random walk around zero.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Reopened] (STATISTICS-18) Port Percentile class from Commons-Maths

2023-07-25 Thread Alex Herbert (Jira)


 [ 
https://issues.apache.org/jira/browse/STATISTICS-18?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Herbert reopened STATISTICS-18:


Resolved in error

> Port Percentile class from Commons-Maths
> 
>
> Key: STATISTICS-18
> URL: https://issues.apache.org/jira/browse/STATISTICS-18
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Virendra Singh
>Priority: Blocker
> Fix For: 1.1
>
>
> Port the Percentile class from Commons-Maths in Commons-Statistics.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (STATISTICS-18) Port Percentile class from Commons-Maths

2023-07-25 Thread Alex Herbert (Jira)


 [ 
https://issues.apache.org/jira/browse/STATISTICS-18?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Herbert resolved STATISTICS-18.

Fix Version/s: 1.1
   Resolution: Implemented

Added in commit:

684f1c40556b87a27d07a16c29a44f7d9fac1015

> Port Percentile class from Commons-Maths
> 
>
> Key: STATISTICS-18
> URL: https://issues.apache.org/jira/browse/STATISTICS-18
> Project: Commons Statistics
>  Issue Type: Sub-task
>  Components: descriptive
>Reporter: Virendra Singh
>Priority: Blocker
> Fix For: 1.1
>
>
> Port the Percentile class from Commons-Maths in Commons-Statistics.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [commons-statistics] aherbert merged pull request #50: STATISTICS-77: Sum Implementation

2023-07-25 Thread via GitHub


aherbert merged PR #50:
URL: https://github.com/apache/commons-statistics/pull/50


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org