Index: lucene/src/test/org/apache/lucene/store/TestMultiMMap.java =================================================================== --- lucene/src/test/org/apache/lucene/store/TestMultiMMap.java (revision 1125948) +++ lucene/src/test/org/apache/lucene/store/TestMultiMMap.java (working copy) @@ -51,7 +51,7 @@ } private void assertChunking(Random random, int chunkSize) throws Exception { - File path = File.createTempFile("mmap" + chunkSize, "tmp", workDir); + File path = _TestUtil.createTempFile("mmap" + chunkSize, "tmp", workDir); path.delete(); path.mkdirs(); MMapDirectory dir = new MMapDirectory(path); Index: lucene/src/test/org/apache/lucene/store/TestMD5.java =================================================================== --- lucene/src/test/org/apache/lucene/store/TestMD5.java (revision 0) +++ lucene/src/test/org/apache/lucene/store/TestMD5.java (revision 0) @@ -0,0 +1,56 @@ +package org.apache.lucene.store; + +/** + * 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 java.io.UnsupportedEncodingException; +import java.math.BigInteger; + +import org.apache.lucene.util.LuceneTestCase; + +/** + * Simple test for some known MD5 values from http://en.wikipedia.org/wiki/MD5 + */ +public class TestMD5 extends LuceneTestCase { + + public void testSimple() { + assertHashesTo("9e107d9d372bb6826bd81d3542a419d6", + "The quick brown fox jumps over the lazy dog"); + + assertHashesTo("e4d909c290d0fb1ca068ffaddf22cbd0", + "The quick brown fox jumps over the lazy dog."); + + assertHashesTo("d41d8cd98f00b204e9800998ecf8427e", + ""); + } + + public static void assertHashesTo(String expected, String input) { + MD5Digest digest = new MD5Digest(); + byte inputBytes[] = null; + try { + inputBytes = input.getBytes("UTF-8"); + } catch (UnsupportedEncodingException e) { + // Should never happen + throw new RuntimeException(e); + } + digest.update(inputBytes, 0, inputBytes.length); + byte outputBytes[] = new byte[16]; + digest.doFinal(outputBytes, 0); + String actual = String.format("%032x", new BigInteger(1, outputBytes)); + assertEquals(expected, actual); + } +} Property changes on: lucene/src/test/org/apache/lucene/store/TestMD5.java ___________________________________________________________________ Added: svn:eol-style + native Index: lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java =================================================================== --- lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java (revision 1125948) +++ lucene/src/test/org/apache/lucene/store/TestBufferedIndexInput.java (working copy) @@ -87,7 +87,7 @@ // NOTE: this does only test the chunked reads and NOT if the Bug is triggered. //final int tmpFileSize = 1024 * 1024 * 5; final int inputBufferSize = 128; - File tmpInputFile = File.createTempFile("IndexInput", "tmpFile"); + File tmpInputFile = _TestUtil.createTempFile("IndexInput", "tmpFile", TEMP_DIR); tmpInputFile.deleteOnExit(); writeBytes(tmpInputFile, TEST_FILE_LENGTH); Index: lucene/src/java/org/apache/lucene/store/MD5Digest.java =================================================================== --- lucene/src/java/org/apache/lucene/store/MD5Digest.java (revision 0) +++ lucene/src/java/org/apache/lucene/store/MD5Digest.java (revision 0) @@ -0,0 +1,361 @@ +package org.apache.lucene.store; + +/** + * 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. + */ + +/* + * Copyright (c) 2000-2009 The Legion Of The Bouncy Castle + * (http://www.bouncycastle.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * implementation of MD5 as outlined in "Handbook of Applied Cryptography", + * pages 346 - 347. + */ +final class MD5Digest { + private int H1, H2, H3, H4; // IV's + + private int[] X = new int[16]; + private int xOff; + + private byte[] xBuf; + private int xBufOff; + + private long byteCount; + + /** + * Standard constructor + */ + public MD5Digest() { + xBuf = new byte[4]; + xBufOff = 0; + reset(); + } + + /** + * update the message digest with a block of bytes. + * + * @param in the byte array containing the data. + * @param inOff the offset into the byte array where the data starts. + * @param len the length of the data. + */ + public void update(byte[] in, int inOff, int len) { + // + // fill the current word + // + while ((xBufOff != 0) && (len > 0)) { + update(in[inOff]); + + inOff++; + len--; + } + + // + // process whole words. + // + while (len > xBuf.length) { + processWord(in, inOff); + + inOff += xBuf.length; + len -= xBuf.length; + byteCount += xBuf.length; + } + + // + // load in the remainder. + // + while (len > 0) { + update(in[inOff]); + + inOff++; + len--; + } + } + + /** + * update the message digest with a single byte. + * + * @param in the input byte to be entered. + */ + public void update(byte in) { + xBuf[xBufOff++] = in; + + if (xBufOff == xBuf.length) { + processWord(xBuf, 0); + xBufOff = 0; + } + + byteCount++; + } + + /** + * close the digest, producing the final digest value. The doFinal call leaves + * the digest reset. + * + * @param out the array the digest is to be copied into. + * @param outOff the offset into the out array the digest is to start at. + */ + public int doFinal(byte[] out, int outOff) { + long bitLength = (byteCount << 3); + + // + // add the pad bytes. + // + update((byte) 128); + + while (xBufOff != 0) { + update((byte) 0); + } + + processLength(bitLength); + + processBlock(); + + unpackWord(H1, out, outOff); + unpackWord(H2, out, outOff + 4); + unpackWord(H3, out, outOff + 8); + unpackWord(H4, out, outOff + 12); + + reset(); + + return 16; + } + + /** + * reset the chaining variables to the IV values. + */ + public void reset() { + byteCount = 0; + + xBufOff = 0; + for (int i = 0; i < xBuf.length; i++) { + xBuf[i] = 0; + } + + H1 = 0x67452301; + H2 = 0xefcdab89; + H3 = 0x98badcfe; + H4 = 0x10325476; + + xOff = 0; + + for (int i = 0; i != X.length; i++) { + X[i] = 0; + } + } + + private void processWord(byte[] in, int inOff) { + X[xOff++] = (in[inOff] & 0xff) | ((in[inOff + 1] & 0xff) << 8) + | ((in[inOff + 2] & 0xff) << 16) | ((in[inOff + 3] & 0xff) << 24); + + if (xOff == 16) { + processBlock(); + } + } + + private void processLength(long bitLength) { + if (xOff > 14) { + processBlock(); + } + + X[14] = (int) (bitLength & 0xffffffff); + X[15] = (int) (bitLength >>> 32); + } + + private void unpackWord(int word, byte[] out, int outOff) { + out[outOff] = (byte) word; + out[outOff + 1] = (byte) (word >>> 8); + out[outOff + 2] = (byte) (word >>> 16); + out[outOff + 3] = (byte) (word >>> 24); + } + + // + // round 1 left rotates + // + private static final int S11 = 7; + private static final int S12 = 12; + private static final int S13 = 17; + private static final int S14 = 22; + + // + // round 2 left rotates + // + private static final int S21 = 5; + private static final int S22 = 9; + private static final int S23 = 14; + private static final int S24 = 20; + + // + // round 3 left rotates + // + private static final int S31 = 4; + private static final int S32 = 11; + private static final int S33 = 16; + private static final int S34 = 23; + + // + // round 4 left rotates + // + private static final int S41 = 6; + private static final int S42 = 10; + private static final int S43 = 15; + private static final int S44 = 21; + + /* + * rotate int x left n bits. + */ + private int rotateLeft(int x, int n) { + return (x << n) | (x >>> (32 - n)); + } + + /* + * F, G, H and I are the basic MD5 functions. + */ + private int F(int u, int v, int w) { + return (u & v) | (~u & w); + } + + private int G(int u, int v, int w) { + return (u & w) | (v & ~w); + } + + private int H(int u, int v, int w) { + return u ^ v ^ w; + } + + private int K(int u, int v, int w) { + return v ^ (u | ~w); + } + + private void processBlock() { + int a = H1; + int b = H2; + int c = H3; + int d = H4; + + // + // Round 1 - F cycle, 16 times. + // + a = rotateLeft(a + F(b, c, d) + X[0] + 0xd76aa478, S11) + b; + d = rotateLeft(d + F(a, b, c) + X[1] + 0xe8c7b756, S12) + a; + c = rotateLeft(c + F(d, a, b) + X[2] + 0x242070db, S13) + d; + b = rotateLeft(b + F(c, d, a) + X[3] + 0xc1bdceee, S14) + c; + a = rotateLeft(a + F(b, c, d) + X[4] + 0xf57c0faf, S11) + b; + d = rotateLeft(d + F(a, b, c) + X[5] + 0x4787c62a, S12) + a; + c = rotateLeft(c + F(d, a, b) + X[6] + 0xa8304613, S13) + d; + b = rotateLeft(b + F(c, d, a) + X[7] + 0xfd469501, S14) + c; + a = rotateLeft(a + F(b, c, d) + X[8] + 0x698098d8, S11) + b; + d = rotateLeft(d + F(a, b, c) + X[9] + 0x8b44f7af, S12) + a; + c = rotateLeft(c + F(d, a, b) + X[10] + 0xffff5bb1, S13) + d; + b = rotateLeft(b + F(c, d, a) + X[11] + 0x895cd7be, S14) + c; + a = rotateLeft(a + F(b, c, d) + X[12] + 0x6b901122, S11) + b; + d = rotateLeft(d + F(a, b, c) + X[13] + 0xfd987193, S12) + a; + c = rotateLeft(c + F(d, a, b) + X[14] + 0xa679438e, S13) + d; + b = rotateLeft(b + F(c, d, a) + X[15] + 0x49b40821, S14) + c; + + // + // Round 2 - G cycle, 16 times. + // + a = rotateLeft(a + G(b, c, d) + X[1] + 0xf61e2562, S21) + b; + d = rotateLeft(d + G(a, b, c) + X[6] + 0xc040b340, S22) + a; + c = rotateLeft(c + G(d, a, b) + X[11] + 0x265e5a51, S23) + d; + b = rotateLeft(b + G(c, d, a) + X[0] + 0xe9b6c7aa, S24) + c; + a = rotateLeft(a + G(b, c, d) + X[5] + 0xd62f105d, S21) + b; + d = rotateLeft(d + G(a, b, c) + X[10] + 0x02441453, S22) + a; + c = rotateLeft(c + G(d, a, b) + X[15] + 0xd8a1e681, S23) + d; + b = rotateLeft(b + G(c, d, a) + X[4] + 0xe7d3fbc8, S24) + c; + a = rotateLeft(a + G(b, c, d) + X[9] + 0x21e1cde6, S21) + b; + d = rotateLeft(d + G(a, b, c) + X[14] + 0xc33707d6, S22) + a; + c = rotateLeft(c + G(d, a, b) + X[3] + 0xf4d50d87, S23) + d; + b = rotateLeft(b + G(c, d, a) + X[8] + 0x455a14ed, S24) + c; + a = rotateLeft(a + G(b, c, d) + X[13] + 0xa9e3e905, S21) + b; + d = rotateLeft(d + G(a, b, c) + X[2] + 0xfcefa3f8, S22) + a; + c = rotateLeft(c + G(d, a, b) + X[7] + 0x676f02d9, S23) + d; + b = rotateLeft(b + G(c, d, a) + X[12] + 0x8d2a4c8a, S24) + c; + + // + // Round 3 - H cycle, 16 times. + // + a = rotateLeft(a + H(b, c, d) + X[5] + 0xfffa3942, S31) + b; + d = rotateLeft(d + H(a, b, c) + X[8] + 0x8771f681, S32) + a; + c = rotateLeft(c + H(d, a, b) + X[11] + 0x6d9d6122, S33) + d; + b = rotateLeft(b + H(c, d, a) + X[14] + 0xfde5380c, S34) + c; + a = rotateLeft(a + H(b, c, d) + X[1] + 0xa4beea44, S31) + b; + d = rotateLeft(d + H(a, b, c) + X[4] + 0x4bdecfa9, S32) + a; + c = rotateLeft(c + H(d, a, b) + X[7] + 0xf6bb4b60, S33) + d; + b = rotateLeft(b + H(c, d, a) + X[10] + 0xbebfbc70, S34) + c; + a = rotateLeft(a + H(b, c, d) + X[13] + 0x289b7ec6, S31) + b; + d = rotateLeft(d + H(a, b, c) + X[0] + 0xeaa127fa, S32) + a; + c = rotateLeft(c + H(d, a, b) + X[3] + 0xd4ef3085, S33) + d; + b = rotateLeft(b + H(c, d, a) + X[6] + 0x04881d05, S34) + c; + a = rotateLeft(a + H(b, c, d) + X[9] + 0xd9d4d039, S31) + b; + d = rotateLeft(d + H(a, b, c) + X[12] + 0xe6db99e5, S32) + a; + c = rotateLeft(c + H(d, a, b) + X[15] + 0x1fa27cf8, S33) + d; + b = rotateLeft(b + H(c, d, a) + X[2] + 0xc4ac5665, S34) + c; + + // + // Round 4 - K cycle, 16 times. + // + a = rotateLeft(a + K(b, c, d) + X[0] + 0xf4292244, S41) + b; + d = rotateLeft(d + K(a, b, c) + X[7] + 0x432aff97, S42) + a; + c = rotateLeft(c + K(d, a, b) + X[14] + 0xab9423a7, S43) + d; + b = rotateLeft(b + K(c, d, a) + X[5] + 0xfc93a039, S44) + c; + a = rotateLeft(a + K(b, c, d) + X[12] + 0x655b59c3, S41) + b; + d = rotateLeft(d + K(a, b, c) + X[3] + 0x8f0ccc92, S42) + a; + c = rotateLeft(c + K(d, a, b) + X[10] + 0xffeff47d, S43) + d; + b = rotateLeft(b + K(c, d, a) + X[1] + 0x85845dd1, S44) + c; + a = rotateLeft(a + K(b, c, d) + X[8] + 0x6fa87e4f, S41) + b; + d = rotateLeft(d + K(a, b, c) + X[15] + 0xfe2ce6e0, S42) + a; + c = rotateLeft(c + K(d, a, b) + X[6] + 0xa3014314, S43) + d; + b = rotateLeft(b + K(c, d, a) + X[13] + 0x4e0811a1, S44) + c; + a = rotateLeft(a + K(b, c, d) + X[4] + 0xf7537e82, S41) + b; + d = rotateLeft(d + K(a, b, c) + X[11] + 0xbd3af235, S42) + a; + c = rotateLeft(c + K(d, a, b) + X[2] + 0x2ad7d2bb, S43) + d; + b = rotateLeft(b + K(c, d, a) + X[9] + 0xeb86d391, S44) + c; + + H1 += a; + H2 += b; + H3 += c; + H4 += d; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + for (int i = 0; i != X.length; i++) { + X[i] = 0; + } + } +} Property changes on: lucene/src/java/org/apache/lucene/store/MD5Digest.java ___________________________________________________________________ Added: svn:eol-style + native Index: lucene/src/java/org/apache/lucene/store/FSDirectory.java =================================================================== --- lucene/src/java/org/apache/lucene/store/FSDirectory.java (revision 1125948) +++ lucene/src/java/org/apache/lucene/store/FSDirectory.java (working copy) @@ -22,8 +22,7 @@ import java.io.FilenameFilter; import java.io.IOException; import java.io.RandomAccessFile; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; +import java.io.UnsupportedEncodingException; import java.util.Collection; import static java.util.Collections.synchronizedSet; @@ -111,16 +110,8 @@ * @see Directory */ public abstract class FSDirectory extends Directory { - private final static MessageDigest DIGESTER; + private final static MD5Digest DIGESTER = new MD5Digest(); - static { - try { - DIGESTER = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e.toString(), e); - } - } - /** * Default read chunk size. This is a conditional default: on 32bit JVMs, it defaults to 100 MB. On 64bit JVMs, it's * Integer.MAX_VALUE. @@ -353,9 +344,17 @@ throw new RuntimeException(e.toString(), e); } - byte digest[]; + byte digest[] = new byte[16]; synchronized (DIGESTER) { - digest = DIGESTER.digest(dirName.getBytes()); + byte bytes[] = null; + try { + bytes = dirName.getBytes("UTF-8"); + } catch (UnsupportedEncodingException e) { + // Should never happen + throw new RuntimeException(e); + } + DIGESTER.update(bytes, 0, bytes.length); + DIGESTER.doFinal(digest, 0); } StringBuilder buf = new StringBuilder(); buf.append("lucene-"); Index: lucene/src/java/org/apache/lucene/util/Constants.java =================================================================== --- lucene/src/java/org/apache/lucene/util/Constants.java (revision 1125948) +++ lucene/src/java/org/apache/lucene/util/Constants.java (working copy) @@ -43,6 +43,8 @@ public static final boolean WINDOWS = OS_NAME.startsWith("Windows"); /** True iff running on SunOS. */ public static final boolean SUN_OS = OS_NAME.startsWith("SunOS"); + /** True iff running on Mac OS X */ + public static final boolean MAC_OS_X = OS_NAME.startsWith("Mac OS X"); public static final String OS_ARCH = System.getProperty("os.arch"); public static final String OS_VERSION = System.getProperty("os.version"); Index: lucene/src/test-framework/org/apache/lucene/search/QueryUtils.java =================================================================== --- lucene/src/test-framework/org/apache/lucene/search/QueryUtils.java (revision 1125948) +++ lucene/src/test-framework/org/apache/lucene/search/QueryUtils.java (working copy) @@ -1,5 +1,22 @@ package org.apache.lucene.search; +/** + * 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 java.io.IOException; import java.util.Random; import java.lang.reflect.Method; @@ -17,27 +34,13 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.RAMDirectory; +import org.apache.lucene.util.Constants; import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.ReaderUtil; import org.apache.lucene.util._TestUtil; import static org.apache.lucene.util.LuceneTestCase.TEST_VERSION_CURRENT; -/** - * Copyright 2005 Apache Software Foundation - * - * 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. - */ @@ -128,6 +131,12 @@ } catch (IOException e) { throw new RuntimeException(e); } + // on macos X, serialization fires up the PKCS11 system?! + // kill its resource-leak thread, to clean up after ourselves. + if (Constants.MAC_OS_X) + for (Thread t : Thread.getAllStackTraces().keySet()) + if (t.getName().equals("Poller SunPKCS11-Darwin")) + t.interrupt(); } /** Index: lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java =================================================================== --- lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java (revision 1125948) +++ lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java (working copy) @@ -1119,7 +1119,7 @@ final Class clazz = Class.forName(clazzName).asSubclass(Directory.class); // If it is a FSDirectory type, try its ctor(File) if (FSDirectory.class.isAssignableFrom(clazz)) { - final File tmpFile = File.createTempFile("test", "tmp", TEMP_DIR); + final File tmpFile = _TestUtil.createTempFile("test", "tmp", TEMP_DIR); tmpFile.delete(); tmpFile.mkdir(); tempDirs.add(tmpFile.getAbsolutePath()); Index: lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java =================================================================== --- lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java (revision 1125948) +++ lucene/src/test-framework/org/apache/lucene/util/_TestUtil.java (working copy) @@ -373,4 +373,51 @@ field.isStoreOffsetWithTermVector(), field.getOmitNorms(), false, field.getOmitTermFreqAndPositions()); } } + + /** + * insecure, fast version of File.createTempFile + * uses Random instead of SecureRandom. + */ + public static File createTempFile(String prefix, String suffix, File directory) + throws IOException { + // Force a prefix null check first + if (prefix.length() < 3) { + throw new IllegalArgumentException("prefix must be 3"); + } + String newSuffix = suffix == null ? ".tmp" : suffix; + File result; + do { + result = genTempFile(prefix, newSuffix, directory); + } while (!result.createNewFile()); + return result; + } + + /* Temp file counter */ + private static int counter = 0; + + /* identify for differnt VM processes */ + private static int counterBase = 0; + + private static class TempFileLocker {}; + private static TempFileLocker tempFileLocker = new TempFileLocker(); + + private static File genTempFile(String prefix, String suffix, File directory) { + int identify = 0; + + synchronized (tempFileLocker) { + if (counter == 0) { + int newInt = new Random().nextInt(); + counter = ((newInt / 65535) & 0xFFFF) + 0x2710; + counterBase = counter; + } + identify = counter++; + } + + StringBuilder newName = new StringBuilder(); + newName.append(prefix); + newName.append(counterBase); + newName.append(identify); + newName.append(suffix); + return new File(directory, newName.toString()); + } } Index: lucene/LICENSE.txt =================================================================== --- lucene/LICENSE.txt (revision 1125948) +++ lucene/LICENSE.txt (working copy) @@ -333,4 +333,28 @@ * dealings in this Software without prior written authorization of the * copyright holder. */ - \ No newline at end of file + +This is the copyright for src/java/org/apache/lucene/store/MD5Digest.java: + +/* + * Copyright (c) 2000-2009 The Legion Of The Bouncy Castle + * (http://www.bouncycastle.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */