[jira] [Resolved] (DAEMON-312) prunmgr: //MQ fails to kill multiple instances

2017-10-27 Thread Mark Thomas (JIRA)

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

Mark Thomas resolved DAEMON-312.

   Resolution: Fixed
Fix Version/s: 1.1

There  were two issues here. Both have been fixed.

1. When using //MS or //MQ the calling process did not exit until after the 
called process had completed the processing.

2. When using //MQ when an existing process had the configuration dialog 
showing, the exisiting process did not exit.

> prunmgr: //MQ fails to kill multiple instances
> --
>
> Key: DAEMON-312
> URL: https://issues.apache.org/jira/browse/DAEMON-312
> Project: Commons Daemon
>  Issue Type: Bug
>  Components: Procrun
>Affects Versions: 1.0.9, 1.0.15
> Environment: Windows 7, 64-bit
>Reporter: Tim Anderson
> Fix For: 1.1
>
>
> Issuing the following commands starts two instances of prunmgr:
> {code}
> prunmgr //MS//SomeServiceName
> prunmgr //MS//SomeServiceName
> {code}
> Running:
> {code}
> prunmgr //MQ//SomeServiceName
> {code}
> kills the second instance of prunmgr, but fails to kill the first. It does 
> however remove the icon from the system tray.
> This can be reproduced running Tomcat7w.exe from Tomcat 7.0.50 in a command 
> prompt:
> {code}
> Tomcat7w.exe //MS//Tomcat7
> Tomcat7w.exe //MS//Tomcat7
> Tomcat7w.exe //MQ//Tomcat7
> {code}
> Running:
> {code}
> Tomcat7w.exe //MS//Tomcat7
> {code}
> again, displays an "Application System Error" dialog with the message:
> {quote}
> "An instance of 'Tomcat7' application is already running.
> {quote}
> See also DAEMON-187



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (TEXT-106) Exception thrown in ExtendedMessageFormat using quotes with custom registry

2017-10-27 Thread JIRA

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

Benoît Moreau updated TEXT-106:
---
Attachment: ExtendedMessageFormat.java.patch
ExtendedMessageFormatTest.java.patch

I propose this patch.
Like in the method "applyPattern", the method "parseFormatDescription" must not 
increment the position after the call to "getQuotedString" which call 
"appendQuotedString".
"appendQuotedString" already increments the position.

I also attach the associated unit test.

Regards.

[^ExtendedMessageFormat.java.patch]
[^ExtendedMessageFormatTest.java.patch]

> Exception thrown in ExtendedMessageFormat using quotes with custom registry
> ---
>
> Key: TEXT-106
> URL: https://issues.apache.org/jira/browse/TEXT-106
> Project: Commons Text
>  Issue Type: Bug
>Affects Versions: 1.1
>Reporter: Benoît Moreau
> Attachments: ExtendedMessageFormat.java.patch, 
> ExtendedMessageFormatTest.java.patch
>
>
> An exception is thrown when a quote is used just before end brace of format 
> element definition when a custom registry is used.
> This exception is not thrown when a blank space is added before the end brace.
> {code:java}
> public static void main(String[] args)
> {
>   String pattern   = "TEST: {0,choice,0#0|0<'1'}";
>   String patternWorkaround = "TEST: {0,choice,0#0|0<'1' }"; // a space 
> after quote
>   // Works fine
>   MessageFormat format0 = new MessageFormat(pattern);
>   System.out.println(format0.format(new Integer[] { 0 })); // "TEST: 0"
>   System.out.println(format0.format(new Integer[] { 1 })); // "TEST: 1"
>   // Works fine
>   ExtendedMessageFormat format1 = new ExtendedMessageFormat(pattern);
>   System.out.println(format1.format(new Integer[] { 0 })); // "TEST: 0"
>   System.out.println(format1.format(new Integer[] { 1 })); // "TEST: 1"
>   // Works fine
>   ExtendedMessageFormat format2 = new 
> ExtendedMessageFormat(patternWorkaround, new HashMap FormatFactory>());
>   System.out.println(format2.format(new Integer[] { 0 })); // "TEST: 0"
>   System.out.println(format2.format(new Integer[] { 1 })); // "TEST: 1 "
>   // Doesn't work
>   ExtendedMessageFormat format3 = new ExtendedMessageFormat(pattern, new 
> HashMap());
>   System.out.println(format3.format(new Integer[] { 0 })); // Exception 
> in thread "main" java.lang.IllegalArgumentException: Unterminated format 
> element at position 9
>   System.out.println(format3.format(new Integer[] { 1 }));
> }
> {code}
> Expected behavior: This exception should not be thrown.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Deleted] (VALIDATOR-431) Lorem ipsum

2017-10-27 Thread Sebb (JIRA)

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

Sebb deleted VALIDATOR-431:
---


> Lorem ipsum
> ---
>
> Key: VALIDATOR-431
> URL: https://issues.apache.org/jira/browse/VALIDATOR-431
> Project: Commons Validator
>  Issue Type: Bug
> Environment: Lorem Ipsum
>Reporter: Muthukumaran MS
>  Labels: features, patch
>   Original Estimate: 612h
>  Remaining Estimate: 612h
>
> Lorem Ipsum



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Deleted] (VALIDATOR-432) Lorem ipsum sub task

2017-10-27 Thread Sebb (JIRA)

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

Sebb deleted VALIDATOR-432:
---


> Lorem ipsum sub task
> 
>
> Key: VALIDATOR-432
> URL: https://issues.apache.org/jira/browse/VALIDATOR-432
> Project: Commons Validator
>  Issue Type: Sub-task
> Environment: Lorem ipsum 
>Reporter: Muthukumaran MS
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] commons-lang issue #304: Fix DateUtilsTest to work reliably on Java 9

2017-10-27 Thread garydgregory
Github user garydgregory commented on the issue:

https://github.com/apache/commons-lang/pull/304
  
The current git master build OK for me with 'mvn clean verify' and Oracle 
Java 9.0.1.


---


[jira] [Commented] (JEXL-243) Allow restricting available features in Script/Expressions

2017-10-27 Thread Henri Biestro (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222599#comment-16222599
 ] 

Henri Biestro commented on JEXL-243:


First drop:

src/main/java/org/apache/commons/jexl3/JexlBuilder.java
src/main/java/org/apache/commons/jexl3/JexlEngine.java
src/main/java/org/apache/commons/jexl3/JexlException.java
src/main/java/org/apache/commons/jexl3/JexlFeatures.java
src/main/java/org/apache/commons/jexl3/internal/Engine.java
src/main/java/org/apache/commons/jexl3/parser/JexlNode.java
src/main/java/org/apache/commons/jexl3/parser/JexlParser.java
src/main/java/org/apache/commons/jexl3/parser/Parser.jjt
/src/test/java/org/apache/commons/jexl3/FeaturesTest.java
src/test/java/org/apache/commons/jexl3/parser/ParserTest.java

Committed revision 1813544.

> Allow restricting available features in Script/Expressions
> --
>
> Key: JEXL-243
> URL: https://issues.apache.org/jira/browse/JEXL-243
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.1
>Reporter: Henri Biestro
>Assignee: Henri Biestro
> Fix For: 3.2
>
>
> Restrict features related to potential dangers/difficulties one may encounter 
> whilst scripting;
> Reserved Names: a set of reserved variable names that can not be used as 
> local variable (or parameter) names
> Registers: boolean property allowing parsing of register syntax (#number)
> Global Side Effect : boolean property controlling assigning/modifying values 
> on global variables
> Side Effect: boolean property controlling side effects assigning/modifying 
> values on any variable
> New Instance: boolean property controlling creating new instances through 
> new(...) or using class as functor
> Loops: boolean property controlling usage of loop constructs (while(true), 
> for(...))
> Lambda: boolean property controlling usage of script function declarations
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread Henri Biestro (JIRA)

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

Henri Biestro updated JEXL-242:
---
Assignee: Henri Biestro

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Assignee: Henri Biestro
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread Henri Biestro (JIRA)

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

Henri Biestro resolved JEXL-242.

Resolution: Cannot Reproduce

Following code does not reproduce:
{code}

@Test
public void test242() throws Exception {
Double a = -40.05d;
Double b = -8.01d;
Double c = a + b;
final JexlContext context = new MapContext();
context.set("a", a);
context.set("b", b);
JexlEngine JEXL_ENGINE = new 
JexlBuilder().strict(true).silent(true).create();
JexlExpression jsp = JEXL_ENGINE.createExpression("a + b");
Double e = (Double) jsp.evaluate(context);
Assert.assertTrue(Double.doubleToLongBits(e) + " != " + 
Double.doubleToLongBits(c), c.doubleValue() == e.doubleValue());
Assert.assertTrue(Double.doubleToLongBits(e) + " != " + 
Double.doubleToLongBits(c), a + b == e);
}
{code}

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Assignee: Henri Biestro
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (VALIDATOR-432) Lorem ipsum sub task

2017-10-27 Thread Muthukumaran MS (JIRA)
Muthukumaran MS created VALIDATOR-432:
-

 Summary: Lorem ipsum sub task
 Key: VALIDATOR-432
 URL: https://issues.apache.org/jira/browse/VALIDATOR-432
 Project: Commons Validator
  Issue Type: Sub-task
  Components: Framework
Affects Versions: 1.6
 Environment: Lorem ipsum 
Reporter: Muthukumaran MS
 Fix For: Nightly Builds






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (VALIDATOR-431) Lorem ipsum

2017-10-27 Thread Muthukumaran MS (JIRA)
Muthukumaran MS created VALIDATOR-431:
-

 Summary: Lorem ipsum
 Key: VALIDATOR-431
 URL: https://issues.apache.org/jira/browse/VALIDATOR-431
 Project: Commons Validator
  Issue Type: Bug
  Components: Framework
Affects Versions: 1.6
 Environment: Lorem Ipsum
Reporter: Muthukumaran MS
 Fix For: Nightly Builds


Lorem Ipsum



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (JEXL-243) Allow restricting available features in Script/Expressions

2017-10-27 Thread Henri Biestro (JIRA)
Henri Biestro created JEXL-243:
--

 Summary: Allow restricting available features in Script/Expressions
 Key: JEXL-243
 URL: https://issues.apache.org/jira/browse/JEXL-243
 Project: Commons JEXL
  Issue Type: Improvement
Affects Versions: 3.1
Reporter: Henri Biestro
 Fix For: 3.2


Restrict features related to potential dangers/difficulties one may encounter 
whilst scripting;

Reserved Names: a set of reserved variable names that can not be used as local 
variable (or parameter) names
Registers: boolean property allowing parsing of register syntax (#number)
Global Side Effect : boolean property controlling assigning/modifying values on 
global variables
Side Effect: boolean property controlling side effects assigning/modifying 
values on any variable
New Instance: boolean property controlling creating new instances through 
new(...) or using class as functor
Loops: boolean property controlling usage of loop constructs (while(true), 
for(...))
Lambda: boolean property controlling usage of script function declarations
 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (JEXL-243) Allow restricting available features in Script/Expressions

2017-10-27 Thread Henri Biestro (JIRA)

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

Henri Biestro updated JEXL-243:
---
Assignee: Henri Biestro

> Allow restricting available features in Script/Expressions
> --
>
> Key: JEXL-243
> URL: https://issues.apache.org/jira/browse/JEXL-243
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.1
>Reporter: Henri Biestro
>Assignee: Henri Biestro
> Fix For: 3.2
>
>
> Restrict features related to potential dangers/difficulties one may encounter 
> whilst scripting;
> Reserved Names: a set of reserved variable names that can not be used as 
> local variable (or parameter) names
> Registers: boolean property allowing parsing of register syntax (#number)
> Global Side Effect : boolean property controlling assigning/modifying values 
> on global variables
> Side Effect: boolean property controlling side effects assigning/modifying 
> values on any variable
> New Instance: boolean property controlling creating new instances through 
> new(...) or using class as functor
> Loops: boolean property controlling usage of loop constructs (while(true), 
> for(...))
> Lambda: boolean property controlling usage of script function declarations
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (JEXL-240) Unable to invoke a call operator using antish style variable resoltion

2017-10-27 Thread Henri Biestro (JIRA)

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

Henri Biestro resolved JEXL-240.

Resolution: Fixed

src/main/java/org/apache/commons/jexl3/internal/Interpreter.java
src/test/java/org/apache/commons/jexl3/AntishCallTest.java

Committed revision 1813542.

> Unable to invoke a call operator using antish style variable resoltion
> --
>
> Key: JEXL-240
> URL: https://issues.apache.org/jira/browse/JEXL-240
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: Dmitri Blinov
>Assignee: Henri Biestro
> Fix For: 3.2
>
> Attachments: AntishCallTest.java
>
>
> Suppose I have declared an antish style context variable under the name 
> {{java.math.BigDecimal}} of the {{Class}} type.
> To test that it works correctly I use the following script
> {code}var x = java.math.BigDecimal; x("1234"){code} which returns correct 
> value.
> Now I want to invoke an overloaded call operator directly for this variable 
> using {code}java.math.BigDecimal("1234"){code} 
> which returns an error 
> {panel}
> undefined variable java.math
> {panel}
> The expected behaviour is to return the same value as in the first script.
> I have created a test case for this, please have a look.
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Reopened] (JEXL-240) Unable to invoke a call operator using antish style variable resoltion

2017-10-27 Thread Henri Biestro (JIRA)

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

Henri Biestro reopened JEXL-240:


Using classes (objects) as usable functors to create instances breaks the 
ability to statically determine whether a script attempts to create objects. 
Since implementing the feature is only one overload away in JexlContext, I'm 
reverting to the original behavior.

> Unable to invoke a call operator using antish style variable resoltion
> --
>
> Key: JEXL-240
> URL: https://issues.apache.org/jira/browse/JEXL-240
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: Dmitri Blinov
>Assignee: Henri Biestro
> Fix For: 3.2
>
> Attachments: AntishCallTest.java
>
>
> Suppose I have declared an antish style context variable under the name 
> {{java.math.BigDecimal}} of the {{Class}} type.
> To test that it works correctly I use the following script
> {code}var x = java.math.BigDecimal; x("1234"){code} which returns correct 
> value.
> Now I want to invoke an overloaded call operator directly for this variable 
> using {code}java.math.BigDecimal("1234"){code} 
> which returns an error 
> {panel}
> undefined variable java.math
> {panel}
> The expected behaviour is to return the same value as in the first script.
> I have created a test case for this, please have a look.
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] commons-lang pull request #299: Add module-info for Java 9

2017-10-27 Thread jodastephen
Github user jodastephen commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/299#discussion_r147424665
  
--- Diff: src/main/java/module-info.java ---
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+/**
+ * Apache Commons Lang provides utility classes for the core of Java.
+ */
+module org.apache.commons.lang3 {
+
+// see AbstractCircuitBreaker
+requires static java.desktop;
--- End diff --

Because this is a massive dependency, and we need to avoid dragging it all 
in for just a small percentage of users. Using `requires static` is an abuse of 
the module system, but the best option available. `requires transitive` would 
be the right solution normally.


---


[GitHub] commons-lang pull request #299: Add module-info for Java 9

2017-10-27 Thread namannigam
Github user namannigam commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/299#discussion_r147422522
  
--- Diff: src/main/java/module-info.java ---
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+/**
+ * Apache Commons Lang provides utility classes for the core of Java.
+ */
+module org.apache.commons.lang3 {
+
+// see AbstractCircuitBreaker
+requires static java.desktop;
--- End diff --

a small difference and I am just curious to know, why is this not 
`transitive` which was what I saw using `jdeps --generate-module-info`?


---


[jira] [Commented] (LANG-1124) Add split by length methods in StringUtils

2017-10-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222323#comment-16222323
 ] 

ASF GitHub Bot commented on LANG-1124:
--

Github user asfgit closed the pull request at:

https://github.com/apache/commons-lang/pull/75


> Add split by length methods in StringUtils
> --
>
> Key: LANG-1124
> URL: https://issues.apache.org/jira/browse/LANG-1124
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Loic Guibert
>
> Add methods to split a String by fixed lengths :
> {code:java}
> public static String[] splitByLength(String str, int ... lengths);
> public static String[] splitByLengthRepeatedly(String str, int ... lengths);
> {code}
> Detail :
> {code:java}
> /**
>  * Split a String into an array, using an array of fixed string 
> lengths.
>  *
>  * If not null String input, the returned array size is same as the input 
> lengths array.
>  *
>  * A null input String returns {@code null}.
>  * A {@code null} or empty input lengths array returns an empty array.
>  * A {@code 0} in the input lengths array results in en empty string.
>  *
>  * Extra characters are ignored (ie String length greater than sum of 
> split lengths).
>  * All empty substrings other than zero length requested, are returned {@code 
> null}.
>  *
>  * 
>  * StringUtils.splitByLength(null, *)  = null
>  * StringUtils.splitByLength("abc")= []
>  * StringUtils.splitByLength("abc", null)  = []
>  * StringUtils.splitByLength("abc", [])= []
>  * StringUtils.splitByLength("", 2, 4, 1)  = [null, null, null]
>  *
>  * StringUtils.splitByLength("abcdefg", 2, 4, 1) = ["ab", "cdef", "g"]
>  * StringUtils.splitByLength("abcdefghij", 2, 4, 1)  = ["ab", "cdef", "g"]
>  * StringUtils.splitByLength("abcdefg", 2, 4, 5) = ["ab", "cdef", "g"]
>  * StringUtils.splitByLength("abcdef", 2, 4, 1)  = ["ab", "cdef", null]
>  *
>  * StringUtils.splitByLength(" abcdef", 2, 4, 1) = [" a", "bcde", "f"]
>  * StringUtils.splitByLength("abcdef ", 2, 4, 1) = ["ab", "cdef", " "]
>  * StringUtils.splitByLength("abcdefg", 2, 4, 0, 1)  = ["ab", "cdef", "", "g"]
>  * StringUtils.splitByLength("abcdefg", -1)  = {@link 
> IllegalArgumentException}
>  * 
>  *
>  * @param str  the String to parse, may be null
>  * @param lengths  the string lengths where to cut, may be null, must not be 
> negative
>  * @return an array of splitted Strings, {@code null} if null String input
>  * @throws IllegalArgumentException
>  * if one of the lengths is negative
>  */
> public static String[] splitByLength(String str, int ... lengths);
> /**
>  * Split a String into an array, using an array of fixed string lengths 
> repeated as
>  * many times as necessary to reach the String end.
>  *
>  * If not null String input, the returned array size is a multiple of the 
> input lengths array.
>  *
>  * A null input String returns {@code null}.
>  * A {@code null} or empty input lengths array returns an empty array.
>  * A {@code 0} in the input lengths array results in en empty string.
>  *
>  * All empty substrings other than zero length requested and following 
> substrings,
>  * are returned {@code null}.
>  *
>  * 
>  * StringUtils.splitByLengthRepeated(null, *)  = null
>  * StringUtils.splitByLengthRepeated("abc")= []
>  * StringUtils.splitByLengthRepeated("abc", null)  = []
>  * StringUtils.splitByLengthRepeated("abc", [])= []
>  * StringUtils.splitByLengthRepeated("", 2, 4, 1)  = [null, null, null]
>  *
>  * StringUtils.splitByLengthRepeated("abcdefghij", 2, 3) = ["ab", "cde", 
> "fg", "hij"]
>  * StringUtils.splitByLengthRepeated("abcdefgh", 2, 3)   = ["ab", "cde", 
> "fg", "h"]
>  * StringUtils.splitByLengthRepeated("abcdefg", 2, 3)= ["ab", "cde", 
> "fg", null]
>  *
>  * StringUtils.splitByLengthRepeated(" abcdef", 2, 3)= [" a", "bcd", 
> "ef", null]
>  * StringUtils.splitByLengthRepeated("abcdef ", 2, 3)= ["ab", "cde", 
> "f ", null]
>  * StringUtils.splitByLengthRepeated("abcdef", 2, 3, 0, 1)   = ["ab", "cde", 
> "", "f"]
>  * StringUtils.splitByLengthRepeated("abcdefg", 2, 3, 0, 1)  = ["ab", "cde", 
> "", "f",
>  *  "g", null, 
> null, null]
>  * StringUtils.splitByLengthRepeated("abcdefgh", 2, 0, 1, 0) = ["ab", "", 
> "c", "",
>  *  "de", "", 
> "f", "",
>  *  "gh", "", 
> null, null]
>  * StringUtils.splitByLengthRepeated("abcdefg", 2, 0, 1, 0) = ["ab", "", "c", 
> "",
>  *  "de", "", 
> "f", "",
>  *  "g", null, 
> null, null]
>  * 

[GitHub] commons-lang pull request #184: Correct replacing 160 in normalizeSpace

2017-10-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/commons-lang/pull/184


---


[GitHub] commons-lang pull request #75: LANG-1124: Add StringUtils split by length me...

2017-10-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/commons-lang/pull/75


---


[GitHub] commons-lang pull request #298: Add an instanceof test in the implementation...

2017-10-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/commons-lang/pull/298


---


[GitHub] commons-lang pull request #279: Fraction debug printings

2017-10-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/commons-lang/pull/279


---


[GitHub] commons-lang pull request #297: Add a rule of Locale.ENGLISH to String.toUpp...

2017-10-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/commons-lang/pull/297


---


[jira] [Commented] (LANG-1164) allow ToStringStyle to omitNulls

2017-10-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222319#comment-16222319
 ] 

ASF GitHub Bot commented on LANG-1164:
--

Github user PascalSchumacher closed the pull request at:

https://github.com/apache/commons-lang/pull/209


> allow ToStringStyle to omitNulls
> 
>
> Key: LANG-1164
> URL: https://issues.apache.org/jira/browse/LANG-1164
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.builder.*
>Reporter: Shaun A Elliott
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] commons-lang pull request #209: LANG-1164: allow ToStringStyle to omitNulls

2017-10-27 Thread PascalSchumacher
Github user PascalSchumacher closed the pull request at:

https://github.com/apache/commons-lang/pull/209


---


[jira] [Commented] (LANG-1268) Add methods for comparing numbers/compareables against each others to Validate

2017-10-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222316#comment-16222316
 ] 

ASF GitHub Bot commented on LANG-1268:
--

Github user PascalSchumacher closed the pull request at:

https://github.com/apache/commons-lang/pull/204


> Add methods for comparing numbers/compareables against each others to Validate
> --
>
> Key: LANG-1268
> URL: https://issues.apache.org/jira/browse/LANG-1268
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Reporter: Benedikt Ritter
>
> Follow up to LANG-1134. The methods for comparing numbers against each others 
> have been removed in  
> http://git-wip-us.apache.org/repos/asf/commons-lang/commit/09686fad
> Problems with the proposed APIs:
> - we should use lessThan instead of smaller
> - "object" suffix for methods taking object references as parameters
> - different vs. notEquals



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] commons-lang pull request #204: LANG-1268: Add methods for comparing numbers...

2017-10-27 Thread PascalSchumacher
Github user PascalSchumacher closed the pull request at:

https://github.com/apache/commons-lang/pull/204


---


[GitHub] commons-lang issue #299: Add module-info for Java 9

2017-10-27 Thread coveralls
Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/299
  

[![Coverage 
Status](https://coveralls.io/builds/13919900/badge)](https://coveralls.io/builds/13919900)

Coverage decreased (-0.02%) to 95.163% when pulling 
**8362e24c2edd5a7cb88fd9b74c71475462e2fb64 on jodastephen:module-info** into 
**1f0dfc31b51a445eb2cfbee5321800cf51e10b67 on apache:master**.



---


[GitHub] commons-lang issue #299: Add module-info for Java 9

2017-10-27 Thread coveralls
Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/299
  

[![Coverage 
Status](https://coveralls.io/builds/13919900/badge)](https://coveralls.io/builds/13919900)

Coverage decreased (-0.02%) to 95.163% when pulling 
**8362e24c2edd5a7cb88fd9b74c71475462e2fb64 on jodastephen:module-info** into 
**1f0dfc31b51a445eb2cfbee5321800cf51e10b67 on apache:master**.



---


[jira] [Created] (LANG-1363) Add module-info.java file

2017-10-27 Thread Stephen Colebourne (JIRA)
Stephen Colebourne created LANG-1363:


 Summary: Add module-info.java file
 Key: LANG-1363
 URL: https://issues.apache.org/jira/browse/LANG-1363
 Project: Commons Lang
  Issue Type: Improvement
Reporter: Stephen Colebourne
Priority: Minor
 Fix For: 3.x


Pull Request #299 - https://github.com/apache/commons-lang/pull/299 - proposes 
adding a module-info.java file to lang, with the associated pom.xml and travis 
changes.

The build still works on JDK 7 and 8 by excluding the module file where 
necessary. Releases will need to be done using JDK 9.

Animal sniffer, clirr, 
[coveralls|https://github.com/trautonen/coveralls-maven-plugin/issues/112] and 
findbugs do not work. Animal sniffer is not needed anymore with Java 9. 
Findbugs is replaced by spotbugs.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] commons-lang issue #304: Fix DateUtilsTest to work reliably on Java 9

2017-10-27 Thread jodastephen
Github user jodastephen commented on the issue:

https://github.com/apache/commons-lang/pull/304
  
Test failure looks like a timing issue unrelated to this PR


---


[GitHub] commons-lang issue #304: Fix DateUtilsTest to work reliably on Java 9

2017-10-27 Thread coveralls
Github user coveralls commented on the issue:

https://github.com/apache/commons-lang/pull/304
  

[![Coverage 
Status](https://coveralls.io/builds/13919695/badge)](https://coveralls.io/builds/13919695)

Coverage remained the same at 95.163% when pulling 
**0a6d43fc284b9a085d1b72ca38011187c761321e on jodastephen:date-tests** into 
**7a3ca8598dc4e830337dd938f2ad501a1e4049fe on apache:master**.



---


[jira] [Commented] (LANG-1362) Fix tests for Java 9

2017-10-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1637#comment-1637
 ] 

ASF GitHub Bot commented on LANG-1362:
--

GitHub user jodastephen opened a pull request:

https://github.com/apache/commons-lang/pull/304

Fix DateUtilsTest to work reliably on Java 9

Fixes failures due to MST time-zone not being formatted as "MST"
Also sets and unsets time-zones in finally blocks
to avoid pollution global state when tests fail

See [LANG-1362](https://issues.apache.org/jira/browse/LANG-1362)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jodastephen/commons-lang date-tests

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/304.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #304


commit 0a6d43fc284b9a085d1b72ca38011187c761321e
Author: Stephen Colebourne 
Date:   2017-10-27T11:56:28Z

Fix DateUtilsTest to work reliably on Java 9

Fixes failures due to MST time-zone not being formatted as "MST"
Also sets and unsets time-zones in finally blocks
to avoid pollution global state when tests fail




> Fix tests for Java 9
> 
>
> Key: LANG-1362
> URL: https://issues.apache.org/jira/browse/LANG-1362
> Project: Commons Lang
>  Issue Type: Bug
>Reporter: Stephen Colebourne
> Fix For: 3.7
>
>
> On Java 9 I see DateUtilsTest fail. This is because "MST7MDT" zone is not 
> formatted as "MST". I'm unclear as to why this is, but it is not relevant to 
> what the test is trying to do. As such, I've changed the zone to 
> "America/Denver" and changed the format letter from "z" to "XXX" to make it 
> more reliable.
> The PR also uses try-finally when setting the default time-zone to avoid 
> pollution of global state if a test fails (the pollution here made it look 
> like 8 test failures when there was only in fact 1).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] commons-lang pull request #304: Fix DateUtilsTest to work reliably on Java 9

2017-10-27 Thread jodastephen
GitHub user jodastephen opened a pull request:

https://github.com/apache/commons-lang/pull/304

Fix DateUtilsTest to work reliably on Java 9

Fixes failures due to MST time-zone not being formatted as "MST"
Also sets and unsets time-zones in finally blocks
to avoid pollution global state when tests fail

See [LANG-1362](https://issues.apache.org/jira/browse/LANG-1362)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jodastephen/commons-lang date-tests

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/304.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #304


commit 0a6d43fc284b9a085d1b72ca38011187c761321e
Author: Stephen Colebourne 
Date:   2017-10-27T11:56:28Z

Fix DateUtilsTest to work reliably on Java 9

Fixes failures due to MST time-zone not being formatted as "MST"
Also sets and unsets time-zones in finally blocks
to avoid pollution global state when tests fail




---


[jira] [Created] (LANG-1362) Fix tests for Java 9

2017-10-27 Thread Stephen Colebourne (JIRA)
Stephen Colebourne created LANG-1362:


 Summary: Fix tests for Java 9
 Key: LANG-1362
 URL: https://issues.apache.org/jira/browse/LANG-1362
 Project: Commons Lang
  Issue Type: Bug
Reporter: Stephen Colebourne
 Fix For: 3.7


On Java 9 I see DateUtilsTest fail. This is because "MST7MDT" zone is not 
formatted as "MST". I'm unclear as to why this is, but it is not relevant to 
what the test is trying to do. As such, I've changed the zone to 
"America/Denver" and changed the format letter from "z" to "XXX" to make it 
more reliable.

The PR also uses try-finally when setting the default time-zone to avoid 
pollution of global state if a test fails (the pollution here made it look like 
8 test failures when there was only in fact 1).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread Dmitri Blinov (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222139#comment-16222139
 ] 

Dmitri Blinov commented on JEXL-242:


I have no idea how you checked this. Try checking with the following code
{code}
double a = -40.05;
double b = -8.01;
final JexlContext context = new MapContext();
context.set("a",a);
context.set("b",b);
JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
double c = (Double) jsp.evaluate(context);
if (c != a + b) {
  // Add your code to report a problem
}
{code}

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222048#comment-16222048
 ] 

vikas garg commented on JEXL-242:
-

yeah i  have checked that. Java is returning the results correctly. don't know 
somehow jexl is not returning it accurately

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread Dmitri Blinov (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222024#comment-16222024
 ] 

Dmitri Blinov commented on JEXL-242:


You can check if jexl works correctly by evaluating your arithmetic in plain 
java. 
Double a = -40.05; Double b = -8.01; Double c = a + b

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222015#comment-16222015
 ] 

vikas garg commented on JEXL-242:
-

is there any document , comment or code  which can explain this inconsistency ? 
or how much it can vary ?

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222009#comment-16222009
 ] 

vikas garg edited comment on JEXL-242 at 10/27/17 9:32 AM:
---

[~dmitri_blinov]  I don't think so. Even in java if you do this simple addition 
this will return the exact value. Jexl is working fine if the value is like 
0.06 + 0.03 = 0.09
it is behaving incorrectly only for 0.05 value. That should not happen. It 
should have consistency. 


was (Author: gargvk10):
I don't think so. Even in java if you do this simple addition this will return 
the exact value. Jexl is working fine if the value is like 0.06 + 0.03 = 0.09
it is behaving incorrectly only for 0.05 value. That should not happen. It 
should have consistency. 

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222009#comment-16222009
 ] 

vikas garg edited comment on JEXL-242 at 10/27/17 9:31 AM:
---

I don't think so. Even in java if you do this simple addition this will return 
the exact value. Jexl is working fine if the value is like 0.06 + 0.03 = 0.09
it is behaving incorrectly only for 0.05 value. That should not happen. It 
should have consistency. 


was (Author: gargvk10):
I don't think so. Even in jave if you do this simple addition this will return 
the exact value. Jexl is working fine if the value is like 0.06 + 0.03 = 0.09
it is behaving incorrectly only for 0.05 value. That should not happen. It 
should have consistency. 

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222009#comment-16222009
 ] 

vikas garg commented on JEXL-242:
-

I don't think so. Even in jave if you do this simple addition this will return 
the exact value. Jexl is working fine if the value is like 0.06 + 0.03 = 0.09
it is behaving incorrectly only for 0.05 value. That should not happen. It 
should have consistency. 

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (TEXT-106) Exception thrown in ExtendedMessageFormat using quotes with custom registry

2017-10-27 Thread JIRA
Benoît Moreau created TEXT-106:
--

 Summary: Exception thrown in ExtendedMessageFormat using quotes 
with custom registry
 Key: TEXT-106
 URL: https://issues.apache.org/jira/browse/TEXT-106
 Project: Commons Text
  Issue Type: Bug
Affects Versions: 1.1
Reporter: Benoît Moreau


An exception is thrown when a quote is used just before end brace of format 
element definition when a custom registry is used.

This exception is not thrown when a blank space is added before the end brace.

{code:java}
public static void main(String[] args)
{
String pattern   = "TEST: {0,choice,0#0|0<'1'}";
String patternWorkaround = "TEST: {0,choice,0#0|0<'1' }"; // a space 
after quote

// Works fine
MessageFormat format0 = new MessageFormat(pattern);

System.out.println(format0.format(new Integer[] { 0 })); // "TEST: 0"
System.out.println(format0.format(new Integer[] { 1 })); // "TEST: 1"

// Works fine
ExtendedMessageFormat format1 = new ExtendedMessageFormat(pattern);

System.out.println(format1.format(new Integer[] { 0 })); // "TEST: 0"
System.out.println(format1.format(new Integer[] { 1 })); // "TEST: 1"

// Works fine
ExtendedMessageFormat format2 = new 
ExtendedMessageFormat(patternWorkaround, new HashMap());

System.out.println(format2.format(new Integer[] { 0 })); // "TEST: 0"
System.out.println(format2.format(new Integer[] { 1 })); // "TEST: 1 "

// Doesn't work
ExtendedMessageFormat format3 = new ExtendedMessageFormat(pattern, new 
HashMap());

System.out.println(format3.format(new Integer[] { 0 })); // Exception 
in thread "main" java.lang.IllegalArgumentException: Unterminated format 
element at position 9
System.out.println(format3.format(new Integer[] { 1 }));
}
{code}

Expected behavior: This exception should not be thrown.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread Dmitri Blinov (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16221996#comment-16221996
 ] 

Dmitri Blinov commented on JEXL-242:


I believe this is how floating point arithmetic works. Numbers in float or 
double format are basically not exact numbers but a close approximations. It 
has nothing to do with jexl

> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)

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

vikas garg updated JEXL-242:

Description: 
For a particular value of 0.05 , jexl is returning value unxepectedly
I have face an issue with following calcualtion:


Double a = -40.05;
Double b = -8.01;
final JexlContext context = new MapContext();
context.set("a",a);
context.set("b",b);
JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
Double c = jsp.evaluate(context);

The value returned by evaluation is -48.055 instead of -48.06
There seems some precision issue in calculation

  was:
For a particular value of 0.05 , jexl is returning value unxepectedly
I have face an issue with following calcualtion:
Double a = -40.05;
Double b = -8.01;
JexlExpression expression = a+b;
final JexlContext context = new MapContext();
context.set("a",a);
context.set("b",b);
Double c = this.expression.evaluate(context);
The value returned by evaluation is -48.055 instead of -48.06
There seems some precision issue in calculation


> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create();
> JexlExpression jsp = JEXL_ENGINE.createExpression("a+b");
> Double c = jsp.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)

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

vikas garg updated JEXL-242:

Description: 
For a particular value of 0.05 , jexl is returning value unxepectedly
I have face an issue with following calcualtion:
Double a = -40.05;
Double b = -8.01;
JexlExpression expression = a+b;
final JexlContext context = new MapContext();
context.set("a",a);
context.set("b",b);
Double c = this.expression.evaluate(context);
The value returned by evaluation is -48.055 instead of -48.06
There seems some precision issue in calculation

  was:
For a particular value of 0.05 , jexl is returning value unxepectedly
I have face an issue with following calcualtion:
Double a = -40.05;
Double b = -8.01;
JexlExpression expression = a+b;
Double c = this.expressionToEvaluate.evaluate(expression);
The value returned by evaluation is -48.055 instead of -48.06
There seems some precision issue in calculation


> invalid jexl calculation while doing sum for particular value
> -
>
> Key: JEXL-242
> URL: https://issues.apache.org/jira/browse/JEXL-242
> Project: Commons JEXL
>  Issue Type: Bug
>Affects Versions: 3.1
>Reporter: vikas garg
>Priority: Blocker
>
> For a particular value of 0.05 , jexl is returning value unxepectedly
> I have face an issue with following calcualtion:
> Double a = -40.05;
> Double b = -8.01;
> JexlExpression expression = a+b;
> final JexlContext context = new MapContext();
> context.set("a",a);
> context.set("b",b);
> Double c = this.expression.evaluate(context);
> The value returned by evaluation is -48.055 instead of -48.06
> There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (JEXL-242) invalid jexl calculation while doing sum for particular value

2017-10-27 Thread vikas garg (JIRA)
vikas garg created JEXL-242:
---

 Summary: invalid jexl calculation while doing sum for particular 
value
 Key: JEXL-242
 URL: https://issues.apache.org/jira/browse/JEXL-242
 Project: Commons JEXL
  Issue Type: Bug
Affects Versions: 3.1
Reporter: vikas garg
Priority: Blocker


For a particular value of 0.05 , jexl is returning value unxepectedly
I have face an issue with following calcualtion:
Double a = -40.05;
Double b = -8.01;
JexlExpression expression = a+b;
Double c = this.expressionToEvaluate.evaluate(expression);
The value returned by evaluation is -48.055 instead of -48.06
There seems some precision issue in calculation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (JEXL-212) Restrict usage of assignment statements in JexlExpression

2017-10-27 Thread Henri Biestro (JIRA)

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

Henri Biestro updated JEXL-212:
---
Fix Version/s: 3.2

> Restrict usage of assignment statements in JexlExpression
> -
>
> Key: JEXL-212
> URL: https://issues.apache.org/jira/browse/JEXL-212
> Project: Commons JEXL
>  Issue Type: Improvement
>Affects Versions: 3.0
>Reporter: Dmitri Blinov
>Assignee: Henri Biestro
>Priority: Minor
> Fix For: 3.2
>
>
> There is no possibility now to create a form of expression that can not 
> modify the context it is evaluated against, i.e. use only property references 
> or method calls.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (JEXL-237) Ability to restrict usage of certain names when declaring local variables

2017-10-27 Thread Henri Biestro (JIRA)

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

Henri Biestro updated JEXL-237:
---
Fix Version/s: 3.2

> Ability to restrict usage of certain names when declaring local variables
> -
>
> Key: JEXL-237
> URL: https://issues.apache.org/jira/browse/JEXL-237
> Project: Commons JEXL
>  Issue Type: Wish
>Affects Versions: 3.1
>Reporter: Dmitri Blinov
>Assignee: Henri Biestro
>Priority: Minor
> Fix For: 3.2
>
>
> One of the errors the scriptwriter usually makes is an accidental override of 
> certain context variables with his own local variables, which leads to nasty 
> bugs detected only when script is executed. As of now there is only a small 
> list of reserved words that can not be used as a valid variable name, and it 
> is restricted to basic Jexl syntax keywords. When Jexl syntax is extended 
> with custom functions and predefined context variables, its much easier for a 
> local variable name to clash with predefined name, thus altering script 
> execution further on. To exclude those errors it is needed that a custom name 
> verification would exist, prohibiting the scripts from be successfully parsed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)