You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2023/07/14 05:38:08 UTC
[groovy] branch GROOVY_4_0_X updated (0833d0e0eb -> 61f74601cd)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a change to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
from 0833d0e0eb GROOVY-11119: STC: overloaded setter name for map-style constructor call
new 47b07c5a1c GROOVY-11123: allow EOF terminated Number tokens in JsonLexer
new 61f74601cd fix typo in javadoc comment
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | 4 ++--
subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java | 5 ++++-
.../groovy-json/src/test/groovy/groovy/json/JsonLexerTest.groovy | 8 ++++----
3 files changed, 10 insertions(+), 7 deletions(-)
[groovy] 01/02: GROOVY-11123: allow EOF terminated Number tokens in JsonLexer
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 47b07c5a1c5145f072711809b41ca9746144b472
Author: Jörg Eichhorn <jo...@kiwigrid.com>
AuthorDate: Tue Jul 11 13:41:33 2023 +0200
GROOVY-11123: allow EOF terminated Number tokens in JsonLexer
---
subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java | 5 ++++-
.../groovy-json/src/test/groovy/groovy/json/JsonLexerTest.groovy | 8 ++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java b/subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java
index b586857a3b..4ec3fa5d2b 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java
@@ -130,7 +130,10 @@ public class JsonLexer implements Iterator<JsonToken> {
for (;;) {
reader.mark(1);
int read = reader.read();
- if (read == -1) return null;
+ if (read == -1) {
+ if (currentContent.length() == 0) return null;
+ read = 32;
+ }
char lastCharRead = (char) read;
if (lastCharRead >= ZERO && lastCharRead <= NINE ||
diff --git a/subprojects/groovy-json/src/test/groovy/groovy/json/JsonLexerTest.groovy b/subprojects/groovy-json/src/test/groovy/groovy/json/JsonLexerTest.groovy
index 735994242b..f7f7e2b59e 100644
--- a/subprojects/groovy-json/src/test/groovy/groovy/json/JsonLexerTest.groovy
+++ b/subprojects/groovy-json/src/test/groovy/groovy/json/JsonLexerTest.groovy
@@ -48,13 +48,13 @@ class JsonLexerTest extends GroovyTestCase {
}
void testNextToken() {
- def content = [" true ", " false ", " null ", " -123.456e78 ", " [ ", " ] ", " { ", " } ", " : ", " , "]
+ def content = [" true ", "true", " false ", "false", " null ", "null", " -123.456e78 ", "-123.456e78", " [ ", " ] ", " { ", " } ", " : ", " , "]
assert content.collect {
def lexer = new JsonLexer(new StringReader(it))
- lexer.nextToken().type
+ lexer.nextToken()?.type
} == [
- TRUE, FALSE, NULL, NUMBER,
+ TRUE, TRUE, FALSE, FALSE, NULL, NULL, NUMBER, NUMBER,
OPEN_BRACKET, CLOSE_BRACKET, OPEN_CURLY, CLOSE_CURLY, COLON, COMMA
]
}
@@ -120,7 +120,7 @@ class JsonLexerTest extends GroovyTestCase {
}
void testUnescapingWithLexer() {
- // use string concatenation so that the unicode escape characters are not decoded
+ // use string concatenation so that the unicode escape characters are not decoded
// by Groovy's lexer but by the JsonLexer
def lexer = new JsonLexer(new StringReader('"\\' + 'u004A\\' + 'u0053\\' + 'u004F\\' + 'u004E"'))
[groovy] 02/02: fix typo in javadoc comment
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 61f74601cdb3779cc55a2fee3969bbd9343dff78
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Jul 13 21:49:11 2023 +1000
fix typo in javadoc comment
---
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index 1b537cc059..fd79df8013 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -16357,7 +16357,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
* between two bit sets.
*
* @param left a BitSet
- * @param right another BitSet to bitwise AND
+ * @param right another BitSet to bitwise XOR
* @return the bitwise XOR of both BitSets
* @since 1.5.0
*/
@@ -16396,7 +16396,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
* between two bit sets.
*
* @param left a BitSet
- * @param right another BitSet to bitwise AND
+ * @param right another BitSet to bitwise OR
* @return the bitwise OR of both BitSets
* @since 1.5.0
*/