Index: extensions/modeshape-search-lucene/src/main/java/org/modeshape/search/lucene/LuceneSearchSession.java =================================================================== --- extensions/modeshape-search-lucene/src/main/java/org/modeshape/search/lucene/LuceneSearchSession.java (revision 1700) +++ extensions/modeshape-search-lucene/src/main/java/org/modeshape/search/lucene/LuceneSearchSession.java (working copy) @@ -1030,11 +1030,6 @@ public class LuceneSearchSession implements WorkspaceSession { protected String likeExpresionForWildcardPath( String path ) { if (path.equals("/") || path.equals("%")) return path; StringBuilder sb = new StringBuilder(); - if (path.startsWith("%/")) { - sb.append("%"); - if (path.length() == 2) return sb.toString(); - path = path.substring(2); - } for (String segment : path.split("/")) { if (segment.length() == 0) continue; sb.append("/"); Index: extensions/modeshape-search-lucene/src/main/java/org/modeshape/search/lucene/query/CompareStringQuery.java =================================================================== --- extensions/modeshape-search-lucene/src/main/java/org/modeshape/search/lucene/query/CompareStringQuery.java (revision 1700) +++ extensions/modeshape-search-lucene/src/main/java/org/modeshape/search/lucene/query/CompareStringQuery.java (working copy) @@ -284,9 +284,9 @@ public class CompareStringQuery extends CompareQuery { String result = likeExpression.replaceAll("\\\\(.)", "$1"); // Escape characters used as metacharacters in regular expressions, including // '[', '^', '\', '$', '.', '|', '?', '*', '+', '(', and ')' - result = result.replaceAll("([$.|?*+()\\[\\\\^\\\\\\\\])", "\\\\$1"); - // Replace '%'->'[.]*' and '_'->'[.] - result = result.replace("%", ".*").replace("_", "."); + result = result.replaceAll("([\\[^\\\\$.|?*+()])", "\\$1"); + // Replace '%'->'[.]+' and '_'->'[.] + result = likeExpression.replace("%", ".+").replace("_", "."); return result; } Index: extensions/modeshape-search-lucene/src/test/java/org/modeshape/search/lucene/query/CompareStringQueryTest.java deleted file mode 100644 =================================================================== --- extensions/modeshape-search-lucene/src/test/java/org/modeshape/search/lucene/query/CompareStringQueryTest.java (revision 1700) +++ /dev/null (working copy) @@ -1,44 +0,0 @@ -/* - * ModeShape (http://www.modeshape.org) - * See the COPYRIGHT.txt file distributed with this work for information - * regarding copyright ownership. Some portions may be licensed - * to Red Hat, Inc. under one or more contributor license agreements. - * See the AUTHORS.txt file in the distribution for a full listing of - * individual contributors. - * - * ModeShape is free software. Unless otherwise indicated, all code in ModeShape - * is licensed to you under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * ModeShape is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.modeshape.search.lucene.query; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import org.junit.Test; - -public class CompareStringQueryTest { - - @Test - public void shouldConvertToRegularExpression() { - assertRegex("Node", "Node"); - assertRegex("%/Node", ".*/Node"); - assertRegex("Node[1]", "Node\\[1]"); - assertRegex("%/Node[1]", ".*/Node\\[1]"); - } - - protected void assertRegex( String input, - String expectedOutput ) { - assertThat(CompareStringQuery.toRegularExpression(input), is(expectedOutput)); - } -} Index: extensions/modeshape-sequencer-msoffice/pom.xml =================================================================== --- extensions/modeshape-sequencer-msoffice/pom.xml (revision 1700) +++ extensions/modeshape-sequencer-msoffice/pom.xml (working copy) @@ -31,12 +31,12 @@ org.apache.poi poi - 3.6 + 3.2-FINAL org.apache.poi poi-scratchpad - 3.6 + 3.2-FINAL junit Index: modeshape-common/src/main/java/org/modeshape/common/util/Base64.java =================================================================== --- modeshape-common/src/main/java/org/modeshape/common/util/Base64.java (revision 1700) +++ modeshape-common/src/main/java/org/modeshape/common/util/Base64.java (working copy) @@ -24,7 +24,15 @@ package org.modeshape.common.util; import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.zip.GZIPInputStream; import org.modeshape.common.SystemFailureException; /** @@ -35,74 +43,25 @@ import org.modeshape.common.SystemFailureException; * Homepage: http://iharder.net/base64. *

*

- * Example: - *

- * String encoded = Base64.encode( myByteArray );
byte[] myByteArray = Base64.decode( encoded ); - *

* The options parameter, which appears in a few places, is used to pass several pieces of information to the encoder. In * the "higher level" methods such as encodeBytes( bytes, options ) the options parameter can be used to indicate such things as - * first gzipping the bytes before encoding them, not inserting linefeeds, and encoding using the URL-safe and Ordered dialects. - *

- *

- * Note, according to RFC3548, Section 2.1, implementations should not add - * line feeds unless explicitly told to do so. I've got Base64 set to this behavior now, although earlier versions broke lines by - * default. + * first gzipping the bytes before encoding them, not inserting linefeeds (though that breaks strict Base64 compatibility), and + * encoding using the URL-safe and Ordered dialects. *

*

* The constants defined in Base64 can be OR-ed together to combine options, so you might make a call like this: *

- * String encoded = Base64.encodeBytes( mybytes, Base64.GZIP | Base64.DO_BREAK_LINES ); + * String encoded = Base64.encodeBytes( mybytes, Base64.GZIP | Base64.DONT_BREAK_LINES ); *

- * to compress the data before encoding it and then making the output have newline characters. + * to compress the data before encoding it and then making the output have no newline characters. *

*

- * Also... - *

- * String encoded = Base64.encodeBytes( crazyString.getBytes() ); - *

* Change Log: *

*