[jira] [Work logged] (LANG-1490) Create a more generic/string representation of a DiffResult and a Diff

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1490?focusedWorklogId=439349=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439349
 ]

ASF GitHub Bot logged work on LANG-1490:


Author: ASF GitHub Bot
Created on: 01/Jun/20 05:46
Start Date: 01/Jun/20 05:46
Worklog Time Spent: 10m 
  Work Description: kinow commented on a change in pull request #457:
URL: https://github.com/apache/commons-lang/pull/457#discussion_r433050850



##
File path: src/main/java/org/apache/commons/lang3/builder/DiffView.java
##
@@ -0,0 +1,64 @@
+package org.apache.commons.lang3.builder;

Review comment:
   I think this file is missing the copyright license header.

##
File path: src/main/java/org/apache/commons/lang3/builder/DiffView.java
##
@@ -0,0 +1,64 @@
+package org.apache.commons.lang3.builder;
+
+/**
+ * A {@code DiffView} object holds the string representation of the 
difference of
+ * a given field between two objects.
+ *
+ * @since 3.10
+ */
+public class DiffView {
+   private final String field;
+   private final String leftValue;
+   private final String rightValue;
+
+   /**
+* Constructs a {@code DiffView} from 3 string params: field, 
leftValue and rightValue
+*
+* @param field designates the field identified as different.
+* @param leftValue holds the string representation of the value in the 
left side of the comparison.
+* @param rightValue holds the string representation of the value in 
the right side of the comparison.
+*/
+   public DiffView(String field, String leftValue, String rightValue) {
+   this.field = field;

Review comment:
   I think the files were formatted with tabs, and this may cause issues in 
Travis when it builds using Checkstyle.

##
File path: src/main/java/org/apache/commons/lang3/builder/DiffResultView.java
##
@@ -0,0 +1,157 @@
+package org.apache.commons.lang3.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 
+ * A {@code DiffResultView} encapsulates two objects of the same type and list 
their differences
+ * as a list of {@link DiffView} objects, each holding a field name and the 
two different values found for this field
+ * in the Left and Right object.
+ * 
+ *
+ * 
+ * It can be built with or without a pre-defined list of {@link DiffView} 
objects, or from an existing
+ * {@link DiffResult}.
+ * 
+ *
+ * @param  type of the left and right object.
+ *
+ * @since 3.10
+ */
+public class DiffResultView {
+
+   /**
+* The list of {@link DiffView} objects for the two compared objects.
+*/
+   private List diffs;
+
+   /**
+* Holds the left object of the comparison.
+*/
+   private T left;
+   /**
+* Holds the right object of the comparison.
+*/
+   private T right;
+
+   /**
+* Creates a simple {@code DiffResultView} without predefined list 
of {@link DiffView}.
+* The list will be initialized as an empty @{link ArrayList}.
+*
+* @param o1 left object of the comparison
+* @param o2 right object of the comparison
+*/
+   public DiffResultView(T o1, T o2) {
+   this.left = o1;
+   this.right = o2;
+   this.diffs = new ArrayList<>();
+   }
+
+   /**
+* Creates a simple {@code DiffResultView} with a predefined list of 
{@link DiffView}.
+*
+* @param o1 left object of the comparison.
+* @param o2 right object of the comparison.
+* @param diffs list of {@link DiffView} objects.
+*/
+   public DiffResultView(T o1, T o2, List diffs) {
+   this(o1, o2);
+   this.diffs = diffs;
+   }
+
+   /**
+* Creates a simple {@code DiffResultView} from a {@link DiffResult} 
object.
+* {@link DiffView} objects will be constructed from {@link 
DiffResult} {@link Diff} objects and
+* added to the diffs list
+*
+* @param diffResult {@link DiffResult} object used to initialize the 
{@code DiffResultView}
+*/
+   public DiffResultView(DiffResult diffResult) {
+   this(diffResult.getLeft(), diffResult.getRight());
+   this.addDiffs(diffResult);
+   }
+
+   /**
+* Returns the list of the {@link DiffView} objects
+* @return the list of the {@link DiffView} objects
+*/
+   public List getDiffs() {
+   return diffs;
+   }
+
+   /**
+* Returns only a list of the fields of all {@link DiffView} 
objects, that is, fields that have been detected
+* as changed between the objects.
+*
+* @return the list of the {@link DiffView} objects
+*/
+   public List getDiffFields() {
+  

[GitHub] [commons-lang] kinow commented on a change in pull request #457: WIP [LANG-1490] - Creates DiffResultView and DiffView classes

2020-05-31 Thread GitBox


kinow commented on a change in pull request #457:
URL: https://github.com/apache/commons-lang/pull/457#discussion_r433050850



##
File path: src/main/java/org/apache/commons/lang3/builder/DiffView.java
##
@@ -0,0 +1,64 @@
+package org.apache.commons.lang3.builder;

Review comment:
   I think this file is missing the copyright license header.

##
File path: src/main/java/org/apache/commons/lang3/builder/DiffView.java
##
@@ -0,0 +1,64 @@
+package org.apache.commons.lang3.builder;
+
+/**
+ * A {@code DiffView} object holds the string representation of the 
difference of
+ * a given field between two objects.
+ *
+ * @since 3.10
+ */
+public class DiffView {
+   private final String field;
+   private final String leftValue;
+   private final String rightValue;
+
+   /**
+* Constructs a {@code DiffView} from 3 string params: field, 
leftValue and rightValue
+*
+* @param field designates the field identified as different.
+* @param leftValue holds the string representation of the value in the 
left side of the comparison.
+* @param rightValue holds the string representation of the value in 
the right side of the comparison.
+*/
+   public DiffView(String field, String leftValue, String rightValue) {
+   this.field = field;

Review comment:
   I think the files were formatted with tabs, and this may cause issues in 
Travis when it builds using Checkstyle.

##
File path: src/main/java/org/apache/commons/lang3/builder/DiffResultView.java
##
@@ -0,0 +1,157 @@
+package org.apache.commons.lang3.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 
+ * A {@code DiffResultView} encapsulates two objects of the same type and list 
their differences
+ * as a list of {@link DiffView} objects, each holding a field name and the 
two different values found for this field
+ * in the Left and Right object.
+ * 
+ *
+ * 
+ * It can be built with or without a pre-defined list of {@link DiffView} 
objects, or from an existing
+ * {@link DiffResult}.
+ * 
+ *
+ * @param  type of the left and right object.
+ *
+ * @since 3.10
+ */
+public class DiffResultView {
+
+   /**
+* The list of {@link DiffView} objects for the two compared objects.
+*/
+   private List diffs;
+
+   /**
+* Holds the left object of the comparison.
+*/
+   private T left;
+   /**
+* Holds the right object of the comparison.
+*/
+   private T right;
+
+   /**
+* Creates a simple {@code DiffResultView} without predefined list 
of {@link DiffView}.
+* The list will be initialized as an empty @{link ArrayList}.
+*
+* @param o1 left object of the comparison
+* @param o2 right object of the comparison
+*/
+   public DiffResultView(T o1, T o2) {
+   this.left = o1;
+   this.right = o2;
+   this.diffs = new ArrayList<>();
+   }
+
+   /**
+* Creates a simple {@code DiffResultView} with a predefined list of 
{@link DiffView}.
+*
+* @param o1 left object of the comparison.
+* @param o2 right object of the comparison.
+* @param diffs list of {@link DiffView} objects.
+*/
+   public DiffResultView(T o1, T o2, List diffs) {
+   this(o1, o2);
+   this.diffs = diffs;
+   }
+
+   /**
+* Creates a simple {@code DiffResultView} from a {@link DiffResult} 
object.
+* {@link DiffView} objects will be constructed from {@link 
DiffResult} {@link Diff} objects and
+* added to the diffs list
+*
+* @param diffResult {@link DiffResult} object used to initialize the 
{@code DiffResultView}
+*/
+   public DiffResultView(DiffResult diffResult) {
+   this(diffResult.getLeft(), diffResult.getRight());
+   this.addDiffs(diffResult);
+   }
+
+   /**
+* Returns the list of the {@link DiffView} objects
+* @return the list of the {@link DiffView} objects
+*/
+   public List getDiffs() {
+   return diffs;
+   }
+
+   /**
+* Returns only a list of the fields of all {@link DiffView} 
objects, that is, fields that have been detected
+* as changed between the objects.
+*
+* @return the list of the {@link DiffView} objects
+*/
+   public List getDiffFields() {
+   return 
diffs.stream().map(DiffView::getField).collect(Collectors.toList());
+   }
+
+   /**
+* Adds one {@link DiffView} to the list of the diffs between the 
two objects.
+*
+* @param diffView the {@link DiffView} object to be added to the diffs 
list.
+*/
+   public void addDiff(DiffView diffView) {
+   diffs.add(diffView);
+   }
+
+   /**
+

[GitHub] [commons-lang] kinow commented on pull request #530: LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format for List

2020-05-31 Thread GitBox


kinow commented on pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#issuecomment-636621642


   BTW, @TranNgocKhoa if you could rebase it, the build should pass. There were 
checkstyle issues on master until recently.



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.

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




[jira] [Work logged] (LANG-1542) ToStringBuilder.reflectionToString - Wrong JSON format when object has a List of Enum

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1542?focusedWorklogId=439345=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439345
 ]

ASF GitHub Bot logged work on LANG-1542:


Author: ASF GitHub Bot
Created on: 01/Jun/20 05:31
Start Date: 01/Jun/20 05:31
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#issuecomment-636621642


   BTW, @TranNgocKhoa if you could rebase it, the build should pass. There were 
checkstyle issues on master until recently.



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439345)
Time Spent: 2h 10m  (was: 2h)

> ToStringBuilder.reflectionToString - Wrong JSON format when object has a List 
> of Enum
> -
>
> Key: LANG-1542
> URL: https://issues.apache.org/jira/browse/LANG-1542
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.10
> Environment: Open JDK 1.8
>Reporter: Trần Ngọc Khoa
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> I'm trying to log an object to console with JSON style using 
> {{ToStringBuilder.reflectionToString}} from {{commons-lang3:3.10}} but it 
> seems generated a wrong JSON format.
> Problem happening when I have a list of enums in my field list.
>  
> {code:java}
> This is the class:
>      public class Person {
>  private long id;
>  private String name;
>  private List listEnums;
> //getter and setter
> public String toString(){
>  return ToStringBuilder.reflectionToString(this, 
> ToStringStyle.JSON_STYLE); 
> }
> }
> {code}
>   
> And {{MyEnum}}:
> {code:java}
>  public enum MyEnum {
>  FOOD,
>  SPORT,
>  BOOK,
>  MUSIC
>  }{code}
> When I call {{toString()}} of Person object. It shows like this
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": [FRIDAY, MONDAY, TUESDAY]
>  }{code}
>   
> What I expected is:
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": ["FRIDAY", "MONDAY", "TUESDAY"]
>  }{code}
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1542) ToStringBuilder.reflectionToString - Wrong JSON format when object has a List of Enum

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1542?focusedWorklogId=439344=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439344
 ]

ASF GitHub Bot logged work on LANG-1542:


Author: ASF GitHub Bot
Created on: 01/Jun/20 05:26
Start Date: 01/Jun/20 05:26
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#issuecomment-636620127


   Will leave it to @garydgregory to do the final review as he had requested 
changes before :+1: 



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439344)
Time Spent: 2h  (was: 1h 50m)

> ToStringBuilder.reflectionToString - Wrong JSON format when object has a List 
> of Enum
> -
>
> Key: LANG-1542
> URL: https://issues.apache.org/jira/browse/LANG-1542
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.10
> Environment: Open JDK 1.8
>Reporter: Trần Ngọc Khoa
>Priority: Major
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> I'm trying to log an object to console with JSON style using 
> {{ToStringBuilder.reflectionToString}} from {{commons-lang3:3.10}} but it 
> seems generated a wrong JSON format.
> Problem happening when I have a list of enums in my field list.
>  
> {code:java}
> This is the class:
>      public class Person {
>  private long id;
>  private String name;
>  private List listEnums;
> //getter and setter
> public String toString(){
>  return ToStringBuilder.reflectionToString(this, 
> ToStringStyle.JSON_STYLE); 
> }
> }
> {code}
>   
> And {{MyEnum}}:
> {code:java}
>  public enum MyEnum {
>  FOOD,
>  SPORT,
>  BOOK,
>  MUSIC
>  }{code}
> When I call {{toString()}} of Person object. It shows like this
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": [FRIDAY, MONDAY, TUESDAY]
>  }{code}
>   
> What I expected is:
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": ["FRIDAY", "MONDAY", "TUESDAY"]
>  }{code}
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] kinow commented on pull request #530: LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format for List

2020-05-31 Thread GitBox


kinow commented on pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#issuecomment-636620127


   Will leave it to @garydgregory to do the final review as he had requested 
changes before :+1: 



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.

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




[jira] [Updated] (COMPRESS-529) Tar decompression fails with runtime exceptions

2020-05-31 Thread Peter Lee (Jira)


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

Peter Lee updated COMPRESS-529:
---
Assignee: Peter Lee

> Tar decompression fails with runtime exceptions
> ---
>
> Key: COMPRESS-529
> URL: https://issues.apache.org/jira/browse/COMPRESS-529
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Maksim Zuev
>Assignee: Peter Lee
>Priority: Major
> Attachments: LongName.tar, NumberFormatException.tar, japicmp.html, 
> japicmp.html
>
>
> This Kotlin code fails with exception(NumberFormatException.tar is in the 
> attachment)
> Exception in thread "main" java.lang.NumberFormatException: For input string: 
> "143266�921.098285006"
>  at 
> java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
>  at 
> java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
>  at java.base/java.lang.Double.parseDouble(Double.java:543)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.processPaxHeader(TarArchiveEntry.java:1161)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.updateEntryFromPaxHeaders(TarArchiveEntry.java:1093)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.applyPaxHeadersToCurrentEntry(TarArchiveInputStream.java:757)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.paxHeaders(TarArchiveInputStream.java:562)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:404)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:799)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:69)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("NumberFormatException.tar")
> ArchiveStreamFactory().createArchiveInputStream("tar", 
> tar.inputStream()).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> This Kotlin code fails with exception(LongName.tar is in the attachment)
> Exception in thread "main" java.lang.RuntimeException: file name 'asidhuasih a
>  sdjn osdn 
>  sdvs ndv
>  asdjbhasdb asb iasbfi basdigf basduio 
>  asdkhasjdhasd
>  asdjkhasnjddjasjdas
>  /?' is too long ( > 100 bytes)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.handleLongName(TarArchiveOutputStream.java:683)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.putArchiveEntry(TarArchiveOutputStream.java:358)
>  at ru.example.kotlinfuzzer.tests.MainKt.test(main.kt:20)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:8)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import org.apache.commons.compress.archivers.tar.TarArchiveEntry
> import java.io.File
> fun main() {
> test(File("LongName.tar"))
> }
> fun test(tar: File) {
> val (decompressed, name) = 
> ArchiveStreamFactory().createArchiveInputStream("tar", tar.inputStream()).use 
> { ais ->
> val entry = ais.nextEntry
> ais.readAllBytes() to entry.name
> }
> File.createTempFile("apache_", ".tar").also {
> ArchiveStreamFactory().createArchiveOutputStream("tar", 
> it.outputStream()).use { aos ->
> val entry = TarArchiveEntry(name)
> entry.size = decompressed.size.toLong()
> aos.putArchiveEntry(entry)
> try {
> aos.write(decompressed)
> } finally {
> aos.closeArchiveEntry()
> }
> }
> }
> }
> {code}
>  
> IOException expected



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-31 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120702#comment-17120702
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

bq. Did you remove the "uv-sphere" implementation?

Yes. The "icosphere" implementation is much better as it relates to BSP trees. 
Here are some benefits:
- It produces boundary triangles of equal size.
- The code is much simpler.
- It can produce much more detailed sphere approximations.

UV-spheres have many uses but I would highly encourage users to use the 
"icosphere" implementation for BSP trees. Therefore, I removed the old 
implementation.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1548) split regionMatches for better performance

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1548?focusedWorklogId=439297=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439297
 ]

ASF GitHub Bot logged work on LANG-1548:


Author: ASF GitHub Bot
Created on: 31/May/20 22:26
Start Date: 31/May/20 22:26
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on pull request #534:
URL: https://github.com/apache/commons-lang/pull/534#issuecomment-636539583


   also want to split StringUtils.startswith, endwith, prependIfMissing...
   now the call flow is like this:
   1. user call startsWith(final CharSequence str, final CharSequence prefix)
   2. give an additional boolean, and invoke startsWith(final CharSequence str, 
final CharSequence prefix, final boolean ignoreCase) 
   3. invoke CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length());
   4. in CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length()) we detect that boolean.
   That is, actually weird, as when we call startsWith(final CharSequence str, 
final CharSequence prefix) we know the boolean is false, and we still fill a 
false boolean and let it detect at runtime.
   But, detecting a boolean is not a big performance issue (if not in a loop 
and perform tons of times)
   So I leave it unchanged for next pr.
   We can discuss whether should split regionMatches first.
   



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439297)
Time Spent: 20m  (was: 10m)

> split regionMatches for better performance
> --
>
> Key: LANG-1548
> URL: https://issues.apache.org/jira/browse/LANG-1548
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-lang/pull/534/files]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1548) split regionMatches for better performance

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1548?focusedWorklogId=439298=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439298
 ]

ASF GitHub Bot logged work on LANG-1548:


Author: ASF GitHub Bot
Created on: 31/May/20 22:26
Start Date: 31/May/20 22:26
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #534:
URL: https://github.com/apache/commons-lang/pull/534#issuecomment-636539583


   also want to split StringUtils.startswith, endwith, prependIfMissing...
   now the call flow is like this:
   1. user call startsWith(final CharSequence str, final CharSequence prefix)
   2. give an additional boolean, and invoke startsWith(final CharSequence str, 
final CharSequence prefix, final boolean ignoreCase) 
   3. invoke CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length());
   4. in CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length()) we detect that boolean.
   
   That is, actually weird, as when we call startsWith(final CharSequence str, 
final CharSequence prefix) we know the boolean is false, and we still fill a 
false boolean and let it detect at runtime.
   But, detecting a boolean is not a big performance issue (if not in a loop 
and perform tons of times)
   So I leave it unchanged for next pr.
   We can discuss whether should split regionMatches first.
   



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439298)
Time Spent: 0.5h  (was: 20m)

> split regionMatches for better performance
> --
>
> Key: LANG-1548
> URL: https://issues.apache.org/jira/browse/LANG-1548
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-lang/pull/534/files]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] XenoAmess edited a comment on pull request #534: [LANG-1548] split regionMatches for better performance

2020-05-31 Thread GitBox


XenoAmess edited a comment on pull request #534:
URL: https://github.com/apache/commons-lang/pull/534#issuecomment-636539583


   also want to split StringUtils.startswith, endwith, prependIfMissing...
   now the call flow is like this:
   1. user call startsWith(final CharSequence str, final CharSequence prefix)
   2. give an additional boolean, and invoke startsWith(final CharSequence str, 
final CharSequence prefix, final boolean ignoreCase) 
   3. invoke CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length());
   4. in CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length()) we detect that boolean.
   
   That is, actually weird, as when we call startsWith(final CharSequence str, 
final CharSequence prefix) we know the boolean is false, and we still fill a 
false boolean and let it detect at runtime.
   But, detecting a boolean is not a big performance issue (if not in a loop 
and perform tons of times)
   So I leave it unchanged for next pr.
   We can discuss whether should split regionMatches first.
   



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.

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




[GitHub] [commons-lang] XenoAmess commented on pull request #534: [LANG-1548] split regionMatches for better performance

2020-05-31 Thread GitBox


XenoAmess commented on pull request #534:
URL: https://github.com/apache/commons-lang/pull/534#issuecomment-636539583


   also want to split StringUtils.startswith, endwith, prependIfMissing...
   now the call flow is like this:
   1. user call startsWith(final CharSequence str, final CharSequence prefix)
   2. give an additional boolean, and invoke startsWith(final CharSequence str, 
final CharSequence prefix, final boolean ignoreCase) 
   3. invoke CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length());
   4. in CharSequenceUtils.regionMatches(str, ignoreCase, 0, prefix, 0, 
prefix.length()) we detect that boolean.
   That is, actually weird, as when we call startsWith(final CharSequence str, 
final CharSequence prefix) we know the boolean is false, and we still fill a 
false boolean and let it detect at runtime.
   But, detecting a boolean is not a big performance issue (if not in a loop 
and perform tons of times)
   So I leave it unchanged for next pr.
   We can discuss whether should split regionMatches first.
   



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.

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




[jira] [Work logged] (LANG-1549) implement TODO in CharSequenceUtils.lastIndexOf : remake it.

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1549?focusedWorklogId=439296=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439296
 ]

ASF GitHub Bot logged work on LANG-1549:


Author: ASF GitHub Bot
Created on: 31/May/20 22:08
Start Date: 31/May/20 22:08
Worklog Time Spent: 10m 
  Work Description: coveralls commented on pull request #535:
URL: https://github.com/apache/commons-lang/pull/535#issuecomment-636537530


   
   [![Coverage 
Status](https://coveralls.io/builds/31147261/badge)](https://coveralls.io/builds/31147261)
   
   Coverage decreased (-0.03%) to 95.01% when pulling 
**2def83c302b085b255f6b6e0ac17eb5e06cb3bbe on 
XenoAmess:refine_CharSequenceUtils** into 
**3d4ed4a8ac63db1e51601ffc31fed44dccbb276c on apache:master**.
   



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439296)
Remaining Estimate: 0h
Time Spent: 10m

> implement TODO in CharSequenceUtils.lastIndexOf : remake it.
> 
>
> Key: LANG-1549
> URL: https://issues.apache.org/jira/browse/LANG-1549
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-lang/pull/535]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] coveralls commented on pull request #535: [LANG-1549] implement TODO in CharSequenceUtils.lastIndexOf : remake it.

2020-05-31 Thread GitBox


coveralls commented on pull request #535:
URL: https://github.com/apache/commons-lang/pull/535#issuecomment-636537530


   
   [![Coverage 
Status](https://coveralls.io/builds/31147261/badge)](https://coveralls.io/builds/31147261)
   
   Coverage decreased (-0.03%) to 95.01% when pulling 
**2def83c302b085b255f6b6e0ac17eb5e06cb3bbe on 
XenoAmess:refine_CharSequenceUtils** into 
**3d4ed4a8ac63db1e51601ffc31fed44dccbb276c on apache:master**.
   



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.

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




[jira] [Work logged] (LANG-1548) split regionMatches for better performance

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1548?focusedWorklogId=439292=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439292
 ]

ASF GitHub Bot logged work on LANG-1548:


Author: ASF GitHub Bot
Created on: 31/May/20 21:15
Start Date: 31/May/20 21:15
Worklog Time Spent: 10m 
  Work Description: coveralls commented on pull request #534:
URL: https://github.com/apache/commons-lang/pull/534#issuecomment-636531146


   
   [![Coverage 
Status](https://coveralls.io/builds/31146797/badge)](https://coveralls.io/builds/31146797)
   
   Coverage decreased (-0.008%) to 95.033% when pulling 
**52e35c872c7fa0a58afcd8c7738bdbba98ae4e7d on 
XenoAmess:split_regionMatches_for_better_performance** into 
**3d4ed4a8ac63db1e51601ffc31fed44dccbb276c on apache:master**.
   



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439292)
Remaining Estimate: 0h
Time Spent: 10m

> split regionMatches for better performance
> --
>
> Key: LANG-1548
> URL: https://issues.apache.org/jira/browse/LANG-1548
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-lang/pull/534/files]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] coveralls commented on pull request #534: [LANG-1548] split regionMatches for better performance

2020-05-31 Thread GitBox


coveralls commented on pull request #534:
URL: https://github.com/apache/commons-lang/pull/534#issuecomment-636531146


   
   [![Coverage 
Status](https://coveralls.io/builds/31146797/badge)](https://coveralls.io/builds/31146797)
   
   Coverage decreased (-0.008%) to 95.033% when pulling 
**52e35c872c7fa0a58afcd8c7738bdbba98ae4e7d on 
XenoAmess:split_regionMatches_for_better_performance** into 
**3d4ed4a8ac63db1e51601ffc31fed44dccbb276c on apache:master**.
   



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.

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




[GitHub] [commons-beanutils] garydgregory commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


garydgregory commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636531069


   Just wait. I have a query on the legal mailing list to check to see if we 
can reuse the Infinispan version of its concurrent weak key hash map, and since 
it is co-authored by Doug Lea it likely one of the better if not the best 
implementation out there.



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.

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




[GitHub] [commons-lang] garydgregory commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


garydgregory commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636530486


   @jochenw glad it worked for you.



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.

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




[jira] [Work logged] (LANG-1547) fix code smells; fix typos; performance refine(trying to)

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1547?focusedWorklogId=439290=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439290
 ]

ASF GitHub Bot logged work on LANG-1547:


Author: ASF GitHub Bot
Created on: 31/May/20 20:58
Start Date: 31/May/20 20:58
Worklog Time Spent: 10m 
  Work Description: coveralls commented on pull request #533:
URL: https://github.com/apache/commons-lang/pull/533#issuecomment-636529000


   
   [![Coverage 
Status](https://coveralls.io/builds/31146722/badge)](https://coveralls.io/builds/31146722)
   
   Coverage decreased (-0.004%) to 95.036% when pulling 
**62f744a7f25bc456354f23fb3e1b7455a4c53f7a on XenoAmess:fix_code_smells** into 
**3d4ed4a8ac63db1e51601ffc31fed44dccbb276c on apache:master**.
   



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439290)
Time Spent: 1h 40m  (was: 1.5h)

> fix code smells; fix typos; performance refine(trying to)
> -
>
> Key: LANG-1547
> URL: https://issues.apache.org/jira/browse/LANG-1547
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-lang/pull/533]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] coveralls commented on pull request #533: [LANG-1547] fix code smells; fix typos

2020-05-31 Thread GitBox


coveralls commented on pull request #533:
URL: https://github.com/apache/commons-lang/pull/533#issuecomment-636529000


   
   [![Coverage 
Status](https://coveralls.io/builds/31146722/badge)](https://coveralls.io/builds/31146722)
   
   Coverage decreased (-0.004%) to 95.036% when pulling 
**62f744a7f25bc456354f23fb3e1b7455a4c53f7a on XenoAmess:fix_code_smells** into 
**3d4ed4a8ac63db1e51601ffc31fed44dccbb276c on apache:master**.
   



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636524987


   my bad.
   I found the reason why it can't pass, it is my mistake.
   Now we can use `org.apache.commons.logging.impl.WeakHashtable ` to replace 
`FastWeakHashMap`.
   We can also use the ConcurrentWeakHashMap in 
https://issues.apache.org/jira/browse/HARMONY-6434 , but that class is from a 
strange place.
   
   It said it be from `package org.amino.ds.tmpMap;`, but I download amino from 
sourceforge at 
`https://sourceforge.net/projects/amino-cbbs/files/cbbs/1.0/amino-java-src-1.0.tar.gz/download`,
 and 1.0 is the greatest version number there, and found no class like this 
contained.
   
   Also, that lib is at apache license v2, so if we want to use it we must 
follow that license.
   Thus WeakHashtable might be the best choice here.
   
   Though I still think a ConcurrentWeakHashMap should have better 
performance... but WeakHashtable is far better than WeakFastHashMap.
   
   Only one more thing: WeakFastHashMap allows null key and null value(same as 
WeakHashMap do),
   but WeakHashtable does not allow null key nor null value(same as Hashtable 
do).
   
   So what should we do next?
   
   Actually there be several ways.
   
   1. use WeakHashtable for now, and accept the BC that it cannot have null 
key/value;
   
   2. wrap another layer for WeakHashtable, and make it support null key and 
null value that way;
   
   3. fork WeakHashtable, and change its source codes to make it support null 
key and null value that way;
   
   3. find something like a ConcurrentWeakHashMap, whitch is clean to use (both 
usage and license).
   
   4. create our own ConcurrentWeakHashMap class (not suggested but if give me 
a whole week I think I can do...)
   
   Which way should we enter?
   



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.

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




[GitHub] [commons-lang] asfgit closed pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


asfgit closed pull request #532:
URL: https://github.com/apache/commons-lang/pull/532


   



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.

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




[GitHub] [commons-lang] jochenw commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


jochenw commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636522760


   Thanks, Gary, that  helped.
   
   One more thing, though: I do not feel responsible for this one:
   
   [INFO] There is 1 error reported by Checkstyle 8.32 with src/site/reso
   urces/checkstyle/checkstyle.xml ruleset.
   [ERROR] target\maven-archiver\pom.properties:[1] (misc) NewlineAtEndOf
   File: Expected line ending for file is LF(\n), but CRLF(\r\n) is detected.
   
   Jochen
   
   On Sun, May 31, 2020 at 4:54 PM Gary Gregory  
wrote:
   >
   > Do this:
   >
   > git config core.autocrlf input
   > git checkout release
   > git checkout master
   > mvn checkstyle:check
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub, or unsubscribe.
   
   
   
   -- 
   
   Look, that's why there's rules, understand? So that you think before
   you break 'em.
   
   -- (Terry Pratchett, Thief of Time)
   



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.

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




[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-31 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120633#comment-17120633
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

bq. "icosphere"

Did you remove the "uv-sphere" implementation?

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1547) fix code smells; fix typos; performance refine(trying to)

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1547?focusedWorklogId=439281=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439281
 ]

ASF GitHub Bot logged work on LANG-1547:


Author: ASF GitHub Bot
Created on: 31/May/20 18:51
Start Date: 31/May/20 18:51
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on pull request #533:
URL: https://github.com/apache/commons-lang/pull/533#issuecomment-636512322


   the performance refines I said has being splited to [LANG-1548] and 
[LANG-1549]



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439281)
Time Spent: 1.5h  (was: 1h 20m)

> fix code smells; fix typos; performance refine(trying to)
> -
>
> Key: LANG-1547
> URL: https://issues.apache.org/jira/browse/LANG-1547
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-lang/pull/533]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] XenoAmess commented on pull request #533: [LANG-1547] fix code smells; fix typos

2020-05-31 Thread GitBox


XenoAmess commented on pull request #533:
URL: https://github.com/apache/commons-lang/pull/533#issuecomment-636512322


   the performance refines I said has being splited to [LANG-1548] and 
[LANG-1549]



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.

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




[jira] [Created] (LANG-1549) implement TODO in CharSequenceUtils.lastIndexOf : remake it.

2020-05-31 Thread JIN XU (Jira)
JIN XU created LANG-1549:


 Summary: implement TODO in CharSequenceUtils.lastIndexOf : remake 
it.
 Key: LANG-1549
 URL: https://issues.apache.org/jira/browse/LANG-1549
 Project: Commons Lang
  Issue Type: Improvement
Reporter: JIN XU


[https://github.com/apache/commons-lang/pull/535]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (LANG-1548) split regionMatches for better performance

2020-05-31 Thread JIN XU (Jira)
JIN XU created LANG-1548:


 Summary: split regionMatches for better performance
 Key: LANG-1548
 URL: https://issues.apache.org/jira/browse/LANG-1548
 Project: Commons Lang
  Issue Type: Improvement
Reporter: JIN XU


[https://github.com/apache/commons-lang/pull/534/files]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] XenoAmess opened a new pull request #535: implement TODO in CharSequenceUtils.lastIndexOf : remake it.

2020-05-31 Thread GitBox


XenoAmess opened a new pull request #535:
URL: https://github.com/apache/commons-lang/pull/535


   Hi.
   If this change is accectable then I will start CharSequenceUtils.indexOf 
using same way.
   Though, need there be more tests about this function?



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.

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




[GitHub] [commons-codec] coveralls edited a comment on pull request #46: Base16 Input and Output Streams

2020-05-31 Thread GitBox


coveralls edited a comment on pull request #46:
URL: https://github.com/apache/commons-codec/pull/46#issuecomment-616146181


   
   [![Coverage 
Status](https://coveralls.io/builds/31145020/badge)](https://coveralls.io/builds/31145020)
   
   Coverage increased (+0.1%) to 93.982% when pulling 
**4dae32ab3317a5b5ccb900d87d08d834fdd8c9fd on adamretter:base16** into 
**41c6f486fd4f5c2450c9311c40dbbf7e576d2907 on apache:master**.
   



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.

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




[GitHub] [commons-codec] XenoAmess commented on pull request #48: fix travis-ci scripts

2020-05-31 Thread GitBox


XenoAmess commented on pull request #48:
URL: https://github.com/apache/commons-codec/pull/48#issuecomment-636498741


   > I wonder if we need both openjdk11 and oraclejdk11 ?
   
   I thought it must be a reason to contain both in original travis-ci scripts, 
so I didn't remove any of them.



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.

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




[GitHub] [commons-codec] XenoAmess edited a comment on pull request #48: fix travis-ci scripts

2020-05-31 Thread GitBox


XenoAmess edited a comment on pull request #48:
URL: https://github.com/apache/commons-codec/pull/48#issuecomment-636498741


   > I wonder if we need both openjdk11 and oraclejdk11 ?
   
   I thought there must be a reason to contain both in original travis-ci 
scripts, so I didn't remove any of them.



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.

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




[GitHub] [commons-lang] coveralls edited a comment on pull request #530: LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format for List

2020-05-31 Thread GitBox


coveralls edited a comment on pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#issuecomment-629603951


   
   [![Coverage 
Status](https://coveralls.io/builds/31144338/badge)](https://coveralls.io/builds/31144338)
   
   Coverage increased (+0.0009%) to 95.092% when pulling 
**852f924c95b39b7f4b745f3b0f4d2872abf5aed5 on TranNgocKhoa:master** into 
**f6923510352fc3fbfad68bc6c5ac5258a34671b7 on apache:master**.
   



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.

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




[jira] [Work logged] (LANG-1542) ToStringBuilder.reflectionToString - Wrong JSON format when object has a List of Enum

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1542?focusedWorklogId=439260=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439260
 ]

ASF GitHub Bot logged work on LANG-1542:


Author: ASF GitHub Bot
Created on: 31/May/20 15:52
Start Date: 31/May/20 15:52
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#issuecomment-629603951


   
   [![Coverage 
Status](https://coveralls.io/builds/31144338/badge)](https://coveralls.io/builds/31144338)
   
   Coverage increased (+0.0009%) to 95.092% when pulling 
**852f924c95b39b7f4b745f3b0f4d2872abf5aed5 on TranNgocKhoa:master** into 
**f6923510352fc3fbfad68bc6c5ac5258a34671b7 on apache:master**.
   



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439260)
Time Spent: 1h 50m  (was: 1h 40m)

> ToStringBuilder.reflectionToString - Wrong JSON format when object has a List 
> of Enum
> -
>
> Key: LANG-1542
> URL: https://issues.apache.org/jira/browse/LANG-1542
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.10
> Environment: Open JDK 1.8
>Reporter: Trần Ngọc Khoa
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> I'm trying to log an object to console with JSON style using 
> {{ToStringBuilder.reflectionToString}} from {{commons-lang3:3.10}} but it 
> seems generated a wrong JSON format.
> Problem happening when I have a list of enums in my field list.
>  
> {code:java}
> This is the class:
>      public class Person {
>  private long id;
>  private String name;
>  private List listEnums;
> //getter and setter
> public String toString(){
>  return ToStringBuilder.reflectionToString(this, 
> ToStringStyle.JSON_STYLE); 
> }
> }
> {code}
>   
> And {{MyEnum}}:
> {code:java}
>  public enum MyEnum {
>  FOOD,
>  SPORT,
>  BOOK,
>  MUSIC
>  }{code}
> When I call {{toString()}} of Person object. It shows like this
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": [FRIDAY, MONDAY, TUESDAY]
>  }{code}
>   
> What I expected is:
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": ["FRIDAY", "MONDAY", "TUESDAY"]
>  }{code}
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-31 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120577#comment-17120577
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

I just added a PR containing the update {{Sphere.toTree}} approach: 
https://github.com/apache/commons-geometry/pull/78 (ie, "icosphere"). This 
uncovered a number of numerical robustness issues that I then addressed. We now 
have a unit test that creates a sphere approximation with over 500,000 boundary 
triangles.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-geometry] darkma773r opened a new pull request #78: GEOMETRY-95: Improving Sphere.toTree()

2020-05-31 Thread GitBox


darkma773r opened a new pull request #78:
URL: https://github.com/apache/commons-geometry/pull/78


   - Improving Sphere.toTree()
   - Removing use of HyperplaneSubset.Builder interface to improve performance 
and numerical robustness
   - Other updates to improve robustness with large BSP trees



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.

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




[GitHub] [commons-lang] garydgregory commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


garydgregory commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636481961


   Do this:
   ```
   git config core.autocrlf input
   git checkout release
   git checkout master
   mvn checkstyle:check
   ```
   



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.

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




[GitHub] [commons-beanutils] XenoAmess edited a comment on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess edited a comment on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636474232


   also here is some guy contributed a concurrent weak hash map too : 
https://issues.apache.org/jira/browse/HARMONY-6434?jql=text%20~%20%22concurrent%20weak%20hash%20map%22
   
it also fails test 
MemoryLeakTestCase.testLocaleConvertUtilsBean_converters_memoryLeak.



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.

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




[jira] [Updated] (COLLECTIONS-700) Add a ConcurrentWeakHashMap

2020-05-31 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory updated COLLECTIONS-700:

Assignee: Gary D. Gregory

> Add a ConcurrentWeakHashMap
> ---
>
> Key: COLLECTIONS-700
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-700
> Project: Commons Collections
>  Issue Type: New Feature
>  Components: Map
>Reporter: Gary D. Gregory
>Assignee: Gary D. Gregory
>Priority: Major
>
> Add a {{ConcurrentWeakHashMap}}: A concurrent 
> {{[WeakHashMap|https://docs.oracle.com/javase/8/docs/api/java/util/WeakHashMap.html]}}.
>  A need for this was found to best support BeanUtils's BEANUTILS-509
> This issue is looking for a volunteer.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636474232


   also here is some guy contributed a concurrent weak hash map too : 
https://issues.apache.org/jira/browse/HARMONY-6434?jql=text%20~%20%22concurrent%20weak%20hash%20map%22



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.

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




[GitHub] [commons-beanutils] XenoAmess edited a comment on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess edited a comment on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636470709


   > IIRC I think someone contributed a concurrent weak hash map either in this 
component or in commons-collections, there should be a JIRA ticket... AFK ATM...
   
   well `org.apache.commons.logging.impl.WeakHashtable` 's javadoc seems it be 
a good replacement of WeakFastHashMap here.
   
   but it fails test 
`MemoryLeakTestCase.testLocaleConvertUtilsBean_converters_memoryLeak`.
   I will try tracking it.
   
   `--`
   
   yes you are right, there be a jira ticket for a ConcurrentWeakHashMap, but 
nobody resolved it yet.
   https://issues.apache.org/jira/browse/COLLECTIONS-700



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636470709


   > IIRC I think someone contributed a concurrent weak hash map either in this 
component or in commons-collections, there should be a JIRA ticket... AFK ATM...
   
   well `org.apache.commons.logging.impl.WeakHashtable` 's javadoc seems it be 
a good replacement of WeakFastHashMap here.
   
   but it fails test 
`MemoryLeakTestCase.testLocaleConvertUtilsBean_converters_memoryLeak`.
   I will try tracking it.



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.

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




[GitHub] [commons-beanutils] garydgregory commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


garydgregory commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636466018


   IIRC I think someone contributed a concurrent weak hash map either in this 
component or in commons-collections, there should be a JIRA ticket... AFK ATM...



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.

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




[GitHub] [commons-beanutils] XenoAmess edited a comment on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess edited a comment on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636465013


   > If your app does not need synchronization, you can use the map in "fast" 
mode.
   
   @garydgregory 
   Thanks. usually we need synchronization, and even when I need weak reference 
I will never clone the whole map everytime putting a single key-value pair.
   I really doubt why we shall do it this way.
   ```
   (from WeakFastHashMap.java)
   @Override
   public V put(final K key, final V value) {
   if (fast) {
   synchronized (this) {
   final Map temp = cloneMap(map);
   final V result = temp.put(key, value);
   map = temp;
   return result;
   }
   }
   synchronized (map) {
   return map.put(key, value);
   }
   }
   ```
   Any suggestions?
   Should we make a counter and add 1 every time we put a key-value pair, and 
clone it only when the counter exceed some point?



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.

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




[GitHub] [commons-beanutils] XenoAmess edited a comment on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess edited a comment on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636465013


   > If your app does not need synchronization, you can use the map in "fast" 
mode.
   
   @garydgregory 
   Thanks. usually we need synchronization, and even when I need weak reference 
I will never clone the whole map everytime putting a single key-value pair.
   I really doubt why we shall do it this way.
   ```
   @Override
   public V put(final K key, final V value) {
   if (fast) {
   synchronized (this) {
   final Map temp = cloneMap(map);
   final V result = temp.put(key, value);
   map = temp;
   return result;
   }
   }
   synchronized (map) {
   return map.put(key, value);
   }
   }
   ```
   Any suggestions?
   Should we make a counter and add 1 every time we put a key-value pair, and 
clone it only when the counter exceed some point?



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636465013


   > If your app does not need synchronization, you can use the map in "fast" 
mode.
   
   Thanks. usually we need synchronization, and even when I need weak reference 
I will never clone the whole map everytime putting a single key-value pair.
   I really doubt why we shall do it this way.
   ```
   @Override
   public V put(final K key, final V value) {
   if (fast) {
   synchronized (this) {
   final Map temp = cloneMap(map);
   final V result = temp.put(key, value);
   map = temp;
   return result;
   }
   }
   synchronized (map) {
   return map.put(key, value);
   }
   }
   ```
   Any suggestions?
   Should we make a counter and add 1 every time we put a key-value pair, and 
clone it only when the counter exceed some point?



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636464477


   @garydgregory is org.apache.commons.logging.impl.WeakHashtable a better 
replacement of WeakFastHashMap in this cases?



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.

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




[GitHub] [commons-beanutils] garydgregory commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


garydgregory commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636463974


   If your app does not need synchronization, you can use the map in "fast" 
mode.



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.

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




[jira] [Resolved] (IO-669) fix code smells; fix typos

2020-05-31 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory resolved IO-669.

Fix Version/s: 2.7.1
   Resolution: Fixed

Please review and close.

 

> fix code smells; fix typos 
> ---
>
> Key: IO-669
> URL: https://issues.apache.org/jira/browse/IO-669
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
> Fix For: 2.7.1
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/115]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-669) fix code smells; fix typos

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-669?focusedWorklogId=439224=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439224
 ]

ASF GitHub Bot logged work on IO-669:
-

Author: ASF GitHub Bot
Created on: 31/May/20 12:11
Start Date: 31/May/20 12:11
Worklog Time Spent: 10m 
  Work Description: garydgregory merged pull request #115:
URL: https://github.com/apache/commons-io/pull/115


   



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.

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


Issue Time Tracking
---

Worklog Id: (was: 439224)
Time Spent: 50m  (was: 40m)

> fix code smells; fix typos 
> ---
>
> Key: IO-669
> URL: https://issues.apache.org/jira/browse/IO-669
> Project: Commons IO
>  Issue Type: Improvement
>Reporter: JIN XU
>Priority: Minor
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/commons-io/pull/115]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] garydgregory merged pull request #115: [IO-669] Fix code smells; fix typos

2020-05-31 Thread GitBox


garydgregory merged pull request #115:
URL: https://github.com/apache/commons-io/pull/115


   



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.

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




[GitHub] [commons-beanutils] XenoAmess closed pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess closed pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27


   



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636462475


   > -1. Do you understand the difference between a weak and strong reference 
in a map? Do you you know what will happen if you install this change in an 
application that keeps putting new keys in the map and then not keep references 
to them?
   
   So weak reference is important here? Fine.
   Seems we need a ConcurrentWeakHashMap here.
   I will try to implement it, or at least do some refines on the current one.
   Willl close this pr and reopen when it finished.
   
   



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.

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




[jira] [Resolved] (COMPRESS-532) Decompression fails with IllegalArgumentException(BinaryTree.java:72)

2020-05-31 Thread Stefan Bodewig (Jira)


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

Stefan Bodewig resolved COMPRESS-532.
-
Fix Version/s: 1.21
   Resolution: Fixed

fixed with commit 6bbc7cb1

> Decompression fails with IllegalArgumentException(BinaryTree.java:72)
> -
>
> Key: COMPRESS-532
> URL: https://issues.apache.org/jira/browse/COMPRESS-532
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Maksim Zuev
>Priority: Major
> Fix For: 1.21
>
> Attachments: IllegalArgumentException.zip
>
>
> This Kotlin code fails with exception(IllegalArgumentException.zip is in the 
> attachments)
> Exception in thread "main" java.lang.IllegalArgumentException: Tree value at 
> index 3 has already been assigned (-2)
>  at 
> org.apache.commons.compress.archivers.zip.BinaryTree.addLeaf(BinaryTree.java:72)
>  at 
> org.apache.commons.compress.archivers.zip.BinaryTree.addLeaf(BinaryTree.java:80)
>  at 
> org.apache.commons.compress.archivers.zip.BinaryTree.addLeaf(BinaryTree.java:80)
>  at 
> org.apache.commons.compress.archivers.zip.BinaryTree.decode(BinaryTree.java:199)
>  at 
> org.apache.commons.compress.archivers.zip.ExplodingInputStream.init(ExplodingInputStream.java:104)
>  at 
> org.apache.commons.compress.archivers.zip.ExplodingInputStream.fillBuffer(ExplodingInputStream.java:158)
>  at 
> org.apache.commons.compress.archivers.zip.ExplodingInputStream.read(ExplodingInputStream.java:119)
>  at java.base/java.io.InputStream.read(InputStream.java:271)
>  at 
> org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.read(ZipArchiveInputStream.java:493)
>  at java.base/java.io.InputStream.readNBytes(InputStream.java:396)
>  at java.base/java.io.InputStream.readAllBytes(InputStream.java:333)
>  at kotlinx.fuzzer.tests.MainKt.main(main.kt:10)
>  at kotlinx.fuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("IllegalArgumentException.zip")
> ArchiveStreamFactory().createArchiveInputStream("zip", 
> tar.inputStream()).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> Expected some other exception as IOException is the only declared.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (COMPRESS-531) Tar decompression fails with NullPointerException

2020-05-31 Thread Stefan Bodewig (Jira)


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

Stefan Bodewig resolved COMPRESS-531.
-
Fix Version/s: 1.21
   Resolution: Fixed

> Tar decompression fails with NullPointerException
> -
>
> Key: COMPRESS-531
> URL: https://issues.apache.org/jira/browse/COMPRESS-531
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Maksim Zuev
>Priority: Major
> Fix For: 1.21
>
> Attachments: NPE.tar
>
>
> This Kotlin code fails with exception(NPE.tar is in the attachment)
> Exception in thread "main" java.lang.NullPointerException
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.applyPaxHeadersToCurrentEntry(TarArchiveInputStream.java:757)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.paxHeaders(TarArchiveInputStream.java:562)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:404)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:799)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:20)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("NPE.tar")
> ArchiveStreamFactory().createArchiveInputStream("tar", 
> tar.inputStream()).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> IOException expected



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (COMPRESS-531) Tar decompression fails with NullPointerException

2020-05-31 Thread Stefan Bodewig (Jira)


[ 
https://issues.apache.org/jira/browse/COMPRESS-531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120514#comment-17120514
 ] 

Stefan Bodewig commented on COMPRESS-531:
-

Thanks to the fix of COMPRESS-530 the archive now causes an {{IOException}} 
anyway. With commit e4eccde3 I've also removed the cause of the NPE.

> Tar decompression fails with NullPointerException
> -
>
> Key: COMPRESS-531
> URL: https://issues.apache.org/jira/browse/COMPRESS-531
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Maksim Zuev
>Priority: Major
> Attachments: NPE.tar
>
>
> This Kotlin code fails with exception(NPE.tar is in the attachment)
> Exception in thread "main" java.lang.NullPointerException
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.applyPaxHeadersToCurrentEntry(TarArchiveInputStream.java:757)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.paxHeaders(TarArchiveInputStream.java:562)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:404)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:799)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:20)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("NPE.tar")
> ArchiveStreamFactory().createArchiveInputStream("tar", 
> tar.inputStream()).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> IOException expected



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-beanutils] melloware commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


melloware commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636458210


   @garydgregory I am having a hard time resyncing my fork all the sudden. I am 
getting this error "! refs/heads/master:refs/heads/master [remote rejected] 
(refusing to allow an OAuth App to create or update workflow 
`.github/workflows/maven.yml` without `workflow` scope)
   "



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.

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




[jira] [Commented] (COMPRESS-528) Tar decompression - Inconsistent entry size

2020-05-31 Thread Stefan Bodewig (Jira)


[ 
https://issues.apache.org/jira/browse/COMPRESS-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120508#comment-17120508
 ] 

Stefan Bodewig commented on COMPRESS-528:
-

I'm not sure your expectation is correct. {{getSize}} returns what an entry's 
metadata says, not necessarily what can be read. I'm not sure we are consistent 
here across the formats. In some of them we throw exceptions if the actual 
numbers don't match, in others - like tar - we silently accept it.

Changing something here could mean we'd start throwing exceptions for archives 
where we have not done so, so far. Also one needs to think about what happens 
if the content is never read like in code just invoking {{getNextEntry}} 
repeatedly in order to list the contents, for example.

> Tar decompression - Inconsistent entry size
> ---
>
> Key: COMPRESS-528
> URL: https://issues.apache.org/jira/browse/COMPRESS-528
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Maksim Zuev
>Priority: Major
> Attachments: InconsistentSize.tar
>
>
> Expected that 
> {{[getSize|https://commons.apache.org/proper/commons-compress/javadocs/api-1.20/org/apache/commons/compress/archivers/tar/TarArchiveEntry.html#getSize--]()
>  }}returns the size of byte array read from ArchiveInputStream
> To reproduce run this Kotlin code(InconsistentSize.tar is in the attachment). 
> It fails with exception
> Exception in thread "main" java.lang.IllegalStateException: 19 expected but 0 
> found
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:82)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("InconsistentSize.tar")
> ArchiveStreamFactory().createArchiveInputStream("tar", 
> tar.inputStream()).use { ais ->
> val expected = ais.nextEntry.size
> val actual = ais.readAllBytes().size.toLong()
> check(expected == actual) { "$expected expected but $actual found" }
> }
> }
> {code}
> {{}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-beanutils] garydgregory commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


garydgregory commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636457473


   -1. Do you understand the difference between a weak and strong reference in 
a map? Do you you know what will happen if you install this change in an 
application that keeps putting new keys in the map and then not keep references 
to them?



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636457266


   > Looks like you have some merge conflicts?
   
   Sorry for that. will fix it immediately.
   
   > Also I think this will resolve BEANUTILS-509: #21
   
   I had no experience in using function Collections.synchronizedMap(), so I 
cannot tell about performance about that.
   Though I think this pr and that one are solving similiar things, though 
BEANUTILS-509 focus more on thread-safe, and this pr focus more on performance.
   And IMO if using ConcurrentHashMap, we can gain both thread-safe and 
performance.
   



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636457321


   detailed output of Jprofile is attached at link : 
https://issues.apache.org/jira/browse/BEANUTILS-539



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.

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




[jira] [Resolved] (COMPRESS-530) Tar decompression fails with NegativeArraySizeException

2020-05-31 Thread Stefan Bodewig (Jira)


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

Stefan Bodewig resolved COMPRESS-530.
-
Fix Version/s: 1.21
   Resolution: Fixed

> Tar decompression fails with NegativeArraySizeException
> ---
>
> Key: COMPRESS-530
> URL: https://issues.apache.org/jira/browse/COMPRESS-530
> Project: Commons Compress
>  Issue Type: Bug
>Reporter: Maksim Zuev
>Priority: Major
> Fix For: 1.21
>
> Attachments: NegativeArraySizeException.tar
>
>
> This Kotlin code fails with exception(NegativeArraySizeException.tar is in 
> the attachment)
> Exception in thread "main" java.lang.NegativeArraySizeException: -5332783
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.parsePaxHeaders(TarArchiveInputStream.java:703)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.paxHeaders(TarArchiveInputStream.java:555)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:404)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:799)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:31)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("NegativeArraySizeException.tar")
> ArchiveStreamFactory().createArchiveInputStream("tar", 
> tar.inputStream()).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> IOException expected



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (COMPRESS-529) Tar decompression fails with runtime exceptions

2020-05-31 Thread Stefan Bodewig (Jira)


[ 
https://issues.apache.org/jira/browse/COMPRESS-529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120506#comment-17120506
 ] 

Stefan Bodewig commented on COMPRESS-529:
-

At least the two of us share the same misunderstanding, then :)

If anything is wrong with a stream we read, we should always try to turn this 
into an {{IOException}}. This is something we don't always do, obviously, as 
[~zuevmaxim] 's issues show. When writing things are a bit different as we can 
expect the user to only hand us valid inputs IMHO.

The second issue here must expect errors as this is what 
{{TarArchiveOutputStream}} does for file names that are too long or numbers 
that are too big unless you tell it otherwise - and this is documented.

I agree we should turn the exceptions into {{IllegalArgumentException}}s - and 
document them at the public APIs that may throw them. Any client code that 
catches {{RuntimeException}}s now will automatically catch 
{{IllegalArgumentException}} as well, so we are on the safe side.

> Tar decompression fails with runtime exceptions
> ---
>
> Key: COMPRESS-529
> URL: https://issues.apache.org/jira/browse/COMPRESS-529
> Project: Commons Compress
>  Issue Type: Bug
>Affects Versions: 1.20
>Reporter: Maksim Zuev
>Priority: Major
> Attachments: LongName.tar, NumberFormatException.tar, japicmp.html, 
> japicmp.html
>
>
> This Kotlin code fails with exception(NumberFormatException.tar is in the 
> attachment)
> Exception in thread "main" java.lang.NumberFormatException: For input string: 
> "143266�921.098285006"
>  at 
> java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
>  at 
> java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
>  at java.base/java.lang.Double.parseDouble(Double.java:543)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.processPaxHeader(TarArchiveEntry.java:1161)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.updateEntryFromPaxHeaders(TarArchiveEntry.java:1093)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.applyPaxHeadersToCurrentEntry(TarArchiveInputStream.java:757)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.paxHeaders(TarArchiveInputStream.java:562)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:404)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:799)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:69)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("NumberFormatException.tar")
> ArchiveStreamFactory().createArchiveInputStream("tar", 
> tar.inputStream()).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> This Kotlin code fails with exception(LongName.tar is in the attachment)
> Exception in thread "main" java.lang.RuntimeException: file name 'asidhuasih a
>  sdjn osdn 
>  sdvs ndv
>  asdjbhasdb asb iasbfi basdigf basduio 
>  asdkhasjdhasd
>  asdjkhasnjddjasjdas
>  /?' is too long ( > 100 bytes)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.handleLongName(TarArchiveOutputStream.java:683)
>  at 
> org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.putArchiveEntry(TarArchiveOutputStream.java:358)
>  at ru.example.kotlinfuzzer.tests.MainKt.test(main.kt:20)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:8)
>  at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import org.apache.commons.compress.archivers.tar.TarArchiveEntry
> import java.io.File
> fun main() {
> test(File("LongName.tar"))
> }
> fun test(tar: File) {
> val (decompressed, name) = 
> ArchiveStreamFactory().createArchiveInputStream("tar", tar.inputStream()).use 
> { ais ->
> val entry = ais.nextEntry
> ais.readAllBytes() to entry.name
> }
> File.createTempFile("apache_", ".tar").also {
> ArchiveStreamFactory().createArchiveOutputStream("tar", 
> it.outputStream()).use { aos ->
> val entry = TarArchiveEntry(name)
> entry.size = decompressed.size.toLong()
> aos.putArchiveEntry(entry)
> try {
> aos.write(decompressed)
> } finally {
> aos.closeArchiveEntry()
> }
> }
> }
> }
> {code}
>  
> IOException expected



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-beanutils] melloware commented on pull request #23: Formatted source code using Apache Commons standards.

2020-05-31 Thread GitBox


melloware commented on pull request #23:
URL: https://github.com/apache/commons-beanutils/pull/23#issuecomment-636456327


   Closing this PR.  Will create a new one



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.

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




[GitHub] [commons-beanutils] melloware closed pull request #23: Formatted source code using Apache Commons standards.

2020-05-31 Thread GitBox


melloware closed pull request #23:
URL: https://github.com/apache/commons-beanutils/pull/23


   



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.

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




[GitHub] [commons-beanutils] melloware commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


melloware commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636456188


   Looks like you have some merge conflicts?
   
   Also I think this will resolve BEANUTILS-509: 
https://github.com/apache/commons-beanutils/pull/21



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.

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




[GitHub] [commons-lang] jochenw commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


jochenw commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636442299


   Hi,
   
   could someone please advise me, what I am doing wring here? Trying to pull
   this in:
   
   git clone https://gitbox.apache.org/repos/asf/commons-lang.git
   cd commons-lang
   git config core.autocrlf true
   git remote add github https://github.com/apache/commons-lang.git
   git fetch github pull/532:pr/532
   git merge pr/532
   mvn
   
   
   
   You have 345 Checkstyle violations.
   
   
   
   On Sat, May 30, 2020 at 4:33 PM XenoAmess  wrote:
   
   > Hi.
   > commit c141bc9
   > 

   > broke the Checkstyle, thus making travis-ci cannot pass.
   > thus I made a commit to fix it.
   > --
   > You can view, comment on, or merge this pull request online at:
   >
   >   https://github.com/apache/commons-lang/pull/532
   > Commit Summary
   >
   >- reformat Locks and LocksTest for passing Checkstyle
   >
   > File Changes
   >
   >- *M* src/main/java/org/apache/commons/lang3/Locks.java
   >

   >(94)
   >- *M* src/test/java/org/apache/commons/lang3/LocksTest.java
   >

   >(95)
   >
   > Patch Links:
   >
   >- https://github.com/apache/commons-lang/pull/532.patch
   >- https://github.com/apache/commons-lang/pull/532.diff
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > , or unsubscribe
   > 

   > .
   >
   
   
   -- 
   
   Look, that's why there's rules, understand? So that you think before
   you break 'em.
   
   -- (Terry Pratchett, Thief of Time)
   



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.

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




[GitHub] [commons-lang] XenoAmess commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


XenoAmess commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636434614


   > > > I got a build error when update my pull request today. What should I 
do?
   > > > Link: #530
   > > 
   > > 
   > > your build passed, but check style failed.
   > > and check style failed because of what I fixed in this pr.
   > > (sigh) you might wait for committers to merge this pr and everything 
will be fine IMO.
   > 
   > Thank you!
   > I created the pull request to fix my problem when using `commons-lang` but 
they haven't accepted it (sigh...).
   
   Wait with patience.
   Committers are busy, as reviewing changes always takes more time than commit 
changes.
   And consider about there are far more prs than reviewers exist.
   
   (embarrassed to admit but recently I put lots of "junk-pr"s which just do 
some clean-up/typofix but might cause people consume more time than expected 
in.  Sorry about that.)



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.

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




[GitHub] [commons-lang] XenoAmess opened a new pull request #534: split regionMatches for better performance

2020-05-31 Thread GitBox


XenoAmess opened a new pull request #534:
URL: https://github.com/apache/commons-lang/pull/534


   



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.

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




[GitHub] [commons-lang] TranNgocKhoa commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


TranNgocKhoa commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636433876


   > > I got a build error when update my pull request today. What should I do?
   > > Link: #530
   > 
   > your build passed, but check style failed.
   > and check style failed because of what I fixed in this pr.
   > (sigh) you might wait for committers to merge this pr and everything will 
be fine IMO.
   
   Thank you!
   I created the pull request to fix my problem when using `commons-lang` but 
they haven't accepted it (sigh...).



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.

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




[GitHub] [commons-beanutils] XenoAmess commented on pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess commented on pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27#issuecomment-636433256


   feel free to ask for changes about this test, I will help to run it.
   Then we decide whether change usage of WeakHashMap to CuncurrentHashMap, or 
remain what it looks like for now.
   



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.

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




[jira] [Updated] (BEANUTILS-539) use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread JIN XU (Jira)


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

JIN XU updated BEANUTILS-539:
-
Description: 
Hi.

throughtout my performance test (using Jprofiler), I found out WeakHashMap is 
far slower than ConcurrentHashMap.

Should we use ConcurrentHashMap instead of WeakHashMap?

I will attach my test codes here.
{code:java}
/*
 * 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.beanutils2;

import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;

/**
 * A customized implementation of {@code java.util.HashMap} designed
 * to operate in a multi-threaded environment where the large majority of
 * method calls are read-only, instead of structural changes.  When operating
 * in "fast" mode, read calls are non-synchronized and write calls perform the
 * following steps:
 * 
 * Clone the existing collection
 * Perform the modification on the clone
 * Replace the existing collection with the (modified) clone
 * 
 * When first created, objects of this class default to "slow" mode, where
 * all accesses of any type are synchronized but no cloning takes place.  This
 * is appropriate for initially populating the collection, followed by a switch
 * to "fast" mode (by calling {@code setFast(true)}) after initialization
 * is complete.
 *
 * NOTE: If you are creating and accessing a
 * {@code HashMap} only within a single thread, you should use
 * {@code java.util.HashMap} directly (with no synchronization), for
 * maximum performance.
 *
 * NOTE: This class is not cross-platform.
 * Using it may cause unexpected failures on some architectures.
 * It suffers from the same problems as the double-checked locking idiom.
 * In particular, the instruction that clones the internal collection and the
 * instruction that sets the internal reference to the clone can be executed
 * or perceived out-of-order.  This means that any read operation might fail
 * unexpectedly, as it may be reading the state of the internal collection
 * before the internal collection is fully formed.
 * For more information on the double-checked locking idiom, see the
 * http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html;>
 * Double-Checked Locking Idiom Is Broken Declaration.
 *
 * @since Commons Collections 1.0
 */
public class WeakFastHashMap extends HashMap {

private static final long serialVersionUID = 1L;

/**
 * The underlying map we are managing.
 */
private volatile Map map = null;

/**
 * Are we currently operating in "fast" mode?
 */
private boolean fast = false;

// Constructors


/**
 * Construct an empty map.
 */
public WeakFastHashMap() {
super();
this.map = createMap();
}

/**
 * Construct an empty map with the specified capacity.
 *
 * @param capacity  the initial capacity of the empty map
 */
public WeakFastHashMap(final int capacity) {
super();
this.map = createMap(capacity);
}

/**
 * Construct an empty map with the specified capacity and load factor.
 *
 * @param capacity  the initial capacity of the empty map
 * @param factor  the load factor of the new map
 */
public WeakFastHashMap(final int capacity, final float factor) {
super();
this.map = createMap(capacity, factor);
}

/**
 * Construct a new map with the same mappings as the specified map.
 *
 * @param map  the map whose mappings are to be copied
 */
public WeakFastHashMap(final Map map) {
super();
this.map = createMap(map);
}

// Property access


/**
 *  Returns true if this map is operating in fast mode.
 *
 *  @return true if this map is operating in fast mode
 */
public boolean getFast() {
return this.fast;
}

/**
 *  Sets whether this map is operating in fast mode.
 *
 *  @param fast true if this map should operate in fast mode
 */
public void setFast(final 

[GitHub] [commons-beanutils] XenoAmess opened a new pull request #27: [BEANUTILS-539] use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread GitBox


XenoAmess opened a new pull request #27:
URL: https://github.com/apache/commons-beanutils/pull/27


   throughtout my performance test (using Jprofiler), I found out WeakHashMap 
is far slower than ConcurrentHashMap.
   add tests to show how slow it is.
   please run it using Jprofiler or other tools to see cpu call tree.



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.

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




[jira] [Updated] (BEANUTILS-539) use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread JIN XU (Jira)


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

JIN XU updated BEANUTILS-539:
-
Description: 
Hi.

throughtout my performance test (using Jprofiler), I found out WeakHashMap is 
far slower than ConcurrentHashMap.

Should we use ConcurrentHashMap instead of WeakHashMap?

I will attach my test codes here.
{code:java}
/*
 * 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.beanutils2;

import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;

/**
 * A customized implementation of {@code java.util.HashMap} designed
 * to operate in a multi-threaded environment where the large majority of
 * method calls are read-only, instead of structural changes.  When operating
 * in "fast" mode, read calls are non-synchronized and write calls perform the
 * following steps:
 * 
 * Clone the existing collection
 * Perform the modification on the clone
 * Replace the existing collection with the (modified) clone
 * 
 * When first created, objects of this class default to "slow" mode, where
 * all accesses of any type are synchronized but no cloning takes place.  This
 * is appropriate for initially populating the collection, followed by a switch
 * to "fast" mode (by calling {@code setFast(true)}) after initialization
 * is complete.
 *
 * NOTE: If you are creating and accessing a
 * {@code HashMap} only within a single thread, you should use
 * {@code java.util.HashMap} directly (with no synchronization), for
 * maximum performance.
 *
 * NOTE: This class is not cross-platform.
 * Using it may cause unexpected failures on some architectures.
 * It suffers from the same problems as the double-checked locking idiom.
 * In particular, the instruction that clones the internal collection and the
 * instruction that sets the internal reference to the clone can be executed
 * or perceived out-of-order.  This means that any read operation might fail
 * unexpectedly, as it may be reading the state of the internal collection
 * before the internal collection is fully formed.
 * For more information on the double-checked locking idiom, see the
 * http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html;>
 * Double-Checked Locking Idiom Is Broken Declaration.
 *
 * @since Commons Collections 1.0
 */
public class WeakFastHashMap extends HashMap {

private static final long serialVersionUID = 1L;

/**
 * The underlying map we are managing.
 */
private volatile Map map = null;

/**
 * Are we currently operating in "fast" mode?
 */
private boolean fast = false;

// Constructors


/**
 * Construct an empty map.
 */
public WeakFastHashMap() {
super();
this.map = createMap();
}

/**
 * Construct an empty map with the specified capacity.
 *
 * @param capacity  the initial capacity of the empty map
 */
public WeakFastHashMap(final int capacity) {
super();
this.map = createMap(capacity);
}

/**
 * Construct an empty map with the specified capacity and load factor.
 *
 * @param capacity  the initial capacity of the empty map
 * @param factor  the load factor of the new map
 */
public WeakFastHashMap(final int capacity, final float factor) {
super();
this.map = createMap(capacity, factor);
}

/**
 * Construct a new map with the same mappings as the specified map.
 *
 * @param map  the map whose mappings are to be copied
 */
public WeakFastHashMap(final Map map) {
super();
this.map = createMap(map);
}

// Property access


/**
 *  Returns true if this map is operating in fast mode.
 *
 *  @return true if this map is operating in fast mode
 */
public boolean getFast() {
return this.fast;
}

/**
 *  Sets whether this map is operating in fast mode.
 *
 *  @param fast true if this map should operate in fast mode
 */
public void setFast(final 

[GitHub] [commons-lang] XenoAmess commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


XenoAmess commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636432421


   > I got a build error when update my pull request today. What should I do?
   > Link: #530
   
   your build passed, but check style failed.
   and check style failed because of what I fixed in this pr.
   (sigh) you might wait for committers to merge this pr and everything will be 
fine IMO.



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.

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




[jira] [Commented] (EMAIL-193) use ConcurrentHashMap insteadof WeakHashMap

2020-05-31 Thread JIN XU (Jira)


[ 
https://issues.apache.org/jira/browse/EMAIL-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120440#comment-17120440
 ] 

JIN XU commented on EMAIL-193:
--

Sorry this is a misoperation.

this bug shall be commited to commons-BeanUtils not commons-Email.

close it.

> use ConcurrentHashMap insteadof WeakHashMap
> ---
>
> Key: EMAIL-193
> URL: https://issues.apache.org/jira/browse/EMAIL-193
> Project: Commons Email
>  Issue Type: Improvement
> Environment: win10, jdk8
>Reporter: JIN XU
>Priority: Minor
>
> Hi.
> throughtout my performance test (using Jprofiler), I found out WeakHashMap is 
> far slower than ConcurrentHashMap.
> Should we use ConcurrentHashMap instead of WeakHashMap?
> I will attach my test codes here.
> {code:java}
> /*
>  * 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.
>  */import org.apache.commons.beanutils2.WeakFastHashMap;import 
> java.util.Objects;
> import java.util.Random;
> import java.util.TreeSet;
> import java.util.concurrent.ConcurrentHashMap;public class 
> WeakFastHashMapTest {
> static final TreeSet treeSet = new TreeSet<>();
> static final Random random = new Random();
> static final WeakFastHashMap weakFastHashMap = new 
> WeakFastHashMap<>();
> static final ConcurrentHashMap concurrentHashMap = new 
> ConcurrentHashMap<>();static final int INIT_SIZE = 5;
> static final double WRITE_CHANCE = 0.01;
> static final double READ_NON_EXIST_CHANCE = 0.30;public static void 
> main(String[] args) {
> for (int i = 0; i < INIT_SIZE; i++) {
> writeRandom();
> }
> System.out.println("init over");
> weakFastHashMap.setFast(true);for (int i = 0; ; i++) {
> if (i % 10 == 0) {
> System.out.println("running> i : " + i + " size: " + 
> treeSet.size());
> }
> double ifWrite = random.nextDouble();
> if (ifWrite < WRITE_CHANCE) {
> writeRandom();
> } else {
> double ifNonExist = random.nextDouble();
> if (ifNonExist < READ_NON_EXIST_CHANCE) {
> readNonExist();
> } else {
> readExist();
> }
> }
> }
> }public static void writeRandom() {
> Integer nowKey = random.nextInt() * random.nextInt();
> Integer nowValue = random.nextInt() * random.nextInt();
> treeSet.add(nowKey);
> weakFastHashMap.put(nowKey, nowValue);
> concurrentHashMap.put(nowKey, nowValue);
> }public static void readExist() {
> Integer nowKey = null;
> while (nowKey == null) {
> nowKey = treeSet.lower(random.nextInt() * random.nextInt());
> }
> read(nowKey);
> }public static void readNonExist() {
> Integer nowKey = random.nextInt() * random.nextInt();
> while (treeSet.contains(nowKey)) {
> nowKey = random.nextInt() * random.nextInt();
> }
> read(nowKey);
> }public static void read(Integer nowKey) {
> Integer value1 = weakFastHashMap.get(nowKey);
> Integer value2 = concurrentHashMap.get(nowKey);
> if (!Objects.equals(value1, value2)) {
> System.out.println("not equal!  nowKey : " + nowKey + " value1 : 
> " + value1 + " value2 : " + value2);
> }
> }
> }
> {code}
> and, Jprofiler Call Tree:
> h2. Call Tree
> |*Session:*|WeakFastHashMapTest|
> |*Time of export:*|Sunday, May 31, 2020 2:56:14 PM CST|
> |*JVM time:*|12:23|
> | | |
> |*View mode:* |Tree|
> |*Thread selection:* | vspace="0" src=" jprofiler_images/selector_group_16.png"> All thread groups|
> |*Thread status:* | vspace="0" src=" jprofiler_images/ff00c400_bff00.png"> Runnable|
> |*Aggregation level:* |Methods|
> 
>  
> |!jprofiler_images/tree/menu_tee_minus_18.gif|width=18,height=18,align=left!!jprofiler_images/call_method_16_filter_underlay_16.png|width=16,height=16,align=left!
>    
> 

[jira] [Created] (BEANUTILS-539) use ConcurrentHashMap insteadof WeakFastHashMap

2020-05-31 Thread JIN XU (Jira)
JIN XU created BEANUTILS-539:


 Summary: use ConcurrentHashMap insteadof WeakFastHashMap
 Key: BEANUTILS-539
 URL: https://issues.apache.org/jira/browse/BEANUTILS-539
 Project: Commons BeanUtils
  Issue Type: Improvement
Reporter: JIN XU


Hi.

throughtout my performance test (using Jprofiler), I found out WeakHashMap is 
far slower than ConcurrentHashMap.

Should we use ConcurrentHashMap instead of WeakHashMap?

I will attach my test codes here.
{code:java}
/*
 * 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.
 */import org.apache.commons.beanutils2.WeakFastHashMap;import 
java.util.Objects;
import java.util.Random;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;public class WeakFastHashMapTest {
static final TreeSet treeSet = new TreeSet<>();
static final Random random = new Random();
static final WeakFastHashMap weakFastHashMap = new 
WeakFastHashMap<>();
static final ConcurrentHashMap concurrentHashMap = new 
ConcurrentHashMap<>();static final int INIT_SIZE = 5;
static final double WRITE_CHANCE = 0.01;
static final double READ_NON_EXIST_CHANCE = 0.30;public static void 
main(String[] args) {
for (int i = 0; i < INIT_SIZE; i++) {
writeRandom();
}
System.out.println("init over");weakFastHashMap.setFast(true);  
  for (int i = 0; ; i++) {
if (i % 10 == 0) {
System.out.println("running> i : " + i + " size: " + 
treeSet.size());
}
double ifWrite = random.nextDouble();
if (ifWrite < WRITE_CHANCE) {
writeRandom();
} else {
double ifNonExist = random.nextDouble();
if (ifNonExist < READ_NON_EXIST_CHANCE) {
readNonExist();
} else {
readExist();
}
}
}
}public static void writeRandom() {
Integer nowKey = random.nextInt() * random.nextInt();
Integer nowValue = random.nextInt() * random.nextInt();
treeSet.add(nowKey);
weakFastHashMap.put(nowKey, nowValue);
concurrentHashMap.put(nowKey, nowValue);
}public static void readExist() {
Integer nowKey = null;
while (nowKey == null) {
nowKey = treeSet.lower(random.nextInt() * random.nextInt());
}
read(nowKey);
}public static void readNonExist() {
Integer nowKey = random.nextInt() * random.nextInt();
while (treeSet.contains(nowKey)) {
nowKey = random.nextInt() * random.nextInt();
}
read(nowKey);
}public static void read(Integer nowKey) {
Integer value1 = weakFastHashMap.get(nowKey);
Integer value2 = concurrentHashMap.get(nowKey);
if (!Objects.equals(value1, value2)) {
System.out.println("not equal!  nowKey : " + nowKey + " value1 : " 
+ value1 + " value2 : " + value2);
}
}
}
{code}
and, Jprofiler Call Tree:
h2. Call Tree
|*Session:*|WeakFastHashMapTest|
|*Time of export:*|Sunday, May 31, 2020 2:56:14 PM CST|
|*JVM time:*|12:23|
| | |
|*View mode:* |Tree|
|*Thread selection:* | All thread groups|
|*Thread status:* | Runnable|
|*Aggregation level:* |Methods|

 
|!jprofiler_images/tree/menu_tee_minus_18.gif|width=18,height=18,align=left!!jprofiler_images/call_method_16_filter_underlay_16.png|width=16,height=16,align=left!
    
!jprofiler_images/pixel_ff99.png|width=49,height=7,vspace=2!!jprofiler_images/pixel_3300.png|width=1,height=7,vspace=2!
   100.0% - 743 s - 1 inv. WeakFastHashMapTest.main|
|!jprofiler_images/tree/menu_bar_18.gif|width=18,height=18,align=left!!jprofiler_images/tree/menu_tee_minus_18.gif|width=18,height=18,align=left!!jprofiler_images/call_method_16.png|width=16,height=16,align=left!
    
!jprofiler_images/pixel_ff99.png|width=48,height=7,vspace=2!!jprofiler_images/pixel_3300.png|height=7,vspace=2!
   96.6% - 718 s - 157,464 inv. 
org.apache.commons.beanutils2.WeakFastHashMap.put|

[jira] [Created] (EMAIL-193) use ConcurrentHashMap insteadof WeakHashMap

2020-05-31 Thread JIN XU (Jira)
JIN XU created EMAIL-193:


 Summary: use ConcurrentHashMap insteadof WeakHashMap
 Key: EMAIL-193
 URL: https://issues.apache.org/jira/browse/EMAIL-193
 Project: Commons Email
  Issue Type: Improvement
 Environment: win10, jdk8
Reporter: JIN XU


Hi.

throughtout my performance test (using Jprofiler), I found out WeakHashMap is 
far slower than ConcurrentHashMap.

Should we use ConcurrentHashMap instead of WeakHashMap?

I will attach my test codes here.
{code:java}
/*
 * 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.
 */import org.apache.commons.beanutils2.WeakFastHashMap;import 
java.util.Objects;
import java.util.Random;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;public class WeakFastHashMapTest {
static final TreeSet treeSet = new TreeSet<>();
static final Random random = new Random();
static final WeakFastHashMap weakFastHashMap = new 
WeakFastHashMap<>();
static final ConcurrentHashMap concurrentHashMap = new 
ConcurrentHashMap<>();static final int INIT_SIZE = 5;
static final double WRITE_CHANCE = 0.01;
static final double READ_NON_EXIST_CHANCE = 0.30;public static void 
main(String[] args) {
for (int i = 0; i < INIT_SIZE; i++) {
writeRandom();
}
System.out.println("init over");weakFastHashMap.setFast(true);  
  for (int i = 0; ; i++) {
if (i % 10 == 0) {
System.out.println("running> i : " + i + " size: " + 
treeSet.size());
}
double ifWrite = random.nextDouble();
if (ifWrite < WRITE_CHANCE) {
writeRandom();
} else {
double ifNonExist = random.nextDouble();
if (ifNonExist < READ_NON_EXIST_CHANCE) {
readNonExist();
} else {
readExist();
}
}
}
}public static void writeRandom() {
Integer nowKey = random.nextInt() * random.nextInt();
Integer nowValue = random.nextInt() * random.nextInt();
treeSet.add(nowKey);
weakFastHashMap.put(nowKey, nowValue);
concurrentHashMap.put(nowKey, nowValue);
}public static void readExist() {
Integer nowKey = null;
while (nowKey == null) {
nowKey = treeSet.lower(random.nextInt() * random.nextInt());
}
read(nowKey);
}public static void readNonExist() {
Integer nowKey = random.nextInt() * random.nextInt();
while (treeSet.contains(nowKey)) {
nowKey = random.nextInt() * random.nextInt();
}
read(nowKey);
}public static void read(Integer nowKey) {
Integer value1 = weakFastHashMap.get(nowKey);
Integer value2 = concurrentHashMap.get(nowKey);
if (!Objects.equals(value1, value2)) {
System.out.println("not equal!  nowKey : " + nowKey + " value1 : " 
+ value1 + " value2 : " + value2);
}
}
}
{code}
and, Jprofiler Call Tree:
h2. Call Tree
|*Session:*|WeakFastHashMapTest|
|*Time of export:*|Sunday, May 31, 2020 2:56:14 PM CST|
|*JVM time:*|12:23|
| | |
|*View mode:* |Tree|
|*Thread selection:* | All thread groups|
|*Thread status:* | Runnable|
|*Aggregation level:* |Methods|

 
|!jprofiler_images/tree/menu_tee_minus_18.gif|width=18,height=18,align=left!!jprofiler_images/call_method_16_filter_underlay_16.png|width=16,height=16,align=left!
   
!jprofiler_images/pixel_ff99.png|width=49,height=7,vspace=2!!jprofiler_images/pixel_3300.png|width=1,height=7,vspace=2!
  100.0% - 743 s - 1 inv. WeakFastHashMapTest.main|
|!jprofiler_images/tree/menu_bar_18.gif|width=18,height=18,align=left!!jprofiler_images/tree/menu_tee_minus_18.gif|width=18,height=18,align=left!!jprofiler_images/call_method_16.png|width=16,height=16,align=left!
   
!jprofiler_images/pixel_ff99.png|width=48,height=7,vspace=2!!jprofiler_images/pixel_3300.png|height=7,vspace=2!
  96.6% - 718 s - 157,464 inv. 
org.apache.commons.beanutils2.WeakFastHashMap.put|

[jira] [Closed] (EMAIL-193) use ConcurrentHashMap insteadof WeakHashMap

2020-05-31 Thread JIN XU (Jira)


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

JIN XU closed EMAIL-193.

Resolution: Not A Problem

> use ConcurrentHashMap insteadof WeakHashMap
> ---
>
> Key: EMAIL-193
> URL: https://issues.apache.org/jira/browse/EMAIL-193
> Project: Commons Email
>  Issue Type: Improvement
> Environment: win10, jdk8
>Reporter: JIN XU
>Priority: Minor
>
> Hi.
> throughtout my performance test (using Jprofiler), I found out WeakHashMap is 
> far slower than ConcurrentHashMap.
> Should we use ConcurrentHashMap instead of WeakHashMap?
> I will attach my test codes here.
> {code:java}
> /*
>  * 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.
>  */import org.apache.commons.beanutils2.WeakFastHashMap;import 
> java.util.Objects;
> import java.util.Random;
> import java.util.TreeSet;
> import java.util.concurrent.ConcurrentHashMap;public class 
> WeakFastHashMapTest {
> static final TreeSet treeSet = new TreeSet<>();
> static final Random random = new Random();
> static final WeakFastHashMap weakFastHashMap = new 
> WeakFastHashMap<>();
> static final ConcurrentHashMap concurrentHashMap = new 
> ConcurrentHashMap<>();static final int INIT_SIZE = 5;
> static final double WRITE_CHANCE = 0.01;
> static final double READ_NON_EXIST_CHANCE = 0.30;public static void 
> main(String[] args) {
> for (int i = 0; i < INIT_SIZE; i++) {
> writeRandom();
> }
> System.out.println("init over");
> weakFastHashMap.setFast(true);for (int i = 0; ; i++) {
> if (i % 10 == 0) {
> System.out.println("running> i : " + i + " size: " + 
> treeSet.size());
> }
> double ifWrite = random.nextDouble();
> if (ifWrite < WRITE_CHANCE) {
> writeRandom();
> } else {
> double ifNonExist = random.nextDouble();
> if (ifNonExist < READ_NON_EXIST_CHANCE) {
> readNonExist();
> } else {
> readExist();
> }
> }
> }
> }public static void writeRandom() {
> Integer nowKey = random.nextInt() * random.nextInt();
> Integer nowValue = random.nextInt() * random.nextInt();
> treeSet.add(nowKey);
> weakFastHashMap.put(nowKey, nowValue);
> concurrentHashMap.put(nowKey, nowValue);
> }public static void readExist() {
> Integer nowKey = null;
> while (nowKey == null) {
> nowKey = treeSet.lower(random.nextInt() * random.nextInt());
> }
> read(nowKey);
> }public static void readNonExist() {
> Integer nowKey = random.nextInt() * random.nextInt();
> while (treeSet.contains(nowKey)) {
> nowKey = random.nextInt() * random.nextInt();
> }
> read(nowKey);
> }public static void read(Integer nowKey) {
> Integer value1 = weakFastHashMap.get(nowKey);
> Integer value2 = concurrentHashMap.get(nowKey);
> if (!Objects.equals(value1, value2)) {
> System.out.println("not equal!  nowKey : " + nowKey + " value1 : 
> " + value1 + " value2 : " + value2);
> }
> }
> }
> {code}
> and, Jprofiler Call Tree:
> h2. Call Tree
> |*Session:*|WeakFastHashMapTest|
> |*Time of export:*|Sunday, May 31, 2020 2:56:14 PM CST|
> |*JVM time:*|12:23|
> | | |
> |*View mode:* |Tree|
> |*Thread selection:* | vspace="0" src=" jprofiler_images/selector_group_16.png"> All thread groups|
> |*Thread status:* | vspace="0" src=" jprofiler_images/ff00c400_bff00.png"> Runnable|
> |*Aggregation level:* |Methods|
> 
>  
> |!jprofiler_images/tree/menu_tee_minus_18.gif|width=18,height=18,align=left!!jprofiler_images/call_method_16_filter_underlay_16.png|width=16,height=16,align=left!
>    
> !jprofiler_images/pixel_ff99.png|width=49,height=7,vspace=2!!jprofiler_images/pixel_3300.png|width=1,height=7,vspace=2!
>   100.0% - 743 s - 1 inv. 

[jira] [Work logged] (LANG-1542) ToStringBuilder.reflectionToString - Wrong JSON format when object has a List of Enum

2020-05-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1542?focusedWorklogId=439187=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-439187
 ]

ASF GitHub Bot logged work on LANG-1542:


Author: ASF GitHub Bot
Created on: 31/May/20 06:53
Start Date: 31/May/20 06:53
Worklog Time Spent: 10m 
  Work Description: TranNgocKhoa commented on a change in pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#discussion_r432916255



##
File path: src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
##
@@ -635,6 +635,14 @@ protected void appendDetail(final StringBuffer buffer, 
final String fieldName, f
  *  {@code toString}, not {@code null}
  */
 protected void appendDetail(final StringBuffer buffer, final String 
fieldName, final Collection coll) {
+if (coll != null && !coll.isEmpty()) {
+coll.stream().findFirst()
+.map(Object::getClass)
+.filter(Class::isEnum)

Review comment:
   @swarajsaaj, I added test case for it





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.

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


Issue Time Tracking
---

Worklog Id: (was: 439187)
Time Spent: 1h 40m  (was: 1.5h)

> ToStringBuilder.reflectionToString - Wrong JSON format when object has a List 
> of Enum
> -
>
> Key: LANG-1542
> URL: https://issues.apache.org/jira/browse/LANG-1542
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.10
> Environment: Open JDK 1.8
>Reporter: Trần Ngọc Khoa
>Priority: Major
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> I'm trying to log an object to console with JSON style using 
> {{ToStringBuilder.reflectionToString}} from {{commons-lang3:3.10}} but it 
> seems generated a wrong JSON format.
> Problem happening when I have a list of enums in my field list.
>  
> {code:java}
> This is the class:
>      public class Person {
>  private long id;
>  private String name;
>  private List listEnums;
> //getter and setter
> public String toString(){
>  return ToStringBuilder.reflectionToString(this, 
> ToStringStyle.JSON_STYLE); 
> }
> }
> {code}
>   
> And {{MyEnum}}:
> {code:java}
>  public enum MyEnum {
>  FOOD,
>  SPORT,
>  BOOK,
>  MUSIC
>  }{code}
> When I call {{toString()}} of Person object. It shows like this
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": [FRIDAY, MONDAY, TUESDAY]
>  }{code}
>   
> What I expected is:
> {code:java}
>  {
>  "id": 1,
>  "name": "Karl",
>  "listEnums": ["FRIDAY", "MONDAY", "TUESDAY"]
>  }{code}
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] TranNgocKhoa commented on a change in pull request #530: LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format for List

2020-05-31 Thread GitBox


TranNgocKhoa commented on a change in pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#discussion_r432916255



##
File path: src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
##
@@ -635,6 +635,14 @@ protected void appendDetail(final StringBuffer buffer, 
final String fieldName, f
  *  {@code toString}, not {@code null}
  */
 protected void appendDetail(final StringBuffer buffer, final String 
fieldName, final Collection coll) {
+if (coll != null && !coll.isEmpty()) {
+coll.stream().findFirst()
+.map(Object::getClass)
+.filter(Class::isEnum)

Review comment:
   @swarajsaaj, I added test case for it





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.

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




[GitHub] [commons-lang] TranNgocKhoa commented on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


TranNgocKhoa commented on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636430692


   I got a build error when update my pull request today. What should I do?



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.

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




[GitHub] [commons-lang] TranNgocKhoa edited a comment on pull request #532: reformat Locks and LocksTest for passing Checkstyle

2020-05-31 Thread GitBox


TranNgocKhoa edited a comment on pull request #532:
URL: https://github.com/apache/commons-lang/pull/532#issuecomment-636430692


   I got a build error when update my pull request today. What should I do?
   Link: https://github.com/apache/commons-lang/pull/530



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.

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