Fix some strange things on ApacheCon

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@832571 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2009-11-03 21:38:28 +00:00
parent 340efc119e
commit e69b4d43f6
3 changed files with 10 additions and 18 deletions

View File

@ -152,12 +152,10 @@ public final class SegmentInfo {
delCount = src.delCount;
}
// must be Map<String, String>
void setDiagnostics(Map<String, String> diagnostics) {
this.diagnostics = diagnostics;
}
// returns Map<String, String>
public Map<String, String> getDiagnostics() {
return diagnostics;
}
@ -714,13 +712,13 @@ public final class SegmentInfo {
* has the same dir and same name. */
@Override
public boolean equals(Object obj) {
SegmentInfo other;
try {
other = (SegmentInfo) obj;
} catch (ClassCastException cce) {
if (this == obj) return true;
if (obj instanceof SegmentInfo) {
final SegmentInfo other = (SegmentInfo) obj;
return other.dir == dir && other.name.equals(name);
} else {
return false;
}
return other.dir == dir && other.name.equals(name);
}
@Override

View File

@ -28,6 +28,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Vector;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@ -648,14 +649,7 @@ public final class SegmentInfos extends Vector<SegmentInfo> {
if (gen == -1) {
// Neither approach found a generation
String s;
if (files != null) {
s = "";
for(int i=0;i<files.length;i++)
s += " " + files[i];
} else
s = " null";
throw new FileNotFoundException("no segments* file found in " + directory + ": files:" + s);
throw new FileNotFoundException("no segments* file found in " + directory + ": files: " + Arrays.toString(files));
}
}

View File

@ -60,13 +60,13 @@ public class MessageImpl implements Message {
@Override
public String toString() {
Object[] args = getArguments();
String argsString = "";
StringBuilder sb = new StringBuilder(getKey());
if (args != null) {
for (int i = 0; i < args.length; i++) {
argsString += args[i] + (i < args.length ? "" : ", ");
sb.append(i == 0 ? " " : ", ").append(args[i]);
}
}
return getKey() + " " + argsString;
return sb.toString();
}
}