fix for altenativeTemplates by Index

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@499 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 20 years ago
parent 3762acde6e
commit 7665712faa

@ -256,16 +256,13 @@ public final class httpTemplate {
int whichPattern=0;
String patternName="";
if(pattern.containsKey(prefix + key) && pattern.get(prefix + key) != null){
String patternId=(String)pattern.get(prefix + key);
try{
Object tmp=pattern.get(prefix + key); //lookup by index OR Name
if(tmp instanceof String){
byName=true;
patternName=(String)tmp;//Name
}else{
whichPattern=(int)Integer.parseInt((String)pattern.get(prefix + key)); //index
}
whichPattern=(int)Integer.parseInt(patternId); //index
}catch(NumberFormatException e){
whichPattern=0;
byName=true;
patternName=patternId;
}
}else{
//System.out.println("Pattern \""+new String(prefix + key)+"\" is not set"); //DEBUG

Loading…
Cancel
Save