From d91ebc300be86ca8093d1ee653df4d2b6835ee52 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 16 Feb 2019 17:22:04 -0500 Subject: [PATCH 1/4] stage changes --- build.gradle | 2 +- .../com/cinchapi/concourse/lang/Language.java | 6 +-- .../cinchapi/concourse/bugrepro/CON635.java | 46 +++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 concourse-integration-tests/src/test/java/com/cinchapi/concourse/bugrepro/CON635.java diff --git a/build.gradle b/build.gradle index aae860a0dd..1da84dc0d0 100644 --- a/build.gradle +++ b/build.gradle @@ -109,7 +109,7 @@ subprojects { compile 'joda-time:joda-time:2.2' compile 'org.apache.thrift:libthrift:0.9.3' compile 'commons-configuration:commons-configuration:1.9' - compile group: 'com.cinchapi', name: 'accent4j', version: '1.5.2', changing:true + compile group: 'com.cinchapi', name: 'accent4j', version: '1.5.3', changing:true compile 'com.cinchapi:lib-config:1.3.1' testCompile 'junit:junit:4.11' diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java index b1624eab63..4b3a9f3093 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java @@ -25,11 +25,11 @@ import com.cinchapi.ccl.grammar.Symbol; import com.cinchapi.ccl.grammar.TimestampSymbol; import com.cinchapi.ccl.grammar.ValueSymbol; +import com.cinchapi.common.base.AnyStrings; import com.cinchapi.concourse.thrift.TCriteria; import com.cinchapi.concourse.thrift.TSymbol; import com.cinchapi.concourse.thrift.TSymbolType; import com.cinchapi.concourse.util.Convert; -import com.cinchapi.concourse.util.Strings; import com.google.common.collect.Lists; /** @@ -55,12 +55,12 @@ else if(tsymbol.getType() == TSymbolType.KEY) { else if(tsymbol.getType() == TSymbolType.VALUE) { Object symbol = Convert.stringToJava(tsymbol.getSymbol()); if(symbol instanceof String && !symbol.equals(tsymbol.getSymbol()) - && Strings.isWithinQuotes(tsymbol.getSymbol())) { + && AnyStrings.isWithinQuotes(tsymbol.getSymbol(), '`')) { // CON-634: This is an obscure corner case where the surrounding // quotes on the original tsymbol were necessary to escape a // keyword, but got dropped because of the logic in // Convert#stringToJava - symbol = Strings.ensureWithinQuotes(symbol.toString()); + symbol = AnyStrings.ensureWithinQuotes(symbol.toString()); } return new ValueSymbol(symbol); } diff --git a/concourse-integration-tests/src/test/java/com/cinchapi/concourse/bugrepro/CON635.java b/concourse-integration-tests/src/test/java/com/cinchapi/concourse/bugrepro/CON635.java new file mode 100644 index 0000000000..836036e406 --- /dev/null +++ b/concourse-integration-tests/src/test/java/com/cinchapi/concourse/bugrepro/CON635.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013-2019 Cinchapi Inc. + * + * Licensed 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 com.cinchapi.concourse.bugrepro; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.lang.Criteria; +import com.cinchapi.concourse.test.ConcourseIntegrationTest; +import com.cinchapi.concourse.thrift.Operator; + +/** + * Repro of http://jira.cinchapi.com/browse/CON-635 + * + * @author Jeff Nelson + */ +public class CON635 extends ConcourseIntegrationTest { + + @Test + public void repro1() { + client.find(Criteria.where().key("foo").operator(Operator.EQUALS) + .value("Foo’s")); + Assert.assertTrue(true); // lack of Exception means test passes + } + + @Test + public void repor2() { + client.find(Criteria.where().key("foo").operator(Operator.EQUALS) + .value("“A and B”")); + Assert.assertTrue(true); // lack of Exception means test passes + } + +} From ce9c8d8d3fecab5d5ec1171a9b75655dab421064 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 16 Feb 2019 20:51:20 -0500 Subject: [PATCH 2/4] upgrade CCL module to 2.5.2 --- concourse-driver-java/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concourse-driver-java/build.gradle b/concourse-driver-java/build.gradle index 7de10443ed..76ca9b2970 100644 --- a/concourse-driver-java/build.gradle +++ b/concourse-driver-java/build.gradle @@ -25,7 +25,7 @@ dependencies { compile 'org.slf4j:log4j-over-slf4j:1.7.5' compile 'org.slf4j:jcl-over-slf4j:1.7.5' compile 'com.google.code.gson:gson:2.5' - compile group: 'com.cinchapi', name: 'ccl', version:'2.5.1' + compile group: 'com.cinchapi', name: 'ccl', version:'2.5.2' testCompile project(':concourse-unit-test-core') testCompile 'com.github.marschall:memoryfilesystem:0.9.0' From c979a776c0b59276cd09fc14365990cd062e4263 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 16 Feb 2019 20:59:32 -0500 Subject: [PATCH 3/4] javadoc update --- .../src/main/java/com/cinchapi/concourse/lang/Language.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java index acf7cd6ec5..34269c2ad0 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/lang/Language.java @@ -27,7 +27,6 @@ import com.cinchapi.ccl.grammar.ValueSymbol; import com.cinchapi.common.base.AnyStrings; import com.cinchapi.common.reflect.Reflection; -import com.cinchapi.concourse.Tag; import com.cinchapi.concourse.thrift.TCriteria; import com.cinchapi.concourse.thrift.TSymbol; import com.cinchapi.concourse.thrift.TSymbolType; @@ -42,7 +41,8 @@ public final class Language { /** - * The character that indicates a String should be treated as a {@link Tag}. + * The character that indicates a String should be treated as a + * {@link com.cinchapi.concourse.Tag}. */ private static final char TAG_MARKER = Reflection.getStatic("TAG_MARKER", Convert.class); // (authorized) From 5e3f533af604bc0011dbdd16cc23eb1c8dfa8d7d Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Sat, 16 Feb 2019 21:01:29 -0500 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c45c09f976..7dab080f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ #### Version 0.9.6 (TBD) * Fixed a bug that caused a `ParseException` to be thrown when trying to use a `Criteria` object containing a string value wrapped in single or double quotes out of necessity (i.e. because the value contained a keyword). This bug happened because the wrapping quotes were dropped by Concourse Server when parsing the `Criteria`. +* Fixed a bug where the CCL parser failed to handle some Unicode quote characters. #### Version 0.9.5 (December 30, 2018) * Fixed a bug where some of the `ManagedConcourseServer#get` methods in the `concourse-ete-test-core` package called the wrong upstream method of the Concourse Server instance under management. This had the effect of causing a runtime `ClassCastException` when trying to use those methods.